mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-10 15:57:04 +00:00
fix error on accumulating final chat response
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user