feat: task pre consume modelPrice default use setting value - #2733
Conversation
WalkthroughA single line modification in the RelayTaskSubmit function changes the fallback default price calculation. When a model lacks a default price entry, the modelPrice is now computed from PreConsumedQuota divided by QuotaPerUnit instead of using a hard-coded value of 0.1. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
relay/relay_task.go (1)
143-151: Update fallback model price consistently across codebase.The new formula at line 147 computes
modelPrice = 500 / 500000 = 0.001, which is 100x smaller than the previous0.1. However,relay/helper/price.goline 151 still uses the hardcoded fallback value of0.1in an identical scenario—both are fallback logic for models without explicit pricing. This inconsistency could cause different request types to receive different default pricing.Either update
relay/helper/price.goto use the same formula, or clarify if the divergence is intentional.
…d7331d0987d96dc78bae181e331 feat: task pre consume modelPrice default use setting value
任务预扣费默认取后台设置的
请求预扣费额度Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.