mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-12 09:03:42 +08:00
support gpt-4-1106-vision-preview
This commit is contained in:
@@ -132,7 +132,7 @@ func openaiHandler(c *gin.Context, resp *http.Response, consumeQuota bool, promp
|
||||
if textResponse.Usage.TotalTokens == 0 {
|
||||
completionTokens := 0
|
||||
for _, choice := range textResponse.Choices {
|
||||
completionTokens += countTokenText(choice.Message.Content, model)
|
||||
completionTokens += countTokenText(string(choice.Message.Content), model)
|
||||
}
|
||||
textResponse.Usage = Usage{
|
||||
PromptTokens: promptTokens,
|
||||
|
||||
Reference in New Issue
Block a user