docs: enhance docstring for disable_streaming parameter in BaseChatModel (#31759)

Resolves #31758
This commit is contained in:
Mason Daugherty 2025-06-27 11:27:41 -04:00 committed by GitHub
parent e8e89b0b82
commit 9aa75eaef3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -300,9 +300,15 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
defer to ``invoke()``/``ainvoke()``.
- If True, will always bypass streaming case.
- If "tool_calling", will bypass streaming case only when the model is called
with a ``tools`` keyword argument.
- If ``'tool_calling'``, will bypass streaming case only when the model is called
with a ``tools`` keyword argument. In other words, LangChain will automatically
switch to non-streaming behavior (``invoke()``) only when the tools argument is
provided. This offers the best of both worlds.
- If False (default), will always use streaming case if available.
The main reason for this flag is that code might be written using ``.stream()`` and
a user may want to swap out a given model for another model whose the implementation
does not properly support streaming.
"""
@model_validator(mode="before")