Add Detailed Streaming to the Tool Agent #4155
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a new feature to the Tool Agent that enables detailed streaming of intermediate steps during agent execution. This provides more visibility into the agent's reasoning process, tool usage, and decision-making.
Changes
How to Use
Enable the "Detailed Streaming" option in the Tool Agent's additional parameters
The agent will now stream detailed execution information with the event type agent_trace
Each event includes a step field indicating the type of operation (e.g., "tool_start", "llm_end")
Client applications can listen for these events to provide a more detailed UI experience
Benefits
Enhanced user experience by showing intermediate steps
Ability to improve the UI to show the steps of execution and reasoning
Testing
Tested with various tool combinations to ensure proper event streaming
Verified that the feature can be toggled on/off without affecting normal operation
Confirmed that the detailed streaming works with all supported LLM providers
This enhancement provides developers with deeper insights into agent execution while maintaining backward compatibility with existing implementations.