Merge pull request #947 from trheyi/main
fix: Improve result handling in Assistant API streamChat method
This commit is contained in:
commit
6599a24ffb
1 changed files with 8 additions and 2 deletions
|
|
@ -591,11 +591,17 @@ func (ast *Assistant) streamChat(
|
||||||
}
|
}
|
||||||
|
|
||||||
// has result
|
// has result
|
||||||
if res != nil && res.Result != nil && cb != nil {
|
if res != nil && res.Result != nil {
|
||||||
output.SetResult(res.Result)
|
output.SetResult(res.Result)
|
||||||
|
if cb != nil {
|
||||||
|
output.Callback(cb).Write(c.Writer)
|
||||||
|
return 0 // break
|
||||||
|
}
|
||||||
|
// Send the result to the client
|
||||||
|
output.Write(c.Writer)
|
||||||
|
return 0 // break
|
||||||
}
|
}
|
||||||
|
|
||||||
output.Callback(cb).Write(c.Writer)
|
|
||||||
return 0 // break
|
return 0 // break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue