Files
agent-framework/python/packages
T
Evan Mattson ff124c44a9 Python: Fix single-tool input handling in OpenAIResponsesClient._prepare_tools_for_openai (#4312)
* Fix OpenAIResponsesClient mishandling single-tool inputs (#4304)

Use normalize_tools() in _prepare_tools_for_openai to wrap single tools
(FunctionTool or dict) in a list before iteration, consistent with the
chat client implementation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR review feedback for #4304

- Use precise type annotation matching normalize_tools/OpenAIChatClient signature
  instead of collapsed Sequence[Any] | Any | None
- Move emptiness guard after normalize_tools() call so single falsy tool
  objects are not silently swallowed
- Import ToolTypes for the type annotation
- Expand test_prepare_tools_for_openai_single_function_tool assertions to
  verify parameters, strict, and parameter schema fields
- Add test_prepare_tools_for_openai_none to verify None input returns []

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ff124c44a9 ยท 2026-02-26 22:09:28 +00:00
History
..