Merge pull request #949 from trheyi/main

fix: Comment out Assistant metadata in error handling within Assistan…
This commit is contained in:
Max 2025-05-09 15:26:15 +08:00 committed by GitHub
commit c084e68427
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -95,7 +95,7 @@ func (ast *Assistant) execute(c *gin.Context, ctx chatctx.Context, userInput int
res, err := ast.HookCreate(c, ctx, input, options, contents)
if err != nil {
chatMessage.New().
Assistant(ast.ID, ast.Name, ast.Avatar).
// Assistant(ast.ID, ast.Name, ast.Avatar).
Error(err).
Done().
Write(c.Writer)
@ -115,7 +115,7 @@ func (ast *Assistant) execute(c *gin.Context, ctx chatctx.Context, userInput int
// Has result return directly
if res != nil && res.Result != nil {
output := chatMessage.New().
Assistant(ast.ID, ast.Name, ast.Avatar).
// Assistant(ast.ID, ast.Name, ast.Avatar).
SetResult(res.Result).
Done()
@ -133,7 +133,7 @@ func (ast *Assistant) execute(c *gin.Context, ctx chatctx.Context, userInput int
newAst, err := Get(res.AssistantID)
if err != nil {
chatMessage.New().
Assistant(ast.ID, ast.Name, ast.Avatar).
// Assistant(ast.ID, ast.Name, ast.Avatar).
Error(err).
Done().
Write(c.Writer)
@ -597,11 +597,10 @@ func (ast *Assistant) streamChat(
output.Callback(cb).Write(c.Writer)
return 0 // break
}
// Send the result to the client
output.Write(c.Writer)
return 0 // break
}
// Send the result to the client
output.Write(c.Writer)
return 0 // break
}