You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* supporting thinking for anthropic models
* drop comments here
* thinking and tool calling support
* fix: properly mock tool use and text block types in Anthropic tests
- Updated the test for the Anthropic tool use conversation flow to include type attributes for mocked ToolUseBlock and text blocks, ensuring accurate simulation of tool interactions during testing.
* feat: add AnthropicThinkingConfig for enhanced thinking capabilities
This update introduces the AnthropicThinkingConfig class to manage thinking parameters for the Anthropic completion model. The LLM and AnthropicCompletion classes have been updated to utilize this new configuration. Additionally, new test cassettes have been added to validate the functionality of thinking blocks across interactions.
Copy file name to clipboardExpand all lines: docs/en/concepts/llms.mdx
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -283,11 +283,54 @@ In this section, you'll find detailed examples that help you select, configure,
283
283
)
284
284
```
285
285
286
+
**Extended Thinking (Claude Sonnet 4 and Beyond):**
287
+
288
+
CrewAI supports Anthropic's Extended Thinking feature, which allows Claude to think through problems in a more human-like way before responding. This is particularly useful for complex reasoning, analysis, and problem-solving tasks.
289
+
290
+
```python Code
291
+
from crewai importLLM
292
+
293
+
# Enable extended thinking with default settings
294
+
llm = LLM(
295
+
model="anthropic/claude-sonnet-4",
296
+
thinking={"type": "enabled"},
297
+
max_tokens=10000
298
+
)
299
+
300
+
# Configure thinking with budget control
301
+
llm = LLM(
302
+
model="anthropic/claude-sonnet-4",
303
+
thinking={
304
+
"type": "enabled",
305
+
"budget_tokens": 5000# Limit thinking tokens
306
+
},
307
+
max_tokens=10000
308
+
)
309
+
```
310
+
311
+
**Thinking Configuration Options:**
312
+
- `type`: Set to `"enabled"` to activate extended thinking mode
313
+
- `budget_tokens` (optional): Maximum tokens to use for thinking (helps control costs)
0 commit comments