fix(graph): add missing Anthropic thinking_config

Update _get_provider_kwargs() in trading_graph.py to support extended reasoning for Claude models.

Dynamically injects the thinking_config dictionary when the provider is 'anthropic' and a budget is set.

Keeps the implementation consistent with existing OpenAI and Google logic.

Addresses the missing parameter issue mentioned in llm_clients/TODO.md
This commit is contained in:
Adel Janbeih 2026-03-22 13:05:43 +01:00 committed by GitHub
parent f362a160c3
commit 98ae0bf88d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -147,7 +147,9 @@ class TradingAgentsGraph:
reasoning_effort = self.config.get("openai_reasoning_effort")
if reasoning_effort:
kwargs["reasoning_effort"] = reasoning_effort
# Ton nouveau code pour Anthropic
elif self.provider == "anthropic" and self.config.get("anthropic_thinking_budget"):
kwargs["thinking_config"] = {"type": "enabled", "budget_tokens": int(self.config["anthropic_thinking_budget"])}
return kwargs
def _create_tool_nodes(self) -> Dict[str, ToolNode]: