diff --git a/pkg/openai/chat.go b/pkg/openai/chat.go index 20aaabd..8985ba2 100644 --- a/pkg/openai/chat.go +++ b/pkg/openai/chat.go @@ -273,6 +273,12 @@ func ChatProxy(c *gin.Context, chatReq *ChatCompletionRequest) { return } defer resp.Body.Close() + c.Writer.WriteHeader(resp.StatusCode) + for key, value := range resp.Header { + for _, v := range value { + c.Writer.Header().Add(key, v) + } + } teeReader := io.TeeReader(resp.Body, c.Writer) var result string