fix(sse): do not omit empty finish_reason (#1745)

Fixes https://github.com/mudler/LocalAI/issues/1744
This commit is contained in:
Ettore Di Giacinto 2024-02-24 11:51:59 +01:00 committed by GitHub
parent 0135e1e3b9
commit aa098e4d0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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"`