From aa098e4d0ba3a05194b5f26ea294933ec0434c5e Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sat, 24 Feb 2024 11:51:59 +0100 Subject: [PATCH] fix(sse): do not omit empty finish_reason (#1745) Fixes https://github.com/mudler/LocalAI/issues/1744 --- core/schema/openai.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/schema/openai.go b/core/schema/openai.go index 23abd7b7..53dd5324 100644 --- a/core/schema/openai.go +++ b/core/schema/openai.go @@ -49,7 +49,7 @@ type OpenAIResponse struct { type Choice struct { Index int `json:"index"` - FinishReason string `json:"finish_reason,omitempty"` + FinishReason string `json:"finish_reason"` Message *Message `json:"message,omitempty"` Delta *Message `json:"delta,omitempty"` Text string `json:"text,omitempty"`