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-sdkstreamdecoders
    Module●Since v0.4

    decoders

    Attributes

    Functions

    Classes

    View source on GitHub
    attribute
    SUPPORTED_INTERLEAVE_CHANNELS
    attribute
    RESERVED_INTERLEAVE_CHANNELS
    attribute
    SubgraphStatus: Literal['started', 'completed', 'failed', 'interrupted']
    function
    validate_interleave_channels

    Reject reserved protocol channel names before they hit the fallback.

    Genuine extension names pass through untouched; only names that infer_channel treats as built-in methods without an interleave decoder are rejected, so a typo'd or unsupported protocol channel surfaces an error instead of an empty stream.

    class
    Decoder
    class
    DataDecoder

    Yields params.data from events of a single method.

    Covers the channels whose projection is just "emit the payload": values, updates, checkpoints, tasks — the SDK analog of local's Values/Updates/Checkpoints/TasksTransformer, all of which push params["data"] unchanged. The REST-state seeding for values stays at the projection layer; it is a one-shot pre-stream fetch, not part of the event state machine.

    class
    MessagesDecoder

    Yields one chat-model stream per message-start event.

    Subsequent events route to the matching stream via stream.dispatch(data). Mirrors the per-event body of _MessagesProjection._messages_iter (_async/stream.py:404-458). The subscription open/close and the _root_messages_inbox drain branch stay at the projection layer.

    class
    ToolCallsDecoder

    Yields one tool-call handle per tool-started event.

    Mirrors the per-event body of _ToolCallsProjection._tool_calls_iter (_async/stream.py:1168-1217). The thread register/unregister and the terminal-error-on-close finally stay at the projection / wrapper layer.

    class
    SubgraphsDecoder

    Discovers child subgraph handles and fans out events to active ones.

    Mirrors the per-event body of _SubgraphsProjection._subgraphs_iter (_async/stream.py:963-1041) plus _apply_tasks_result. Root-inbox forwarding and terminal-status-on-close stay at the projection / wrapper layer.

    class
    ExtensionsDecoder

    Yields params.data from one named custom channel.

    Mirrors _ExtensionProjection._iter (_async/stream.py:1278-1299), with an added name filter so it can share one subscription in interleave.

    Per-channel event → items state machines.

    Used both by the projection iterators (_ValuesProjection, _MessagesProjection, _ToolCallsProjection, _SubgraphsProjection) on AsyncThreadStream / SyncThreadStream, and by interleave_projections, which drives multiple decoders from one shared subscription.