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-sdkstreamtransporthttpProtocolSseTransport
    Classā—Since v0.3

    ProtocolSseTransport

    Copy
    ProtocolSseTransport(
      self,
      *,
      client: httpx.AsyncClient,
      thread_id: str,
      commands_path: str

    Constructors

    Attributes

    Methods

    View source on GitHub
    |
    None
    =
    None
    ,
    stream_path
    :
    str
    |
    None
    =
    None
    ,
    headers
    :
    Mapping
    [
    str
    ,
    str
    ]
    |
    None
    =
    None
    ,
    max_queue_size
    :
    int
    =
    1024
    )
    constructor
    __init__
    NameType
    clienthttpx.AsyncClient
    thread_idstr
    commands_pathstr | None
    stream_pathstr | None
    headersMapping[str, str] | None
    max_queue_sizeint
    attribute
    thread_id: thread_id
    method
    send_command

    POST a command. Returns the response JSON, or None for 202/204.

    method
    open_event_stream

    Open an independent filtered SSE event stream.

    Posts params as a SubscribeParams body to /threads/{thread_id}/stream/events. Returns an EventStreamHandle whose events async iterator yields typed Event dicts as the server emits them. handle.ready resolves on a 2xx response (rejects on HTTP error or transport failure before headers).

    Reconnect: pass params["since"] to filter outbound seqs server-side. The cursor goes in the request body, not as a Last-Event-ID header.

    method
    close

    Cancel any open event streams and mark the transport closed. Idempotent.

    v3 protocol transport bound to a single thread_id.

    Commands go to POST /threads/{thread_id}/commands (JSON in, JSON out). open_event_stream opens filtered SSE streams against POST /threads/{thread_id}/stream/events.