Skip to content

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

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

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

Conversation

@asjfoajs
Copy link
Copy Markdown

  • 引入 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
Copy Markdown
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.

@ghost

This comment was marked as spam.

@Calcium-Ion Calcium-Ion deleted the branch QuantumNous:nightly April 1, 2026 16:35
@Calcium-Ion Calcium-Ion closed this Apr 1, 2026
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