diff --git a/api/openai.go b/api/openai.go index e2cd493d..7ea09ac4 100644 --- a/api/openai.go +++ b/api/openai.go @@ -346,13 +346,11 @@ func chatEndpoint(cm *ConfigMerger, debug bool, loader *model.ModelLoader, threa enc := json.NewEncoder(&buf) enc.Encode(ev) - fmt.Fprintf(w, "event: data\n\n") fmt.Fprintf(w, "data: %v\n\n", buf.String()) log.Debug().Msgf("Sending chunk: %s", buf.String()) w.Flush() } - w.WriteString("event: data\n\n") resp := &OpenAIResponse{ Model: input.Model, // we have to return what the user sent here, due to OpenAI spec. Choices: []Choice{{FinishReason: "stop"}},