From 627328b2790eb529b44bc4a5d6e7ab69fbf1faf9 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 13 Jan 2025 18:13:40 +0800 Subject: [PATCH] Refactor streamChat method in Neo API assistant to improve message completion handling - Commented out the message writing logic in the streamChat method to prevent unintended output when the message is marked as done. - This change enhances the control over the response flow, allowing for better integration with the newly introduced hook methods for managing assistant interactions. These modifications contribute to the overall robustness and maintainability of the Neo API, aligning with recent enhancements in assistant functionalities. --- neo/assistant/api.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neo/assistant/api.go b/neo/assistant/api.go index ae09c751..eda682bd 100644 --- a/neo/assistant/api.go +++ b/neo/assistant/api.go @@ -175,9 +175,9 @@ func (ast *Assistant) streamChat(c *gin.Context, ctx chatctx.Context, messages [ // Complete the stream if msg.IsDone { - if value == "" { - msg.Write(c.Writer) - } + // if value == "" { + // msg.Write(c.Writer) + // } // Call HookDone res, hookErr := ast.HookDone(c, ctx, messages, string(*content))