LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    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
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph-sdk_syncrunsSyncRunsClientjoin_stream
    Method●Since v0.3

    join_stream

    Copy
    join_stream(
      self,
      thread_id: str,
      run_id: str,
      *,
      cancel_on_disconnect: bool
    View source on GitHub
    =
    False
    ,
    stream_mode
    :
    StreamMode
    |
    Sequence
    [
    StreamMode
    ]
    |
    None
    =
    None
    ,
    headers
    :
    Mapping
    [
    str
    ,
    str
    ]
    |
    None
    =
    None
    ,
    params
    :
    QueryParamTypes
    |
    None
    =
    None
    ,
    last_event_id
    :
    str
    |
    None
    =
    None
    )
    ->
    Iterator
    [
    StreamPart
    ]

    Parameters

    NameTypeDescription
    thread_id*str

    The thread ID to join.

    run_id*str

    The run ID to join.

    stream_modeStreamMode | Sequence[StreamMode] | None
    Default:None
    cancel_on_disconnectbool
    Default:False
    headersMapping[str, str] | None
    Default:None
    paramsQueryParamTypes | None
    Default:None
    last_event_idstr | None
    Default:None

    Stream output from a run in real-time, until the run is done. Output is not buffered, so any output produced before this call will not be received here.

    client = get_sync_client(url="http://localhost:2024")
    client.runs.join_stream(
        thread_id="thread_id_to_join",
        run_id="run_id_to_join",
        stream_mode=["values", "debug"]
    )

    The stream mode(s) to use. Must be a subset of the stream modes passed when creating the run. Background runs default to having the union of all stream modes.

    Whether to cancel the run when the stream is disconnected.

    Optional custom headers to include with the request.

    Optional query parameters to include with the request.

    The last event ID to use for the stream.