refactor: rename and relocate HasModelBillingConfig function for clarity

This commit is contained in:
CaIon
2026-04-24 16:39:12 +08:00
parent e3d64cb76d
commit 3a2138ba61
5 changed files with 17 additions and 41 deletions
-14
View File
@@ -86,20 +86,6 @@ func InvalidatePricingCache() {
lastGetPricingTime = time.Time{}
}
func HasModelBillingConfig(modelName string) bool {
if _, ok := ratio_setting.GetModelPrice(modelName, false); ok {
return true
}
if _, ok, _ := ratio_setting.GetModelRatio(modelName); ok {
return true
}
if billing_setting.GetBillingMode(modelName) != billing_setting.BillingModeTieredExpr {
return false
}
expr, ok := billing_setting.GetBillingExpr(modelName)
return ok && strings.TrimSpace(expr) != ""
}
// GetVendors 返回当前定价接口使用到的供应商信息
func GetVendors() []PricingVendor {
if time.Since(lastGetPricingTime) > time.Minute*1 || len(pricingMap) == 0 {