
Get text embeddings with optional caching
get_embeddings.RdA thin wrapper around fuzzylink::get_embeddings() that adds
file-based caching. If cache points to an existing file, embeddings
for documents already present in the cache are loaded from disk.
Embeddings for any documents not found in the cache are fetched via
the API and appended to the cache before returning.
Arguments
- documents
A character vector of texts to embed.
- cache
Optional path to an
.rdsfile. If the file exists, cached embeddings matchingdocuments(by row name) are reused. Any new documents are fetched and written back to the cache. IfNULL, embeddings are always computed fresh without caching.- ...
Additional arguments passed to
fuzzylink::get_embeddings().