From 3c19cafab0ca27411ff8fa4fc2c3f8880125b88d Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Wed, 16 Jul 2025 12:29:07 -0400 Subject: [PATCH] docs: improve `output_version` description (#31977) --- libs/core/langchain_core/language_models/chat_models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/core/langchain_core/language_models/chat_models.py b/libs/core/langchain_core/language_models/chat_models.py index 3f264e854d5..b9f5c799b07 100644 --- a/libs/core/langchain_core/language_models/chat_models.py +++ b/libs/core/langchain_core/language_models/chat_models.py @@ -311,14 +311,16 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC): does not properly support streaming. """ - output_version: str = "v0" + output_version: Literal["v0", "v1"] = "v0" """Version of AIMessage output format to use. This field is used to roll-out new output formats for chat model AIMessages in a backwards-compatible way. - All chat models currently support the default of ``"v0"``. Chat model subclasses - can override with (customizable) supported values. + ``'v1'`` standardizes output format using a list of typed ContentBlock dicts. We + recommend this for new applications. + + All chat models currently support the default of ``"v0"``. .. versionadded:: 0.3.68 """