fix: fix finish_reason fileld not fully compatible with OpenAI (close #372, #373)

* optimize:unify finish_reason field

* refactor: use a global stop finish reason

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
This commit is contained in:
igophper
2023-08-12 11:04:53 +08:00
committed by GitHub
parent c58f710227
commit 476a46ad7e
8 changed files with 19 additions and 7 deletions

View File

@@ -124,7 +124,7 @@ type ChatCompletionsStreamResponseChoice struct {
Delta struct {
Content string `json:"content"`
} `json:"delta"`
FinishReason string `json:"finish_reason,omitempty"`
FinishReason *string `json:"finish_reason"`
}
type ChatCompletionsStreamResponse struct {