mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-18 06:03:42 +08:00
🐛 fix: Tokens may not be counted in the stream below
This commit is contained in:
@@ -270,6 +270,9 @@ func (h *minimaxStreamHandler) convertToOpenaiStream(miniResponse *MiniMaxChatRe
|
||||
|
||||
if miniResponse.Usage != nil {
|
||||
h.handleUsage(miniResponse)
|
||||
} else {
|
||||
h.Usage.CompletionTokens += common.CountTokenText(miniChoice.Messages[0].Text, h.Request.Model)
|
||||
h.Usage.TotalTokens = h.Usage.PromptTokens + h.Usage.CompletionTokens
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user