fix: correct indentation and add thinking_config to Anthropic client

Fixed IndentationError in trading_graph.py within the _get_provider_kwargs method.

Optimized logic to fetch the configuration value once instead of twice.

Removed temporary French comments.

Updated anthropic_client.py to include thinking_config in the allowed_keys whitelist so the parameters are properly passed to the LLM.
This commit is contained in:
Adel Janbeih 2026-03-22 13:43:38 +01:00 committed by GitHub
parent 98ae0bf88d
commit dc3dc464b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 4 deletions

View File

@ -147,11 +147,16 @@ 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
elif provider == "anthropic":
thinking_budget = self.config.get("anthropic_thinking_budget")
if thinking_budget:
kwargs["thinking_config"] = {
"type": "enabled",
"budget_tokens": int(thinking_budget)
}
return kwargs
def _create_tool_nodes(self) -> Dict[str, ToolNode]:
"""Create tool nodes for different data sources using abstract methods."""
return {