mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-11 16:26:59 +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 {
|
for resp := range ch {
|
||||||
switch r := resp.(type) {
|
switch r := resp.(type) {
|
||||||
case api.ChatResponse:
|
case api.ChatResponse:
|
||||||
sb.WriteString(r.Message.Content)
|
if r.Message != nil {
|
||||||
|
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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user