Chunks documents, embeds the chunks, and adds them to the vector store.
Arguments
- ret
A
securecontext_retrieverobject.- documents
A list of
securecontext_documentobjects, or a single document.- chunk_strategy
Chunking strategy (see
chunk_text()).- ...
Additional arguments passed to
chunk_text().
Examples
emb <- embed_tfidf(c("cat sat on mat", "dog ran in park"))
vs <- vector_store$new(dims = emb@dims)
ret <- retriever(vs, emb)
add_documents(ret, document("The cat sat on the mat."))
vs$size()
#> [1] 1