Commit 24dda1f6 by creamlike1024

Merge branch 'main' of github.com:xqx121/new-api into xqx121-main

parents b33b3c4f 2541defb
...@@ -65,6 +65,9 @@ func GeminiTextGenerationHandler(c *gin.Context, resp *http.Response, info *rela ...@@ -65,6 +65,9 @@ func GeminiTextGenerationHandler(c *gin.Context, resp *http.Response, info *rela
} }
} }
// 计算最终使用量
usage.CompletionTokens = usage.TotalTokens - usage.PromptTokens
// 直接返回 Gemini 原生格式的 JSON 响应 // 直接返回 Gemini 原生格式的 JSON 响应
jsonResponse, err := json.Marshal(geminiResponse) jsonResponse, err := json.Marshal(geminiResponse)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment