Commit 045b855d authored by Jeffrey Morgan's avatar Jeffrey Morgan
Browse files

fix error on accumulating final chat response

parent 32064a06
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment