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

    Chat LangChain

    What can I help with?

    Enter to sendยทShift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-coretracers_compatpydantic_to_dict
    Functionโ—Since v1.8

    pydantic_to_dict

    Copy
    pydantic_to_dict(
        obj: Any,
        kwargs: Any = {},
    ) -> dict[str
    View source on GitHub
    ,
    Any
    ]

    Parameters

    NameTypeDescription
    obj*Any
    **kwargsAny
    Default:{}

    Convert any Pydantic model to dict, compatible with both v1 and v2.

    The Pydantic model to convert.

    Additional arguments passed to model_dump/dict.