From 98ae0bf88d0975f1f57c194ec8669290a8d71094 Mon Sep 17 00:00:00 2001 From: Adel Janbeih <153122094+degghvz@users.noreply.github.com> Date: Sun, 22 Mar 2026 13:05:43 +0100 Subject: [PATCH] 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 --- tradingagents/graph/trading_graph.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tradingagents/graph/trading_graph.py b/tradingagents/graph/trading_graph.py index c7ef0f98..cb649f53 100644 --- a/tradingagents/graph/trading_graph.py +++ b/tradingagents/graph/trading_graph.py @@ -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]: