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 {
|
for resp := range ch {
|
||||||
switch r := resp.(type) {
|
switch r := resp.(type) {
|
||||||
case api.ChatResponse:
|
case api.ChatResponse:
|
||||||
|
if r.Message != nil {
|
||||||
sb.WriteString(r.Message.Content)
|
sb.WriteString(r.Message.Content)
|
||||||
|
}
|
||||||
|
|
||||||
final = r
|
final = r
|
||||||
case gin.H:
|
case gin.H:
|
||||||
if errorMsg, ok := r["error"].(string); ok {
|
if errorMsg, ok := r["error"].(string); ok {
|
||||||
|
|
Loading…
Add table
Reference in a new issue