LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Graphs
    • Functional API
    • Pregel
    • Checkpointing
    • Storage
    • Caching
    • Types
    • Runtime
    • Config
    • Errors
    • Constants
    • Channels
    • Agents
    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

    OverviewGraphsFunctional APIPregelCheckpointingStorageCachingTypesRuntimeConfigErrorsConstantsChannelsAgents
    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    PythonlanggraphpregelmainPregelastream_events
    Method●Since v1.2

    astream_events

    Copy
    astream_events(
      self,
      input: InputT | Command | None,
      config: RunnableConfig
    View source on GitHub
    |
    None
    =
    None
    ,
    *
    ,
    version
    :
    Literal
    [
    'v1'
    ,
    'v2'
    ,
    'v3'
    ]
    =
    'v2'
    ,
    interrupt_before
    :
    All
    |
    Sequence
    [
    str
    ]
    |
    None
    =
    None
    ,
    interrupt_after
    :
    All
    |
    Sequence
    [
    str
    ]
    |
    None
    =
    None
    ,
    control
    :
    RunControl
    |
    None
    =
    None
    ,
    transformers
    :
    Sequence
    [
    Callable
    [
    [
    tuple
    [
    str
    ,
    .
    .
    .
    ]
    ]
    ,
    Any
    ]
    ]
    |
    None
    =
    None
    ,
    **
    kwargs
    :
    Any
    =
    {
    }
    )
    ->
    AsyncIterator
    [
    StreamEvent
    ]
    |
    Awaitable
    [
    Any
    ]

    Async variant of stream_events.

    For version="v3", returns an AsyncGraphRunStream whose projections can be awaited concurrently; each subscribed cursor drives the pump when its buffer is empty. The same nesting limitation as the sync path applies — see stream_events for details.

    Warning

    The version="v3" API is experimental and may change.

    See stream_events for full argument and return documentation.