Skip to content

Fix parallel_tool_calls when False #333

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

apeccaud
Copy link
Contributor

Currently, when we set parallel_tool_calls=False in the model_settings, the responses API is called with parallel_tool_calls == NotGiven, which defaults to true on the Response API side (https://platform.openai.com/docs/api-reference/responses/create#responses-create-parallel_tool_calls).

This PR attempts to fix that.

agent = Agent(
    ...,
    model_settings=ModelSettings(
        parallel_tool_calls=False,
    ),
)

@rm-openai
Copy link
Collaborator

Thanks for fixing!

@rm-openai rm-openai merged commit 923a354 into openai:main Mar 25, 2025
5 checks passed
rm-openai pushed a commit that referenced this pull request Apr 15, 2025
The current ChatCompletion API supports only `parallel_tool_calls=True`
or `parallel_tool_calls=NOT_GIVEN`
This PR is to support setting `parallel_tool_calls=False`, a common
requirement in controlling agent tool use patterns (e.g. ensuring one
tool call at the time, to facilitate desired tool calling sequence).

I followed the merged
[PR#333](#333) for
consistency.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants