Skip to content
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

Add Detailed Streaming to the Tool Agent #4155

Merged
merged 4 commits into from
Apr 2, 2025

Conversation

jonSuits
Copy link
Contributor

@jonSuits jonSuits commented Mar 10, 2025

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

  • Added a new "Enable Detailed Streaming" option in the Tool Agent's additional parameters
  • Integrated a new CustomStreamingHandler to stream detailed execution traces
  • Configured the handler to use a consistent agent_trace event type with step information
  • Added support for streaming various event types:
  1. LLM operations (start/end)
  2. Tool invocations (start/end/error)
  3. Chain operations (start/end)
  4. Agent actions
  5. Agent thinking/reasoning

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.

@HenryHengZJ
Copy link
Contributor

@jonSuits can you grant me permission to make changes?

@jonSuits
Copy link
Contributor Author

@HenryHengZJ Granted, Thanks

@HenryHengZJ
Copy link
Contributor

ah okay, it works now

@jonSuits
Copy link
Contributor Author

jonSuits commented Apr 1, 2025

Hey @HenryHengZJ
Any feedback or blocker on this?

@HenryHengZJ
Copy link
Contributor

should be good to merge, thanks @jonSuits !

@HenryHengZJ HenryHengZJ merged commit 9957184 into FlowiseAI:main Apr 2, 2025
2 checks passed
JJK801 pushed a commit to JJK801/Flowise that referenced this pull request Apr 9, 2025
* Add Detailed Streaming to the Tool Agent

* lint fix

---------

Co-authored-by: Henry <[email protected]>
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.

2 participants