-
-
Notifications
You must be signed in to change notification settings - Fork 22.3k
Feature - Enable Streaming Capabilities For Tool Calls That Send Real-Time Notificaitons #4972
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
Open
Amrrx
wants to merge
16
commits into
FlowiseAI:main
Choose a base branch
from
Amrrx:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,472
−236
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ment and SSE integration
… sseStreamer extraction
- Added history service to manage snapshots of chatflows and assistants. - Integrated history snapshot creation on chatflow save and update operations. - Created API endpoints for fetching, restoring, and deleting history snapshots. - Developed UI components for displaying and managing version history in the assistant and chatflow configurations. - Added HistoryButton and HistoryDialog components for user interaction with version history. - Implemented flow reload functionality to update the canvas with restored chatflow data.
…dling - Add UTC timestamp (ISO format) to both streaming and non-streaming prediction API responses - Improve error handling in LLMEvaluationRunner with detailed logging and proper error messages - Enhance schema conversion error handling with detailed error context - Add retriever implementation analysis documentation for future BM25/EnsembleRetriever development
Create user feature instead of just invite by email
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
MCP Streaming Support
Adds real-time streaming capabilities to MCP (Model Context Protocol) tool integrations with enhanced connection management and SSE integration.
Changes
Server Capabilities Schema
Server advertises streaming support via capabilities response:
// Server capabilities detection
const capabilities = client.getServerCapabilities()
const hasStreaming =
capabilities?.notifications?.streaming === true ||
capabilities?.experimental?.notifications?.streaming === true
Expected server capabilities format:
{
"capabilities": {
"notifications": {
"streaming": true
}
}
}
Alternative experimental format:
{
"capabilities": {
"experimental": {
"notifications": {
"streaming": true
}
}
}
}
Tool Capabilities Schema
MCP tools declare streaming support via annotations:
// Tool definition with streaming annotation
{
"name": "tool_name",
"description": "Tool description",
"annotations": {
"streaming_enabled": true,
"notification_types": ["task_completion", "progress", "logging"]
},
"inputSchema": {
"type": "object",
"properties": { /* tool parameters */ }
}
}
Tool streaming annotations:
SSE Streaming Events
Tools with streaming support emit events via IServerSideEventStreamer:
interface IServerSideEventStreamer {
// Core streaming methods
streamTokenEvent(chatId: string, data: string): void
streamToolEvent(chatId: string, data: any): void
streamCustomEvent(chatId: string, eventType: string, data: any): void
}
Notification Handling Schema
MCP notifications follow the LoggingMessageNotificationSchema:
// Notification structure
{
"method": "logging/message",
"params": {
"data": "notification message",
"logger": "task_completion" // Used for completion detection
}
}
Configuration
const MCP_STREAMING_CONFIG = {
DEFAULT_COMPLETION_TIMEOUT: 600000, // 10 minutes fallback
NOTIFICATION_DELAY: 1000, // 1 second cleanup delay
SUPPORTED_NOTIFICATION_TYPES: ['logging/message', 'progress'],
STREAMING_MARKER: '[MCP Streaming]' // UI indicator
}
Technical Implementation
Enables real-time user feedback during MCP tool execution while maintaining backward compatibility with existing non-streaming MCP servers.