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 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 CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    PythonlanggraphgraphstateCompiledStateGraph
    Class●Since v0.1

    CompiledStateGraph

    Copy
    CompiledStateGraph(
      self,
      *,
      builder: StateGraph[StateT, ContextT, InputT, OutputT],
      schema_to_mapper: 

    Bases

    Pregel[StateT, ContextT, InputT, OutputT]Generic[StateT, ContextT, InputT, OutputT

    Constructors

    Attributes

    Methods

    Inherited fromPregel

    Attributes

    Anodes: dict[str, PregelNode]Achannels: dict[str, BaseChannel | ManagedValueSpec]Astream_mode: StreamMode
    —

    Mode to stream output, defaults to 'values'.

    Astream_eager: bool
    —
    View source on GitHub
    dict
    [
    type
    [
    Any
    ]
    ,
    Callable
    [
    [
    Any
    ]
    ,
    Any
    ]
    |
    None
    ]
    ,
    **
    kwargs
    :
    Any
    =
    {
    }
    )
    ]

    Whether to force emitting stream events eagerly, automatically turned on

    Aoutput_channels: str | Sequence[str]
    Astream_channels: str | Sequence[str] | None
    —

    Channels to stream, defaults to all channels not in reserved channels

    Ainterrupt_after_nodes: All | Sequence[str]
    Ainterrupt_before_nodes: All | Sequence[str]
    Ainput_channels: str | Sequence[str]
    Astep_timeout: float | None
    —

    Maximum time to wait for a step to complete, in seconds.

    Adebug: bool
    —

    Whether to print debug information during execution.

    Acheckpointer: Checkpointer
    —

    Checkpointer used to save and load graph state.

    Astore: BaseStore | None
    —

    Memory store to use for SharedValues.

    Acache: BaseCache | None
    —

    Cache to use for storing node results.

    Aretry_policy: Sequence[RetryPolicy]
    —

    Retry policies to use when running tasks. Empty set disables retries.

    Acache_policy: CachePolicy | None
    —

    Cache policy to use for all nodes. Can be overridden by individual nodes.

    Acontext_schema: type[ContextT] | None
    —

    Specifies the schema for the context object that will be passed to the workflow.

    Aconfig: RunnableConfig | None
    Aname: str
    Atrigger_to_nodes: Mapping[str, Sequence[str]]
    AInputType: Any
    AOutputType: Any
    Astream_channels_list: Sequence[str]
    Astream_channels_asis: str | Sequence[str]

    Methods

    Mget_graph
    —

    Return a drawable representation of the computation graph.

    Maget_graph
    —

    Return a drawable representation of the computation graph.

    McopyMwith_config
    —

    Create a copy of the Pregel object with an updated config.

    MvalidateMconfig_schemaMget_config_jsonschemaMget_context_jsonschemaMget_input_schemaMget_output_schemaMget_subgraphs
    —

    Get the subgraphs of the graph.

    Maget_subgraphs
    —

    Get the subgraphs of the graph.

    Mget_state
    —

    Get the current state of the graph.

    Maget_state
    —

    Get the current state of the graph.

    Mget_state_history
    —

    Get the history of the state of the graph.

    Maget_state_history
    —

    Asynchronously get the history of the state of the graph.

    Mbulk_update_state
    —

    Apply updates to the graph state in bulk. Requires a checkpointer to be set.

    Mabulk_update_state
    —

    Asynchronously apply updates to the graph state in bulk. Requires a checkpointer to be set.

    Mupdate_state
    —

    Update the state of the graph with the given values, as if they came from

    Maupdate_state
    —

    Asynchronously update the state of the graph with the given values, as if they came from

    Mstream
    —

    Stream graph steps for a single input.

    Mastream
    —

    Asynchronously stream graph steps for a single input.

    Minvoke
    —

    Run the graph with a single input and config.

    Mainvoke
    —

    Asynchronously run the graph with a single input and config.

    Mclear_cache
    —

    Clear the cache for the given nodes.

    Maclear_cache
    —

    Asynchronously clear the cache for the given nodes.

    Inherited fromPregelProtocol

    Methods

    Mwith_configMget_graphMaget_graphMget_stateMaget_stateMget_state_historyMaget_state_historyMbulk_update_stateMabulk_update_stateMupdate_stateMaupdate_stateMstreamMastreamMinvokeMainvoke

    Inherited fromRunnable(langchain_core)

    Attributes

    AnameAInputTypeAOutputTypeAinput_schemaAoutput_schemaAconfig_specs

    Methods

    Mget_nameMget_input_schemaMget_output_schemaMconfig_schemaMget_config_jsonschemaMget_graph
    constructor
    __init__
    NameType
    builderStateGraph[StateT, ContextT, InputT, OutputT]
    schema_to_mapperdict[type[Any], Callable[[Any], Any] | None]
    attribute
    builder: StateGraph[StateT, ContextT, InputT, OutputT]
    attribute
    schema_to_mapper: dict[type[Any], Callable[[Any], Any] | None]
    method
    get_input_jsonschema
    method
    get_output_jsonschema
    method
    attach_node
    method
    attach_edge
    method
    attach_branch
    M
    get_prompts
    Mpipe
    Mpick
    Massign
    Minvoke
    Mainvoke
    Mbatch
    Mbatch_as_completed
    Mabatch
    Mabatch_as_completed
    Mstream
    Mastream
    Mastream_log
    Mastream_events
    Mtransform
    Matransform
    Mbind
    Mwith_config
    Mwith_listeners
    Mwith_alisteners
    Mwith_types
    Mwith_retry
    Mmap
    Mwith_fallbacks
    Mas_tool