LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-corevectorstoresbaseVectorStoreafrom_texts
    Methodā—Since v0.2

    afrom_texts

    Copy
    afrom_texts(
      cls,
      texts: list[str],
      embedding: Embeddings,
      metadatas: list
    View source on GitHub
    [
    dict
    ]
    |
    None
    =
    None
    ,
    *
    ,
    ids
    :
    list
    [
    str
    ]
    |
    None
    =
    None
    ,
    **
    kwargs
    :
    Any
    =
    {
    }
    )
    ->
    Self

    Parameters

    NameTypeDescription
    texts*list[str]

    Texts to add to the VectorStore.

    embedding*Embeddings

    Embedding function to use.

    metadataslist[dict] | None
    Default:None
    idslist[str] | None
    Default:None
    **kwargsAny
    Default:{}

    Async return VectorStore initialized from texts and embeddings.

    Optional list of metadatas associated with the texts.

    Optional list of IDs associated with the texts.

    Additional keyword arguments.