Merge pull request #4431 from yyhhyyyyyy/fix/tiered-billing-model-list

fix: include tiered billing models in model listing
This commit is contained in:
yyhhyyyyyy
2026-04-24 16:24:36 +08:00
committed by GitHub
parent 2e610e5fb3
commit e3d64cb76d
5 changed files with 272 additions and 19 deletions
+1 -13
View File
@@ -224,19 +224,7 @@ func ModelPriceHelperPerCall(c *gin.Context, info *relaycommon.RelayInfo) (types
}
func ContainPriceOrRatio(modelName string) bool {
_, ok := ratio_setting.GetModelPrice(modelName, false)
if ok {
return true
}
_, ok, _ = ratio_setting.GetModelRatio(modelName)
if ok {
return true
}
if billing_setting.GetBillingMode(modelName) == billing_setting.BillingModeTieredExpr {
_, ok = billing_setting.GetBillingExpr(modelName)
return ok
}
return false
return model.HasModelBillingConfig(modelName)
}
func modelPriceHelperTiered(c *gin.Context, info *relaycommon.RelayInfo, promptTokens int, meta *types.TokenCountMeta, groupRatioInfo types.GroupRatioInfo) (types.PriceData, error) {