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.
This commit is contained in:
Max 2025-01-13 18:13:40 +08:00
parent e440f1ff81
commit 627328b279

View file

@ -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))