feat: Add stop session functionality to chat API and UI
- Implemented a new API endpoint to stop ongoing chat sessions, allowing users to cancel message generation. - Enhanced InputField component to include a stop button, enabling users to halt the assistant's response generation. - Updated chat view to manage the assistant message ID and loading state effectively during stop events. - Improved event handling in the backend to support stop events, ensuring proper session management and user feedback.
This commit is contained in:
@@ -72,6 +72,10 @@ type StreamResponse struct {
|
||||
Done bool `json:"done"`
|
||||
// Knowledge references
|
||||
KnowledgeReferences References `json:"knowledge_references,omitempty"`
|
||||
// Session ID (for agent_query event)
|
||||
SessionID string `json:"session_id,omitempty"`
|
||||
// Assistant Message ID (for agent_query event)
|
||||
AssistantMessageID string `json:"assistant_message_id,omitempty"`
|
||||
// Tool calls for streaming (partial)
|
||||
ToolCalls []LLMToolCall `json:"tool_calls,omitempty"`
|
||||
// Additional metadata for enhanced display
|
||||
|
||||
Reference in New Issue
Block a user