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
PythonlanggraphtypesCommand
Classโ—Since v0.2

Command

One or more commands to update the graph's state and send messages to nodes.

Copy
Command(
  self,
  *,
  graph: str | None = None,
  update: Any | None = None,
  resume: dict[str, Any] | Any | None = None,
  goto: Send | Sequence[Send | N] | N = ()
)

Bases

Generic[N]ToolOutputMixin

Used in Docs

  • Build a custom SQL agent
  • Build a personal assistant with subagents
  • Build a SQL agent
  • Build a SQL assistant with on-demand skills
  • Build customer support with handoffs
(1 more not shown)

Parameters

NameTypeDescription
graphstr | None
Default:None

Graph to send the command to. Supported values are:

  • None: the current graph
  • Command.PARENT: closest parent graph
updateAny | None
Default:None

Update to apply to the graph's state.

resumedict[str, Any] | Any | None
Default:None

Value to resume execution with. To be used together with interrupt(). Can be one of the following:

  • Mapping of interrupt ids to resume values
  • A single value with which to resume the next interrupt
gotoSend | Sequence[Send | N] | N
Default:()

Can be one of the following:

  • Name of the node to navigate to next (any node that belongs to the specified graph)
  • Sequence of node names to navigate to next
  • Send object (to execute a node with the input provided)
  • Sequence of Send objects

Constructors

constructor
__init__
NameType
graphstr | None
updateAny | None
resumedict[str, Any] | Any | None
gotoSend | Sequence[Send | N] | N

Attributes

attribute
graph: str | None
attribute
update: Any | None
attribute
resume: dict[str, Any] | Any | None
attribute
goto: Send | Sequence[Send | N] | N
attribute
PARENT: Literal['__parent__']
View source on GitHub