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:
@@ -180,6 +180,7 @@ func RegisterSessionRoutes(r *gin.RouterGroup, handler *handler.SessionHandler)
|
||||
sessions.PUT("/:id", handler.UpdateSession)
|
||||
sessions.DELETE("/:id", handler.DeleteSession)
|
||||
sessions.POST("/:session_id/generate_title", handler.GenerateTitle)
|
||||
sessions.POST("/:session_id/stop", handler.StopSession)
|
||||
// 继续接收活跃流
|
||||
sessions.GET("/continue-stream/:session_id", handler.ContinueStream)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user