Repository navigation
Python: Fixed sending "text" parameter to OpenAI Responses API - #13280
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where the text parameter was not being included in requests to the OpenAI Responses API. The fix ensures that when a text parameter is explicitly provided, it is correctly added to the options dictionary sent to the API.
- Added conditional logic to include the
textparameter in API requests only when it is explicitly set - Prevents sending
Noneor default empty dict values to the API
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…ctions.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
|
ふぁー (@ymuichiro) are there any unit tests we need to add or update? |
|
I don’t think any test changes are needed this time 😃 Adding unit tests for this case would be excessive — the logic is simply to pass the text parameter to the subsequent process if it exists, and skip it if it doesn’t. It’s possible to implement a focused test to check whether text is passed correctly, but that would require using several surrounding functions and essentially become more like an integration test. |
Summary
Fixed an issue where the
textparameter was missing in requests to the OpenAI Responses API.Changes Made
Modified the
ResponsesAgentThreadActions._generate_options()method to correctly handle thetextparameter:textis notNone.textparameters are sent to the API.Fix Location
File:
semantic_kernel/agents/open_ai/responses_agent_thread_actions.pyBefore:
After:
Contribution Checklist