Handle empty prompt in chat streaming with error callback
- Add error handling for empty prompts in streamChat method - Ensure proper error message generation and callback invocation - Improve error propagation in chat streaming scenarios
This commit is contained in:
parent
c74d32390c
commit
48d65c0e39
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