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_asyncstreamAsyncThreadStream
    Class●Since v0.3

    AsyncThreadStream

    Copy
    AsyncThreadStream(
      self,
      *,
      http: HttpClient,
      thread_id: str,
      assistant_id: str

    Constructors

    Attributes

    Methods

    View source on GitHub
    ,
    headers
    :
    Mapping
    [
    str
    ,
    str
    ]
    |
    None
    =
    None
    ,
    max_queue_size
    :
    int
    =
    1024
    ,
    run_start_timeout
    :
    float
    |
    None
    =
    None
    ,
    explicit_thread_id
    :
    bool
    =
    False
    ,
    transport_kind
    :
    Literal
    [
    'sse'
    ,
    'websocket'
    ]
    =
    'sse'
    )
    constructor
    __init__
    NameType
    httpHttpClient
    thread_idstr
    assistant_idstr
    headersMapping[str, str] | None
    max_queue_sizeint
    run_start_timeoutfloat | None
    explicit_thread_idbool
    transport_kindLiteral['sse', 'websocket']
    attribute
    thread_id: thread_id
    attribute
    assistant_id: assistant_id
    attribute
    interrupted: bool
    attribute
    interrupts: list[InterruptPayload]
    attribute
    run
    attribute
    agent
    attribute
    output
    attribute
    values
    attribute
    messages
    attribute
    tool_calls
    attribute
    subgraphs
    attribute
    subagents
    attribute
    extensions
    attribute
    events: AsyncIterator[Event]

    Return a fresh subscription to ALL channels.

    Each property access opens a new subscription; callers iterating twice will see two independent streams (both filtered by the same channel union). Terminates when the stream closes (server hangup, __aexit__, or transport-level close).

    method
    close

    Tear down the thread stream. Idempotent.

    method
    observe_applied_through_seq

    Advance the reconnect cursor from a command response meta sequence.

    method
    subscribe

    Open a typed subscription against the shared SSE.

    Returns an async iterator that yields raw Event dicts matching the given filter. Multiple concurrent subscribes share one HTTP connection whose union expands or rotates as subscriptions come and go.

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

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