From d96cf2e84d5d54b9d0aab4fc642b093c3ce5c155 Mon Sep 17 00:00:00 2001 From: JustSong Date: Sun, 6 Aug 2023 18:09:00 +0800 Subject: [PATCH] fix: fix stream mode determine related logic (close #360) --- controller/relay-text.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/relay-text.go b/controller/relay-text.go index df4a6a9938..65f03bcf9a 100644 --- a/controller/relay-text.go +++ b/controller/relay-text.go @@ -302,7 +302,7 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode { if err != nil { return errorWrapper(err, "close_request_body_failed", http.StatusInternalServerError) } - isStream = strings.HasPrefix(resp.Header.Get("Content-Type"), "text/event-stream") + isStream = isStream || strings.HasPrefix(resp.Header.Get("Content-Type"), "text/event-stream") } var textResponse TextResponse