Merge pull request #887 from trheyi/main
Handle empty prompt in chat streaming with error callback
This commit is contained in:
commit
c412e5d896
1 changed files with 1 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue