You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
fromagentsimportAgent, ModelSettings, Tool# Define two trivial tools@function_tool("greet")defgreet_tool(name: str) ->str:
returnf"Hello, {name}!"@function_tool("farewell")deffarewell_tool(name: str) ->str:
returnf"Goodbye, {name}!"# Build an agent with both tools, never touching parallel_tool_callsagent=Agent(
name="demo-agent",
instructions="You are a helpful assistant.",
tools=[greet_tool, farewell_tool],
)
asyncdefmain():
# Set up the runner to use the agentresult=awaitRunner.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())
Withoutthatoverride, bothgreet_toolandfarewell_toolfireinparallel—reproducingthedefault‐Truebehavioryouobserved. ThiscanbeobservedonOpenAI' tracing### Suggested fixesEnforcethedocumenteddefaultModifyModelSettings (oritsresolver) toexplicitlysendparallel_tool_calls=FalsewhenthefieldisNone.
OrupdatethedocsClarifythattheunderlyingopenaiclientnowdefaultstoTrue, andrequireuserstoexplicitlysetFalseiftheywantsequentialtoolcalls.
### Environmentopenai-agents-pythonversion: 0.0.15openaiPythonclientversion: ≥1.32.0Pythonversion: e.g. 3.10
The text was updated successfully, but these errors were encountered:
What happened
The Agents SDK documentation for
ModelSettings.parallel_tool_calls
states:However, in practice the underlying
openai
Python client (v1.32+) treatsparallel_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 setparallel_tool_calls=False
on yourModelSettings
.Steps to reproduce
The text was updated successfully, but these errors were encountered: