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

Method from_documents

libs/core/langchain_core/vectorstores.py:677–691  ·  view source on GitHub ↗

Return VectorStore initialized from documents and embeddings. Args: documents: List of Documents to add to the vectorstore. embedding: Embedding function to use.

(
        cls: Type[VST],
        documents: List[Document],
        embedding: Embeddings,
        **kwargs: Any,
    )

Source from the content-addressed store, hash-verified

675
676 @classmethod
677 def from_documents(
678 cls: Type[VST],
679 documents: List[Document],
680 embedding: Embeddings,
681 **kwargs: Any,
682 ) -> VST:
683 """Return VectorStore initialized from documents and embeddings.
684
685 Args:
686 documents: List of Documents to add to the vectorstore.
687 embedding: Embedding function to use.
688 """
689 texts = [d.page_content for d in documents]
690 metadatas = [d.metadata for d in documents]
691 return cls.from_texts(texts, embedding, metadatas=metadatas, **kwargs)
692
693 @classmethod
694 async def afrom_documents(

Callers 15

agent.pyFile · 0.45
chain.pyFile · 0.45
chain.pyFile · 0.45
ingest.pyFile · 0.45
chain.pyFile · 0.45
ingest.pyFile · 0.45
ingest.pyFile · 0.45
_ingestFunction · 0.45
ingest.pyFile · 0.45
_ingestFunction · 0.45
load_ts_git_datasetFunction · 0.45
loadFunction · 0.45

Calls 1

from_textsMethod · 0.45

Tested by

no test coverage detected