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-sdkstreamdecodersMessagesDecoder
    Class●Since v0.4

    MessagesDecoder

    Copy
    MessagesDecoder(
      self,
      namespace: list[str],
      stream_factory: Callable[..., Any]

    Constructors

    Methods

    View source on GitHub
    )

    Parameters

    NameTypeDescription
    namespace*list[str]
    stream_factory*Callable[..., Any]
    constructor
    __init__
    NameType
    namespacelist[str]
    stream_factoryCallable[..., Any]
    method
    feed

    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.

    Events whose namespace differs are ignored (scope filter).

    Keyword-only (namespace, node, message_id) -> stream. Sync binds ChatModelStream; async binds AsyncChatModelStream.