Add thinking mode support for anthropic client#7002
Conversation
|
@microsoft-github-policy-service agree |
|
Hi @ekzhu, |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7002 +/- ##
==========================================
- Coverage 80.99% 80.93% -0.07%
==========================================
Files 237 237
Lines 18198 18240 +42
==========================================
+ Hits 14739 14762 +23
- Misses 3459 3478 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
⏺ Summary of Changes
Problem Solved
AutoGen’s Anthropic client did not support thinking mode—Claude’s ability to show its reasoning process before providing a final answer.
Without this, users could not access the internal thought process that makes Claude’s responses more accurate and transparent.
Changes Made
Core Implementation (
_anthropic_client.py)_get_thinking_config()method to handlethinkingparameter validation.thinkingparameter in API calls._last_used_toolsinitialization.Configuration Support (
config/init.py)ThinkingConfigTypedDictandThinkingConfigModelfor type safety.Test Coverage (
test_anthropic_model_client.py)Key Design Decisions
budget_tokens, model support, temperature requirements).temperature=1.0themselves — no automatic overrides.extra_create_argspattern.⏺ Usage Example
⏺ Result
AutoGen users can now access Claude’s reasoning process, leading to more transparent and explainable AI interactions, while maintaining clean, maintainable code that follows AutoGen’s architectural principles.
⏺ Related Issue
Closes #6095
⏺ Checks