LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Graphs
    • Functional API
    • Pregel
    • Checkpointing
    • Storage
    • Caching
    • Types
    • Runtime
    • Config
    • Errors
    • Constants
    • Channels
    • Agents
    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewGraphsFunctional APIPregelCheckpointingStorageCachingTypesRuntimeConfigErrorsConstantsChannelsAgents
    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph_internal_pydanticcreate_model
    Functionā—Since v0.6

    create_model

    Copy
    create_model(
      model_name: str,
      *,
      field_definitions: dict[str, Any] | None 
    View source on GitHub
    =
    None
    ,
    root
    :
    Any
    |
    None
    =
    None
    )
    ->
    type
    [
    BaseModel
    ]

    Parameters

    NameTypeDescription
    model_name*str

    The name of the model.

    module_name*unknown

    The name of the module where the model is defined. This is used by Pydantic to resolve any forward references.

    field_definitionsdict[str, Any] | None
    Default:None

    The field definitions for the model.

    rootAny | None
    Default:None

    Create a pydantic model with the given field definitions.

    Attention:

    Please do not use outside of langchain packages. This API is subject to change at any time.

    Type for a root model (RootModel)