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:
parent
e440f1ff81
commit
627328b279
1 changed files with 3 additions and 3 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue