-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix and Document parallel_tool_calls
Attribute in ModelSettings
#763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This update perfectly addresses the mismatch—by documenting parallel_tool_calls=True as the real default, it aligns the docs with the code and clears up the confusion. Thanks for fixing this! |
e5c68aa
to
1f0915a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think probably best to say it defaults to whatever the model does (bc that can vary across providers)
You're absolutely right. It could be updated like so. """ If not provided (i.e., set to Set to |
07cefed
to
1f0915a
Compare
72d6177
to
4ca3cc0
Compare
4ca3cc0
to
077c17b
Compare
This PR is stale because it has been open for 10 days with no activity. |
This PR was closed because it has been inactive for 7 days since being marked as stale. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me; @rm-openai do you see anything to adjust?
Closes #762
Description
This PR updates the docstring for the
parallel_tool_calls
attribute in theModelSettings
dataclass to accurately reflect its default behavior.. The previous docstring incorrectly stated that the default ofFalse
, while the actual behavior is dependent on the underlying model provider's default.As noted in OpenAI's (here refers as model provider) Function Calling documentation, "The model may choose to call multiple functions in a single turn. You can prevent this by setting parallel_tool_calls to false, which ensures exactly zero or one tool is called."
Therefore, when the
parallel_tool_calls
attribute in theModelSettings
dataclass is set toNone
(i.e.,parallel_tool_calls: bool | None = None
), and this value is passed directly to the API without modification, it defers to the model provider's default behavior for parallel tool calls. This is typicallyTrue
for most current providers, but it's important to acknowledge that this isn't a fixed default within our codebase.The new docstring is formatted for automatic documentation generation and provides clear, accurate information for users and developers.
Key changes:
parallel_tool_calls
: Instead of stating a fixed default, the docstring now accurately reflects that the behavior defaults to whatever the model provider does when the attribute isNone
.parallel_tool_calls
attribute.Testing:
parallel_tool_calls=False
in both therun_config
of theRunner.run
method and in the agent’smodel_settings
attribute.Runner.run
:parallel_tool_calls=False
, tools are called sequentially.Why this is important:
parallel_tool_calls
.