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-sdk_asyncstream
    Moduleā—Since v0.3

    stream

    Attributes

    Classes

    Type Aliases

    View source on GitHub
    attribute
    SubgraphStatus: Literal['started', 'completed', 'failed', 'interrupted']
    class
    HttpClient

    Handle async requests to the LangGraph API.

    Adds additional error messaging & content handling above the provided httpx client.

    class
    AsyncProtocolTransport

    Protocol implemented by async SSE and WebSocket transports.

    class
    EventStreamHandle

    Handle for one async filtered event stream.

    class
    ProtocolSseTransport

    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.

    class
    ProtocolWebSocketTransport

    v3 protocol transport using HTTP commands and WebSocket events.

    class
    InterruptPayload

    Payload surfaced when the server requests human input for a thread.

    class
    RunModule

    Command dispatcher for run.start.

    Bound to one AsyncThreadStream; accesses its transport and id allocator.

    class
    ScopedStreamHandle

    Scoped streaming handle for one discovered child invocation.

    class
    ToolCallHandle

    Async handle for one root-scope tool call.

    class
    AsyncThreadStream

    Async context manager for one thread's v3 streaming session.

    Construct via client.threads.stream(thread_id=None, *, assistant_id, ...) rather than instantiating directly.

    typeAlias
    QueryParamTypes: Mapping[str, PrimitiveData | Sequence[PrimitiveData]] | list[tuple[str, PrimitiveData]] | tuple[tuple[str, PrimitiveData], ...] | str | bytes

    Async thread-centric streaming surface for the v3 protocol.

    AsyncThreadStream is an async context manager that owns a ProtocolSseTransport for one thread, dispatches commands (run.start, run.respond), exposes typed subscriptions over a single shared SSE (subscribe, events), surfaces lifecycle state (interrupted, interrupts) via an always-on lifecycle watcher SSE, and provides typed projections (thread.values, thread.messages, thread.tool_calls, thread.extensions).

    Direct port of libs/sdk/src/client/stream/index.ts.