-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Python: Fixed sending "text" parameter to OpenAI Responses API #13280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: Fixed sending "text" parameter to OpenAI Responses API #13280
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py
Outdated
Show resolved
Hide resolved
…ctions.py Co-authored-by: Copilot <[email protected]>
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