Skip to content

feat: 支持图片补全倍率计费并新增 Gemini 3 预览模型定价[#3426]#3443

Open
asjfoajs wants to merge 1 commit intoQuantumNous:nightlyfrom
asjfoajs:fix/gemini-image-billing
Open

feat: 支持图片补全倍率计费并新增 Gemini 3 预览模型定价[#3426]#3443
asjfoajs wants to merge 1 commit intoQuantumNous:nightlyfrom
asjfoajs:fix/gemini-image-billing

Conversation

@asjfoajs
Copy link

  • 引入 ImageCompletionRatio 计费项,支持对补全响应中的图片 Token 进行独立加权计费
  • 更新 postConsumeQuota 中的核心计算逻辑,通过以下方式应用图片倍率: // 对补全中的图片 Token 应用独立倍率处理 dCompletionTokens = dCompletionTokens.Sub(dCompletionImageTokens) dCompletionTokens = dCompletionTokens.Add(dCompletionImageTokens.Mul(dImageCompletionRatio)) completionQuota = dCompletionTokens.Mul(dCompletionRatio)

  - 引入 `ImageCompletionRatio` 计费项,支持对补全响应中的图片 Token 进行独立加权计费
  - 更新 `postConsumeQuota` 中的核心计算逻辑,通过以下方式应用图片倍率:
    // 对补全中的图片 Token 应用独立倍率处理
    dCompletionTokens = dCompletionTokens.Sub(dCompletionImageTokens)
    dCompletionTokens = dCompletionTokens.Add(dCompletionImageTokens.Mul(dImageCompletionRatio))
    completionQuota = dCompletionTokens.Mul(dCompletionRatio)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • alpha

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c2b1e537-075d-484a-9d84-c362dabc4bce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@PAIN300BACKS
Copy link

I am looking for a supplier of stable models for neural networks that support:
Text, Image, Video, Audio, 3D

我正在寻找支持神经网络的稳定模型的供应商:
文本,图像,视频,音频,3D

Write: https://t.me/EUN_TR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants