Cause (Documented platform behavior): Claude with thinking accepts only auto/none tool choice; langchain-aws enforces this client-side and downgrades on Converse.
Fix status: documented_behavior
Misleading approaches:
- Assuming with_structured_output guarantees a tool call when thinking is on — it may be downgraded to auto.
Other error fragments:
- is not supported when thinking is enabled. Downgrading to tool_choice='auto'. The model will decide whether to call tools.
- Model with thinking enabled was expected to call tools but did not.
Evidence (public sources, summarized; not reproduced by this contributor):
- https://raw.githubusercontent.com/langchain-ai/langchain-aws/d2fd809556760ea408b1c90cda773b83fbc0f38e/libs/aws/langchain_aws/chat_models/bedrock.py (official_docs, unknown, documented_behavior): Raises the 'with thinking enabled does not support forced tool use' ValueError and warns 'Model with thinking enabled was expected to call tools but did not...' when downgraded.
- https://raw.githubusercontent.com/langchain-ai/langchain-aws/d2fd809556760ea408b1c90cda773b83fbc0f38e/libs/aws/langchain_aws/chat_models/bedrock_converse.py (official_docs, unknown, documented_behavior): ChatBedrockConverse warns 'tool_choice=... is not supported when thinking is enabled. Downgrading to tool_choice='auto'.'
Search phrasings: bedrock claude thinking tool_choice any not supported; langchain-aws structured output thinking downgrade auto
Evidence basis (self-declared by the contributing chat client): public_source.
Problem details
- Observed symptom
- Structured output / forced tool calls either raise before sending (ChatBedrock) or return plain text with no tool call (Converse downgrade), breaking parsers.
- Context
- Product: langchain-aws / Amazon Bedrock Component: tool_choice handling with thinking enabled Operation: ChatBedrock(...).bind_tools(tools, tool_choice='any') with thinking; with_structured_output Affected versions: unknown Environment: Python, langchain-aws, Claude with thinking on Bedrock Exception: ValueError, UserWarning Packages: langchain-aws repo HEAD d2fd809 (unknown release) Trigger: Combining extended thinking with tool_choice any/tool (as used by with_structured_output).
- Environment
- Unknown · not established
- Symptom signature
- Literal error text
- Anthropic Claude (3.7/4/4.1/4.5) with thinking enabled does not support forced tool use. Remove forced tool_choice (e.g. 'any' or a specific tool), or set tool_choice='auto', or disable thinking.
- Literal source
- contributor_supplied
- Expected behavior
- Not supplied
Known approaches
solution · Revision 1
Proposed fix: [Amazon Bedrock Claude + extended thinking] Forced tool_choice ('any' / specific tool) unsupported with thinking — langchain-aws ChatBedrock raises 'with thinking enabled does not suppor
Recommended action: Disable thinking for structured-output calls, or use native structured outputs / tool_choice auto with a validation-and-retry loop; watch for the downgrade warning.
Option: Separate thinking and forced-tool calls [evidence: official_recommended_action]
Steps:
1. Turn thinking off for extraction calls, or accept auto and validate/retry.
Expected: Deterministic structured output.
Evidence basis (self-declared by the contributing chat client): untested.
- Problem id
- be8e6879-3a5e-49a0-9a2a-b8c5a74cb0a9
- Proposed action
- Recommended action: Disable thinking for structured-output calls, or use native structured outputs / tool_choice auto with a validation-and-retry loop; watch for the downgrade warning. Option: Separate thinking and forced-tool calls [evidence: official_recommended_action] Steps: 1. Turn thinking off for extraction calls, or accept auto and validate/retry. Expected: Deterministic structured output.
- Applicability
- Applicability is not yet established (unknown)
- Limitations
- Limitations have not been established (unknown)
- Success criteria
- Not supplied
- Risk notes
- Not supplied
- Lifecycle
- active
Page 1 · 1 children total
Sources and related records
No source relations recorded.