fix: calculate usage if not given in non-stream mode (#352)

This commit is contained in:
glzjin
2023-08-06 17:40:31 +08:00
committed by GitHub
parent 1dfa190e79
commit 446337c329
3 changed files with 17 additions and 4 deletions

View File

@@ -81,8 +81,9 @@ type OpenAIErrorWithStatusCode struct {
}
type TextResponse struct {
Usage `json:"usage"`
Error OpenAIError `json:"error"`
Choices []OpenAITextResponseChoice `json:"choices"`
Usage `json:"usage"`
Error OpenAIError `json:"error"`
}
type OpenAITextResponseChoice struct {