MCPcopy
hub / github.com/langchain-ai/langchain / add_documents

Method add_documents

libs/core/langchain_core/vectorstores.py:191–203  ·  view source on GitHub ↗

Run more documents through the embeddings and add to the vectorstore. Args: documents: Documents to add to the vectorstore. Returns: List of IDs of the added texts.

(self, documents: List[Document], **kwargs: Any)

Source from the content-addressed store, hash-verified

189 return await run_in_executor(None, self.add_texts, texts, metadatas, **kwargs)
190
191 def add_documents(self, documents: List[Document], **kwargs: Any) -> List[str]:
192 """Run more documents through the embeddings and add to the vectorstore.
193
194 Args:
195 documents: Documents to add to the vectorstore.
196
197 Returns:
198 List of IDs of the added texts.
199 """
200 # TODO: Handle the case where the user doesn't provide ids on the Collection
201 texts = [doc.page_content for doc in documents]
202 metadatas = [doc.metadata for doc in documents]
203 return self.add_texts(texts, metadatas, **kwargs)
204
205 async def aadd_documents(
206 self, documents: List[Document], **kwargs: Any

Callers 15

add_documentsFunction · 0.45
add_documentsFunction · 0.45
add_documentsFunction · 0.45
ingest.pyFile · 0.45
chain.pyFile · 0.45
add_documentsFunction · 0.45
test_reset_collectionFunction · 0.45
upsertMethod · 0.45
add_documentsMethod · 0.45

Calls 1

add_textsMethod · 0.95