From 8a2f1a9445ed1b467cdeb0fcb89dba2c67bd2bb3 Mon Sep 17 00:00:00 2001 From: ccurme Date: Tue, 30 Jun 2026 14:35:03 -0400 Subject: [PATCH] chore(anthropic): update docstring following sonnet-5 release (#38577) --- .../anthropic/langchain_anthropic/chat_models.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libs/partners/anthropic/langchain_anthropic/chat_models.py b/libs/partners/anthropic/langchain_anthropic/chat_models.py index 9def0e668ef..edffea935ad 100644 --- a/libs/partners/anthropic/langchain_anthropic/chat_models.py +++ b/libs/partners/anthropic/langchain_anthropic/chat_models.py @@ -1005,15 +1005,17 @@ class ChatAnthropic(BaseChatModel): Examples: - `#!python {"type": "enabled", "budget_tokens": 10_000}` (pre-4.7 models) - - `#!python {"type": "adaptive"}` (Opus 4.6+) - - `#!python {"type": "adaptive", "display": "summarized"}` (Opus 4.7+) + - `#!python {"type": "adaptive"}` (Opus 4.6+, Sonnet 5) + - `#!python {"type": "adaptive", "display": "summarized"}` (Opus 4.7+, Sonnet 5) + - `#!python {"type": "disabled"}` (Sonnet 5, where adaptive thinking is + on by default) - !!! note "Claude Opus 4.7" + !!! note "Claude Opus 4.7+ and Sonnet 5" - `budget_tokens` is removed on Opus 4.7 — use `{"type": "adaptive"}` - with `output_config.effort` to control reasoning effort. Set `display` - to `"summarized"` to receive summarized reasoning in the response - (default is `"omitted"`). + `budget_tokens` is removed on these models — use `{"type": "adaptive"}` + with `output_config.effort` to control reasoning effort. The default + `display` is `"omitted"`; set it to `"summarized"` to receive + summarized reasoning in the response. """ output_config: dict[str, Any] | None = None