LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • 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

Used in Docs

  • Frontend

Constructors

Attributes

Methods

Inherited fromPregel

Attributes

Anodes: dict[str, StateNodeSpec[Any, ContextT]]Achannels: dict[str, BaseChannel]Astream_mode: StreamMode
—

Mode to stream output, defaults to 'values'.

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

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
Astore: BaseStore | None
Acache: cache
Aretry_policy: Sequence[RetryPolicy]
Acache_policy: cache_policy
Acontext_schema: context_schema
Aconfig: RunnableConfig
Aname: str
Atrigger_to_nodes: trigger_to_nodes
AInputType: Any
AOutputType: Any
Astream_channels_list: Sequence[str]
Astream_channels_asis: str | Sequence[str]

Methods

Mget_graph
—

Get graph by graph name.

Maget_graph
—

Get graph by graph name.

Mcopy
—

Return a copy of the channel.

Mwith_configMvalidateMconfig_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 state of a thread.

Maget_state
—

Get the state of a thread.

Mget_state_history
—

Get the state history of a thread.

Maget_state_history
—

Get the state history of a thread.

Mbulk_update_stateMabulk_update_stateMupdate_state
—

Update the state of a thread.

Maupdate_state
—

Update the state of a thread.

MstreamMastreamMinvokeMainvokeMclear_cache
—

Clear the cache for this task.

Maclear_cache
—

Clear the cache for this task.

Inherited fromPregelProtocol

Methods

Mwith_configMget_graph
—

Get graph by graph name.

Maget_graph
—

Get graph by graph name.

Mget_state
—

Get the state of a thread.

Maget_state
—

Get the state of a thread.

Mget_state_history
—

Get the state history of a thread.

Maget_state_history
—

Get the state history of a thread.

Mbulk_update_stateMabulk_update_stateMupdate_state
—

Update the state of a thread.

Maupdate_state
—

Update the state of a thread.

MstreamMastreamMinvokeMainvoke

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
Mget_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