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
{{ message }}
Repository navigation
Python: OpenAI SDK rejects allow_multiple_tool_calls when used in ChatAgent (possible argument name mismatch with OpenAI) #2852
allow_multiple_tool_calls is a documented option for OpenAIChatClient create_agent(). It appears this is passed verbatim to the openai completions create method, that method does not support allow_mutiple_tool_calls as an option.
Note: it does have parallel_tool_calls as an option.
openai 2.11.0 (latest)
File "/Users/justin/src/s_test/.venv/lib/python3.13/site-packages/agent_framework/openai/_chat_client.py", line 76, in _inner_get_response
await client.chat.completions.create(stream=False, **options_dict), chat_options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/justin/src/s_test/.venv/lib/python3.13/site-packages/openai/_utils/_utils.py", line 286, in wrapper
return func(*args, **kwargs)
TypeError: AsyncCompletions.create() got an unexpected keyword argument 'allow_multiple_tool_calls'
example code:
"""Minimal Microsoft Agent Framework example with allow_multiple_tool_calls=True.Run to reproduce the OpenAI SDK kwarg error when the installed SDK lacks supportfor `allow_multiple_tool_calls`.Usage: OPENAI_API_KEY=... python scripts/demo_allow_multiple_tool_calls.py"""from __future__ importannotationsimportasyncioimportosfromagent_frameworkimportChatAgent, ai_functionfromagent_framework.openaiimportOpenAIChatClient@ai_function(name="echo_tool", description="Echo the provided text.")defecho_tool(text: str) ->str:
returntextasyncdef_run() ->None:
api_key=os.getenv("OPENAI_API_KEY")
ifnotapi_key:
raiseOSError("Set OPENAI_API_KEY before running this demo.")
chat_client=OpenAIChatClient(
model_id=os.getenv("OPENAI_MODEL_ID", "gpt-4o-mini"),
api_key=api_key,
)
agent=ChatAgent(
chat_client=chat_client,
instructions="Return a short reply; you may call tools.",
tools=[echo_tool],
allow_multiple_tool_calls=True,
)
thread=agent.get_new_thread()
# This call raises if the OpenAI SDK rejects allow_multiple_tool_calls.result=awaitagent.run(messages="Say hi using a tool call.", thread=thread)
print(result.response_text)
if__name__=="__main__":
asyncio.run(_run())
changed the title [-]OpenAI SDK rejects allow_multiple_tool_calls when used in ChatAgent (possible argument name mismatch with OpenAI)[/-][+]Python: OpenAI SDK rejects allow_multiple_tool_calls when used in ChatAgent (possible argument name mismatch with OpenAI)[/+]on Dec 13, 2025
Activity
[-]OpenAI SDK rejects allow_multiple_tool_calls when used in ChatAgent (possible argument name mismatch with OpenAI)[/-][+]Python: OpenAI SDK rejects allow_multiple_tool_calls when used in ChatAgent (possible argument name mismatch with OpenAI)[/+]TaoChenOSU commentedon Dec 16, 2025
Related #2885 and fixed in #2844