Commit 2541defb by xqx121 Committed by GitHub

Update relay-gemini-native.go

parent 423796e7
......@@ -64,6 +64,9 @@ func GeminiTextGenerationHandler(c *gin.Context, resp *http.Response, info *rela
usage.PromptTokensDetails.TextTokens = detail.TokenCount
}
}
// 计算最终使用量
usage.CompletionTokens = usage.TotalTokens - usage.PromptTokens
// 直接返回 Gemini 原生格式的 JSON 响应
jsonResponse, err := json.Marshal(geminiResponse)
......
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