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-coreloadmapping
    Module●Since v0.1

    mapping

    Serialization mapping.

    This file contains a mapping between the lc_namespace path for a given subclass that implements from Serializable to the namespace where that class is actually located.

    This mapping helps maintain the ability to serialize and deserialize well-known LangChain objects even if they are moved around in the codebase across different LangChain versions.

    For example, the code for the AIMessage class is located in langchain_core.messages.ai.AIMessage. This message is associated with the lc_namespace of ["langchain", "schema", "messages", "AIMessage"], because this code was originally in langchain.schema.messages.AIMessage.

    The mapping allows us to deserialize an AIMessage created with an older version of LangChain where the code was in a different location.

    Attributes

    attribute
    SERIALIZABLE_MAPPING: dict[tuple[str, ...], tuple[str, ...]]
    attribute
    OLD_CORE_NAMESPACES_MAPPING: dict[tuple[str, ...], tuple[str, ...]]
    View source on GitHub