Skip to content

fix: use default model price for radio price model - #3088

Closed
feitianbubu wants to merge 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/0c59b90e9ee766fe20765a8d828586dfe825a43b
Closed

fix: use default model price for radio price model#3088
feitianbubu wants to merge 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/0c59b90e9ee766fe20765a8d828586dfe825a43b

Conversation

@feitianbubu

@feitianbubu feitianbubu commented Mar 3, 2026

Copy link
Copy Markdown
Member

没有配置费用,也要使用默认费用,否则按费率计费的视频模型无法使用
比如豆包视频和可灵视频
image

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of missing model pricing configurations. The system now gracefully falls back to a calculated default price instead of returning an error, ensuring continued operation when per-call pricing is not explicitly configured.

@coderabbitai

coderabbitai Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e71f5a4 and 4d9f92d.

📒 Files selected for processing (1)
  • relay/helper/price.go

Walkthrough

The ModelPriceHelperPerCall function in relay/helper/price.go was modified to compute a fallback default price using PreConsumedQuota / QuotaPerUnit when model price is not configured, instead of returning an error immediately. Subsequent validation logic remains unchanged.

Changes

Cohort / File(s) Summary
Price Helper Logic
relay/helper/price.go
Modified ModelPriceHelperPerCall to calculate fallback default price from PreConsumedQuota / QuotaPerUnit when model price is missing, replacing the previous error-return path.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • seefs001

Poem

🐰 A price without a default was once our despair,
Now quotas divide neatly through the air,
No errors to fear, just logic so clean,
The finest fallback ever seen! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions 'radio price model' but the change is about using a default model price as a fallback for models billed by rate, specifically video models. Update the title to accurately reflect the change, such as 'fix: use default model price when not configured for rate-based billing' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

@feitianbubu feitianbubu closed this Mar 3, 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.

1 participant