Update GenerateChatTitle method to include silent mode in chat handling

- Modified the handleChatUpdate function to pass an additional parameter for silent mode when generating chat titles, enhancing the flexibility of chat title generation.
- This change allows for improved handling of chat updates, ensuring that the API can better manage user expectations and interactions.
This commit is contained in:
Max 2024-12-19 16:52:43 +08:00
parent a90d1d5a0a
commit c1e95374f2

View file

@ -452,7 +452,7 @@ func (neo *DSL) handleChatUpdate(c *gin.Context) {
ctx, cancel := NewContextWithCancel(sid, c.Query("chat_id"), "")
defer cancel()
title, err := neo.GenerateChatTitle(ctx, body.Content, c)
title, err := neo.GenerateChatTitle(ctx, body.Content, c, true)
if err != nil {
c.JSON(500, gin.H{"message": err.Error(), "code": 500})
c.Done()