Only apply reasoning_effort for o-series OpenAI models
reasoning_effort is only supported by o-series models (o1, o3, o3-mini, o4-mini). Passing it to gpt-* models causes a 400 error because those models don't support it on the chat completions endpoint. Now we check if the model name starts with 'o' before including the parameter. Fixes #403
This commit is contained in:
parent
f362a160c3
commit
a1ee0bd824
|
|
@ -146,7 +146,11 @@ class TradingAgentsGraph:
|
||||||
elif provider == "openai":
|
elif provider == "openai":
|
||||||
reasoning_effort = self.config.get("openai_reasoning_effort")
|
reasoning_effort = self.config.get("openai_reasoning_effort")
|
||||||
if reasoning_effort:
|
if reasoning_effort:
|
||||||
kwargs["reasoning_effort"] = reasoning_effort
|
# reasoning_effort is only supported by o-series models
|
||||||
|
# (o1, o3, o3-mini, o4-mini, etc.), not by gpt-* models
|
||||||
|
model = self.config.get("deep_think_llm", "")
|
||||||
|
if model.startswith("o"):
|
||||||
|
kwargs["reasoning_effort"] = reasoning_effort
|
||||||
|
|
||||||
return kwargs
|
return kwargs
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue