-
Notifications
You must be signed in to change notification settings - Fork 0
Bill/reasoning streaming bugfix #134
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
Conversation
|
This looks reasonable to me. |
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.
stamped but would not modify the ipynb
Basically the past implementation kept streaming contexts open, and did not send full/done events back after each reasoning stream. |
Thanks, the part I wasn't clear about was whether or not closing the streaming context properly (and correctly sending the done event) actually required using the new event types or if it would have been possible with the existing ones. |
Yep, so regarding the new event types I added two events, ResponseReasoningSummaryPartDoneEvent, and and ResponseReasoningSummaryPartAddedEvent Cause that lets us know when a reasoning chunk is started, and when it ends. That way it lets us correctly send the done event when a reasoning chunk is finished The flow is PartAdded PartAdded the reason we had to use the part added event is because if we just listen for dones, the stream would be considered closed for the consecutive reasoning chunk, and we couldnt keep sending deltas so for each chunk we create a new streaming context and close it |
git push
This pull request includes several improvements and bug fixes related to reasoning summary streaming, message display, and developer tooling for task messages. The most significant changes are in the handling of reasoning summary events in the OpenAI provider, as well as enhancements to the developer message printing utilities.
Reasoning Summary Streaming Improvements:
run_agent_streamed_auto_sendto use new event types (ResponseReasoningSummaryPartAddedEvent,ResponseReasoningSummaryTextDeltaEvent,ResponseReasoningSummaryPartDoneEvent). Now, reasoning summaries are accumulated as a string and the streaming context is properly managed and closed when the summary part is done, resulting in more accurate and robust streaming of reasoning summaries. [1] [2] [3] [4] [5]Developer Tooling and Message Display:
print_task_messagefunction to better handle empty reasoning messages, preventing unnecessary output, and adjusted the logic to avoid errors when content isNone.subscribe_to_async_task_messages, improving terminal output readability. [1] [2]Code Cleanups and Maintenance:
openai.pyto remove unused event classes and include new ones relevant to the revised reasoning summary streaming logic. [1] [2]on_task_event_sendfor cleaner log output.workflow.pyas it is no longer required.