Merge pull request #887 from trheyi/main

Handle empty prompt in chat streaming with error callback
This commit is contained in:
Max 2025-03-03 15:27:14 +08:00 committed by GitHub
commit c412e5d896
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -631,6 +631,7 @@ func (ast *Assistant) streamChat(
// if the prompt is empty, return the error
if prompt == "" {
chatMessage.New().Error(retry.Error()).Done().Callback(cb).Write(c.Writer)
return nil, retry
}