Open
Description
What happened
The Agents SDK documentation for ModelSettings.parallel_tool_calls
states:
“Whether to use parallel tool calls when calling the model.
Defaults to False if not provided.”
However, in practice the underlying openai
Python client (v1.32+) treats parallel_tool_calls=True
by default whenever the field is omitted, and the SDK does not override this. As a result, tools are always invoked in parallel unless you explicitly set parallel_tool_calls=False
on your ModelSettings
.
Steps to reproduce
from agents import Agent, ModelSettings, Tool
# Define two trivial tools
@function_tool("greet")
def greet_tool(name: str) -> str:
return f"Hello, {name}!"
@function_tool("farewell")
def farewell_tool(name: str) -> str:
return f"Goodbye, {name}!"
# Build an agent with both tools, never touching parallel_tool_calls
agent = Agent(
name="demo-agent",
instructions="You are a helpful assistant.",
tools=[greet_tool, farewell_tool],
)
async def main():
# Set up the runner to use the agent
result = await Runner.run(
agent,
input="Hello it was nice to meet you. Goodbye",
run_config=run_config,
)
print(result.final_output)
if __name__ == "__main__":
asyncio.run(main())
Without that override, both greet_tool and farewell_tool fire in parallel—reproducing the default‐True behavior you observed. This can be observed on OpenAI' tracing
### Suggested fixes
Enforce the documented default
Modify ModelSettings (or its resolver) to explicitly send parallel_tool_calls=False when the field is None.
Or update the docs
Clarify that the underlying openai client now defaults to True, and require users to explicitly set False if they want sequential tool calls.
### Environment
openai-agents-python version: 0.0.15
openai Python client version: ≥1.32.0
Python version: e.g. 3.10