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

    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph-sdkschema
    Module●Since v0.1

    schema

    Data models for interacting with the LangGraph API.

    Attributes

    attribute
    RunStatus: Literal['pending', 'running', 'error', 'success', 'timeout', 'interrupted']
    attribute
    ThreadStatus: Literal['idle', 'busy', 'interrupted', 'error']
    attribute
    ThreadStreamMode: Literal['run_modes', 'lifecycle', 'state_update']
    attribute
    StreamMode: Literal['values', 'messages', 'updates', 'events', 'tasks', 'checkpoints', 'debug', 'custom', 'messages-tuple']
    attribute
    DisconnectMode: Literal['cancel', 'continue']
    attribute
    MultitaskStrategy: Literal['reject', 'interrupt', 'rollback', 'enqueue']
    attribute
    OnConflictBehavior: Literal['raise', 'do_nothing']
    attribute
    OnCompletionBehavior: Literal['delete', 'keep']
    attribute
    Durability: Literal['sync', 'async', 'exit']
    attribute
    All: Literal['*']
    attribute
    IfNotExists: Literal['create', 'reject']
    attribute
    PruneStrategy: Literal['delete', 'keep_latest']
    attribute
    CancelAction: Literal['interrupt', 'rollback']
    attribute
    BulkCancelRunsStatus: Literal['pending', 'running', 'all']
    attribute
    AssistantSortBy: Literal['assistant_id', 'graph_id', 'name', 'created_at', 'updated_at']
    attribute
    ThreadSortBy: Literal['thread_id', 'status', 'created_at', 'updated_at', 'state_updated_at']
    attribute
    CronSortBy: Literal['cron_id', 'assistant_id', 'thread_id', 'created_at', 'updated_at', 'next_run_date', 'end_time']
    attribute
    SortOrder: Literal['asc', 'desc']
    attribute
    Subgraphs: dict[str, GraphSchema]
    attribute
    AssistantSelectField: Literal['assistant_id', 'graph_id', 'name', 'description', 'config', 'context', 'created_at', 'updated_at', 'metadata', 'version']
    attribute
    ThreadSelectField: Literal['thread_id', 'created_at', 'updated_at', 'metadata', 'config', 'context', 'status', 'values', 'interrupts']
    attribute
    RunSelectField: Literal['run_id', 'thread_id', 'assistant_id', 'created_at', 'updated_at', 'status', 'metadata', 'kwargs', 'multitask_strategy']
    attribute
    CronSelectField: Literal['cron_id', 'assistant_id', 'thread_id', 'end_time', 'schedule', 'timezone', 'created_at', 'updated_at', 'user_id', 'payload', 'next_run_date', 'metadata', 'now', 'on_run_completed', 'enabled']
    attribute
    StreamVersion: Literal['v1', 'v2']

    Classes

    class
    LangSmithTracing
    class
    Config
    class
    Checkpoint
    class
    GraphSchema
    class
    AssistantBase
    class
    AssistantVersion
    class
    Assistant
    class
    AssistantsSearchResponse
    class
    Interrupt
    class
    Thread
    class
    ThreadTask
    class
    ThreadState
    class
    ThreadUpdateStateResponse
    class
    Run
    class
    Cron
    class
    CronUpdate
    class
    RunCreate
    class
    Item
    class
    ListNamespaceResponse
    class
    SearchItem
    class
    SearchItemsResponse
    class
    StreamPart
    class
    TaskPayload
    class
    TaskResultPayload
    class
    CheckpointTaskPayload
    class
    CheckpointPayload
    class
    RunMetadataPayload
    class
    ValuesStreamPart
    class
    UpdatesStreamPart
    class
    MessagesPartialStreamPart
    class
    MessagesCompleteStreamPart
    class
    MessagesMetadataStreamPart
    class
    MessagesTupleStreamPart
    class
    CustomStreamPart
    class
    CheckpointsStreamPart
    class
    TasksStreamPart
    class
    DebugStreamPart
    class
    MetadataStreamPart
    class
    Send
    class
    Command
    class
    RunCreateMetadata

    Type Aliases

    View source on GitHub
    typeAlias
    Json: dict[str, Any] | None
    typeAlias
    PrimitiveData
    typeAlias
    QueryParamTypes: Mapping[str, PrimitiveData | Sequence[PrimitiveData]] | list[tuple[str, PrimitiveData]] | tuple[tuple[str, PrimitiveData], ...] | str | bytes
    typeAlias
    DebugPayload
    typeAlias
    StreamPartV2
    typeAlias
    Input: TypeAlias
    typeAlias
    Context: TypeAlias

    Represents the status of a run:

    • "pending": The run is waiting to start.
    • "running": The run is currently executing.
    • "error": The run encountered an error and stopped.
    • "success": The run completed successfully.
    • "timeout": The run exceeded its time limit.
    • "interrupted": The run was manually stopped or interrupted.

    Represents the status of a thread:

    • "idle": The thread is not currently processing any task.
    • "busy": The thread is actively processing a task.
    • "interrupted": The thread's execution was interrupted.
    • "error": An exception occurred during task processing.

    Defines the mode of streaming:

    • "run_modes": Stream the same events as the runs on thread, as well as run_done events.
    • "lifecycle": Stream only run start/end events.
    • "state_update": Stream state updates on the thread.

    Defines the mode of streaming:

    • "values": Stream only the values.
    • "messages": Stream complete messages.
    • "updates": Stream updates to the state.
    • "events": Stream events occurring during execution.
    • "checkpoints": Stream checkpoints as they are created.
    • "tasks": Stream task start and finish events.
    • "debug": Stream detailed debug information.
    • "custom": Stream custom events.

    Specifies behavior on disconnection:

    • "cancel": Cancel the operation on disconnection.
    • "continue": Continue the operation even if disconnected.

    Defines how to handle multiple tasks:

    • "reject": Reject new tasks when busy.
    • "interrupt": Interrupt current task for new ones.
    • "rollback": Roll back current task and start new one.
    • "enqueue": Queue new tasks for later execution.

    Specifies behavior on conflict:

    • "raise": Raise an exception when a conflict occurs.
    • "do_nothing": Ignore conflicts and proceed.

    Defines action after completion:

    • "delete": Delete resources after completion.
    • "keep": Retain resources after completion.

    Durability mode for the graph execution.

    • "sync": Changes are persisted synchronously before the next step starts.
    • "async": Changes are persisted asynchronously while the next step executes.
    • "exit": Changes are persisted only when the graph exits.

    Represents a wildcard or 'all' selector.

    Specifies behavior if the thread doesn't exist:

    • "create": Create a new thread if it doesn't exist.
    • "reject": Reject the operation if the thread doesn't exist.

    Strategy for pruning threads:

    • "delete": Remove threads entirely.
    • "keep_latest": Prune old checkpoints but keep threads and their latest state.

    Action to take when cancelling the run.

    • "interrupt": Simply cancel the run.
    • "rollback": Cancel the run. Then delete the run and associated checkpoints.

    Filter runs by status when bulk-cancelling:

    • "pending": Cancel only pending runs.
    • "running": Cancel only running runs.
    • "all": Cancel all runs regardless of status.

    The field to sort by.

    The field to sort by.

    The field to sort by.

    The order to sort by.

    Stream format version.

    • "v1": Traditional format — raw SSE StreamPart NamedTuples.
    • "v2": Each event is a typed dict with type, ns, and data keys.

    Configuration for LangSmith tracing.

    Configuration options for a call.

    Represents a checkpoint in the execution process.

    Defines the structure and properties of a graph.

    Base model for an assistant.

    Represents a specific version of an assistant.

    Represents an assistant with additional properties.

    Paginated response for assistant search results.

    Represents an interruption in the execution flow.

    Represents a conversation thread.

    Represents a task within a thread.

    Represents the state of a thread.

    Represents the response from updating a thread's state.

    Represents a single execution run.

    Represents a scheduled task.

    Payload for updating a cron job. All fields are optional.

    Defines the parameters for initiating a background run.

    Represents a single document or data entry in the graph's Store.

    Items are used to store cross-thread memories.

    Response structure for listing namespaces.

    Item with an optional relevance score from search operations.

    Response structure for searching items.

    Represents a part of a stream response.

    Payload for a task start event.

    Payload for a task result event.

    A task entry within a CheckpointPayload.

    The keys present depend on the task's state:

    • Error: id, name, error, state
    • Has result: id, name, result, interrupts, state
    • Pending: id, name, interrupts, state

    Payload for a checkpoint event.

    Payload for the metadata control event.

    Stream part emitted for stream_mode="values".

    Stream part emitted for stream_mode="updates".

    Stream part emitted for partial message chunks (messages/partial).

    Stream part emitted for complete messages (messages/complete).

    Stream part emitted for message metadata (messages/metadata).

    Stream part emitted for stream_mode="messages" (raw message+metadata pair).

    Stream part emitted for stream_mode="custom".

    Stream part emitted for stream_mode="checkpoints".

    Stream part emitted for stream_mode="tasks".

    Stream part emitted for stream_mode="debug".

    Control event with run_id and other run metadata.

    Represents a message to be sent to a specific node in the graph.

    This type is used to explicitly send messages to nodes in the graph, typically used within Command objects to control graph execution flow.

    Represents one or more commands to control graph execution flow and state.

    This type defines the control commands that can be returned by nodes to influence graph execution. It lets you navigate to other nodes, update graph state, and resume from interruptions.

    Metadata for a run creation request.

    Represents a JSON-like structure, which can be None or a dictionary with string keys and any values.

    Wrapper payload for debug events. Discriminate on type.

    Discriminated union of all v2 stream part types.

    Use part["type"] to narrow the type.