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:
parent
98ae0bf88d
commit
dc3dc464b1
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue