mirror of
https://github.com/ollama/ollama.git
synced 2025-03-26 17:51:48 +01:00
fix error on accumulating final chat response
This commit is contained in:
parent
32064a0646
commit
045b855db9
@ -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…
x
Reference in New Issue
Block a user