LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-corelanguage_modelschat_modelsBaseChatModelstream_v2
    Method●Since v1.3

    stream_v2

    Copy
    stream_v2(
      self,
      input: LanguageModelInput,
      config: RunnableConfig | None = None,
      *,
      stop
    View source on GitHub
    :
    list
    [
    str
    ]
    |
    None
    =
    None
    ,
    **
    kwargs
    :
    Any
    =
    {
    }
    )
    ->
    ChatModelStream

    Parameters

    NameTypeDescription
    input*LanguageModelInput

    The model input.

    configRunnableConfig | None
    Default:None

    Optional runnable config.

    stoplist[str] | None
    Default:None
    **kwargsAny
    Default:{}

    Stream content-block lifecycle events for a single model call.

    Returns a ChatModelStream with typed projections (.text, .reasoning, .tool_calls, .output).

    Warning

    This API is experimental and may change.

    Always produces v1-shaped content

    ChatModelStream.output.content is always a list of v1 content blocks (text / reasoning / tool_call / image / …), regardless of the model's output_version attribute. The setting only affects the legacy stream() / astream() / invoke() paths. If you're mixing stream_v2 with those paths in the same pipeline and need a consistent output shape across them, set output_version="v1" on the model.

    Optional list of stop words.

    Additional keyword arguments passed to the model.