Description
I was confused to understand the default model.
Description
There is a discrepancy between the documentation comment and the actual implementation regarding the default model used by the Agent class when no model is specified.
In src/agents/agent.py
, the comment states:
openai-agents-python/src/agents/agent.py
Lines 107 to 112 in 0396052
However, src/agents/model_settings.py
does not contain a DEFAULT_MODEL
constant.
The actual implementation logic uses DEFAULT_MODEL = "gpt-4o"
defined in src/agents/models/openai_provider.py
, which is used in the get_model
method when model_name
is None
.
openai-agents-python/src/agents/run.py
Lines 933 to 942 in 0396052
openai-agents-python/src/agents/models/openai_provider.py
Lines 81 to 83 in 0396052
Suggested Fix
Update the comment in agent.py
.
model: str | Model | None = None
"""The model implementation to use when invoking the LLM.
By default, if not set, the agent will use the default model configured in
`openai_provider.DEFAULT_MODEL` (currently "gpt-4o").
"""