Home / Function/ from_texts() — langchain Function Reference

from_texts() — langchain Function Reference

Architecture documentation for the from_texts() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  6bba087d_29e7_c047_38e4_a8acc2e8b69d["from_texts()"]
  6c336ac6_f55c_1ad7_6db3_73dbd71fb625["VectorStore"]
  6bba087d_29e7_c047_38e4_a8acc2e8b69d -->|defined in| 6c336ac6_f55c_1ad7_6db3_73dbd71fb625
  d53e755c_f22a_3702_9ca0_af9f8caaa28d["from_documents()"]
  d53e755c_f22a_3702_9ca0_af9f8caaa28d -->|calls| 6bba087d_29e7_c047_38e4_a8acc2e8b69d
  style 6bba087d_29e7_c047_38e4_a8acc2e8b69d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/vectorstores/base.py lines 848–868

    def from_texts(
        cls: type[VST],
        texts: list[str],
        embedding: Embeddings,
        metadatas: list[dict] | None = None,
        *,
        ids: list[str] | None = None,
        **kwargs: Any,
    ) -> VST:
        """Return `VectorStore` initialized from texts and embeddings.

        Args:
            texts: Texts to add to the `VectorStore`.
            embedding: Embedding function to use.
            metadatas: Optional list of metadatas associated with the texts.
            ids: Optional list of IDs associated with the texts.
            **kwargs: Additional keyword arguments.

        Returns:
            `VectorStore` initialized from texts and embeddings.
        """

Subdomains

Called By

Frequently Asked Questions

What does from_texts() do?
from_texts() is a function in the langchain codebase, defined in libs/core/langchain_core/vectorstores/base.py.
Where is from_texts() defined?
from_texts() is defined in libs/core/langchain_core/vectorstores/base.py at line 848.
What calls from_texts()?
from_texts() is called by 1 function(s): from_documents.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free