feat: update api

This commit is contained in:
sunjuzhong 2025-08-23 20:50:51 +08:00
parent 11a05a93c2
commit 2c0d483fc1
2 changed files with 9 additions and 1 deletions

View file

@ -232,7 +232,14 @@ func (neo *DSL) handleChat(c *gin.Context) {
defer cancel() defer cancel()
defer ctx.Release() // Release the context after the request is done defer ctx.Release() // Release the context after the request is done
neo.Answer(ctx, content, c) err := neo.Answer(ctx, content, c)
// Error handling
if err != nil {
message.New().Done().Error(err).Write(c.Writer)
c.Done()
return
}
} }
// handleChatList handles the chat list request // handleChatList handles the chat list request

View file

@ -146,5 +146,6 @@ func auth(field string, value string, password string, sid string) maps.Map {
"items": items, "items": items,
}, },
"studio": studio, "studio": studio,
"sid": sid,
} }
} }