Skip to content

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.
gold-crow-997 added a commit to gold-crow-997/open-ai-agent that referenced this pull request Sep 11, 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](openai/openai-agents-python#333) for
consistency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants