Skip to content

Commit 92b6015

Browse files
committed
Complete thinking.md documentation with AWS Bedrock examples
1 parent 5fa446a commit 92b6015

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

docs/thinking.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,56 @@ agent = Agent(model, model_settings=settings)
6666

6767
## Bedrock
6868

69+
Although Bedrock Converse doesn't provide a unified API to enable thinking, you can still use [`BedrockModelSettings.bedrock_additional_model_requests_fields`][pydantic_ai.models.bedrock.BedrockModelSettings.bedrock_additional_model_requests_fields] [model setting](agents.md#model-run-settings) to pass provider-specific configuration:
70+
71+
=== "Claude"
72+
73+
```python {title="bedrock_claude_thinking_part.py"}
74+
75+
model = BedrockConverseModel("us.anthropic.claude-sonnet-4-5-20250929-v1:0")
76+
model_settings = BedrockModelSettings(
77+
bedrock_additional_model_requests_fields={
78+
"thinking": {"type": "enabled", "budget_tokens": 1024}
79+
}
80+
)
81+
agent = Agent(model=model, model_settings=model_settings)
82+
83+
```
84+
=== "OpenAI"
85+
86+
87+
```python {title="bedrock_openai_thinking_part.py"}
88+
89+
model = BedrockConverseModel("openai.gpt-oss-120b-1:0")
90+
model_settings = BedrockModelSettings(
91+
bedrock_additional_model_requests_fields={"reasoning_effort": "low"}
92+
)
93+
agent = Agent(model=model, model_settings=model_settings)
94+
95+
```
96+
=== "Qwen"
97+
98+
99+
```python {title="bedrock_qwen_thinking_part.py"}
100+
101+
model = BedrockConverseModel("qwen.qwen3-32b-v1:0")
102+
model_settings = BedrockModelSettings(
103+
bedrock_additional_model_requests_fields={"reasoning_config": "high"}
104+
)
105+
agent = Agent(model=model, model_settings=model_settings)
106+
107+
```
108+
109+
=== "Deepseek"
110+
Reasoning is [always enabled](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-reasoning.html) for Deepseek model
111+
112+
```python {title="bedrock_deepseek_thinking_part.py"}
113+
114+
model = BedrockConverseModel("us.deepseek.r1-v1:0")
115+
agent = Agent(model=model)
116+
117+
```
118+
69119
## Groq
70120

71121
Groq supports different formats to receive thinking parts:

0 commit comments

Comments
 (0)