fix error on accumulating final chat response
This commit is contained in:
parent
32064a0646
commit
045b855db9
1 changed files with 4 additions and 1 deletions
|
@ -1025,7 +1025,10 @@ func ChatHandler(c *gin.Context) {
|
|||
for resp := range ch {
|
||||
switch r := resp.(type) {
|
||||
case api.ChatResponse:
|
||||
sb.WriteString(r.Message.Content)
|
||||
if r.Message != nil {
|
||||
sb.WriteString(r.Message.Content)
|
||||
}
|
||||
|
||||
final = r
|
||||
case gin.H:
|
||||
if errorMsg, ok := r["error"].(string); ok {
|
||||
|
|
Loading…
Add table
Reference in a new issue