-
Notifications
You must be signed in to change notification settings - Fork 574
Python: Fix OpenAI Responses API TextReasoningContent
handling
#1330
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
base: main
Are you sure you want to change the base?
Python: Fix OpenAI Responses API TextReasoningContent
handling
#1330
Conversation
TextReasoningContent
handlingTextReasoningContent
handling
Python Test Coverage Report •
Python Unit Test Overview
|
Thanks @KanchiShimono this works great! |
@mattgotteiner It seems that the Windows test workflow is failing due to a timeout while installing |
@KanchiShimono Thanks for your contribution! In this PR: #1509, I skipped I already pulled latest changes from main in this PR, so please check the latest changes and see if |
@dmytrostruk Thank you for your reply. The Input schema violation (400 error) no longer occurs. It seems that when the model's final response is a Function Call, we should send
In the gpt-oss Responses API server implementation, the It might be good to support passing |
Motivation and Context
This PR fixes issues when
TextReasoningContent
inChatMessage
is converted to OpenAI Responses APIinput
format.Two distinct problems:
Input schema violation (400 error)
_openai_content_parser
convertsTextReasoningContent
incorrectly for Responses APIinput
summary
must be array format, not objectTextReasoningContent
must be placed at message level, not insidecontent
arrayReproduction code and error
Duplicate streaming content
_create_streaming_response_content
handles bothresponse.reasoning_summary_text.delta
and.done
events.done
contains complete text already streamed via.delta
, causing duplicationDescription
Fixes:
_openai_content_parser
:summary
from object to array formatTextReasoningContent
at correct hierarchy_create_streaming_response_content
:case
statement withpass
to intentionally ignore.done
eventTests:
summary
schema.done
event is intentionally ignored (prevents regression)Contribution Checklist