mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 20:57:32 +08:00
fix chunk merge bug in ai-search (#1895)
This commit is contained in:
@@ -572,10 +572,8 @@ func onStreamingResponseBody(ctx wrapper.HttpContext, config Config, chunk []byt
|
|||||||
} else {
|
} else {
|
||||||
ctx.SetContext(PARTIAL_MESSAGE_CONTEXT_KEY, nil)
|
ctx.SetContext(PARTIAL_MESSAGE_CONTEXT_KEY, nil)
|
||||||
}
|
}
|
||||||
if len(newMessages) == 1 {
|
if len(newMessages) > 0 {
|
||||||
return []byte(fmt.Sprintf("%s\n\n", newMessages[0]))
|
return []byte(fmt.Sprintf("%s\n\n", strings.Join(newMessages, "\n\n")))
|
||||||
} else if len(newMessages) > 1 {
|
|
||||||
return []byte(strings.Join(newMessages, "\n\n"))
|
|
||||||
} else {
|
} else {
|
||||||
return []byte("")
|
return []byte("")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user