Skip to content

Conversation

@felixs8696
Copy link
Contributor

No description provided.

@felixs8696 felixs8696 marked this pull request as draft August 15, 2025 17:36
@IdkwhatImD0ing
Copy link
Contributor

Why is this pr so much harder than expected 😭

@IdkwhatImD0ing
Copy link
Contributor

There's still a bunch of things I should probably revert but I'll do those tomorrow as my brain is fried

@IdkwhatImD0ing IdkwhatImD0ing changed the title trying to support intermediate streaming - incomplete Intermediate Streaming Reasoning Aug 19, 2025
@IdkwhatImD0ing
Copy link
Contributor

This pull request refactors the handling and streaming of task message updates across multiple modules, with a particular focus on improving support for reasoning content and summary streaming in the OpenAI provider. It standardizes imports for task message update types, adds explicit type fields to streaming messages, and introduces robust streaming support for reasoning summaries and content. These changes enhance the flexibility and clarity of message streaming, especially for agentic workflows.

Refactoring and Standardization of Imports:

  • Replaced all imports of TaskMessageUpdate, StreamTaskMessageDelta, StreamTaskMessageFull, and related types from agentex.lib.types.task_message_updates with imports from the new locations: agentex.types.task_message_update and agentex.types.task_message_delta across multiple files (acp.py, messages.py, litellm.py, openai.py). This improves code organization and clarity. [1] [2] [3] [4] [5] [6] [7] [8]

Streaming Reasoning Content and Summaries:

  • Added support for streaming reasoning summary and content deltas in openai.py, including handling new event types (ResponseReasoningSummaryTextDeltaEvent, ResponseReasoningSummaryTextDoneEvent, ResponseReasoningTextDeltaEvent, ResponseReasoningTextDoneEvent) and streaming them using ReasoningSummaryDelta and ReasoningContentDelta. This enables incremental updates for reasoning items in agent responses. [1] [2]

Explicit Message Type Fields:

  • Updated all instances where StreamTaskMessageFull and StreamTaskMessageDelta are created to include explicit type fields (e.g., "full", "delta", "text", "reasoning_summary", "reasoning_content"), improving downstream message handling and clarity. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Agentic Workflow and Model Configuration Updates:

  • Changed default model from "o4-mini" to "gpt-5-mini" and updated reasoning summary configuration from "auto" to "detailed" in agentic workflow example, reflecting improved model capabilities and more thorough reasoning output.

Streaming Context Initialization Improvements:

  • Refactored how streaming contexts are initialized for both message and reasoning items in openai.py, ensuring that contexts are opened with empty content and correctly tracked for incremental updates and completion.

Let me know if you want to dive deeper into any specific change or need help understanding how these updates affect message streaming and agentic workflows!

@IdkwhatImD0ing IdkwhatImD0ing marked this pull request as ready for review August 19, 2025 17:36
@felixs8696
Copy link
Contributor Author

@charlotte-zhuang @MichaelSun48 what do we need to do in the agentex ui kit to support these reasoning components?

@MichaelSun48
Copy link
Collaborator

MichaelSun48 commented Aug 19, 2025

what do we need to do in the agentex ui kit to support these reasoning components?

@felixs8696 we'll need to add another branch here that handles any reasoning text that gets streamed in. Should be relatively straight forward

@IdkwhatImD0ing
Copy link
Contributor

IdkwhatImD0ing commented Aug 20, 2025

Demo:

Screen.Recording.2025-08-20.at.3.54.29.PM.mov

(Ignore the formatting of the response component, it was a quick hack and not merged into agentex web, merely added to demo the streaming capabilities. look at dev.ipynb for a better example)

This pull request updates import paths for several tutorial files to reflect a recent reorganization of the agentex package, and also modifies the dev.ipynb notebook for the agentic temporal agent chat tutorial to include sample outputs and adjust example parameters. The most important changes are grouped below:

Import Path Refactoring:

  • Updated imports in acp.py files across multiple tutorials (00_sync/000_hello_acp, 00_sync/010_multiturn, 00_sync/020_streaming, 10_agentic/00_base/040_other_sdks) to use the new agentex.types.task_message_update and agentex.types.task_message_delta modules, replacing the previous agentex.lib.types.task_message_updates import. [1] [2] [3] [4]

Notebook Enhancements and Example Updates:

  • Set execution counts and added output cells to dev.ipynb in 10_agentic/10_temporal/010_agent_chat, providing sample outputs for task creation and event sending to improve clarity for users running the notebook. [1] [2] [3]
  • Updated the AGENT_NAME variable and modified the event content to include more detailed instructions in the agent chat notebook, making the example more relevant and instructive. [1] [2]

Copy link
Contributor

@IdkwhatImD0ing IdkwhatImD0ing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replied to comment

Copy link
Contributor

@IdkwhatImD0ing IdkwhatImD0ing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had felix review it, said it looks good

@IdkwhatImD0ing IdkwhatImD0ing merged commit 5c91935 into main Aug 20, 2025
7 of 8 checks passed
@IdkwhatImD0ing IdkwhatImD0ing deleted the fs/reasoning branch August 20, 2025 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants