|
@@ -79,14 +79,15 @@ func ModelPriceHelper(c *gin.Context, info *relaycommon.RelayInfo, promptTokens
|
|
|
preConsumedTokens = promptTokens + maxTokens
|
|
preConsumedTokens = promptTokens + maxTokens
|
|
|
}
|
|
}
|
|
|
var success bool
|
|
var success bool
|
|
|
- modelRatio, success = ratio_setting.GetModelRatio(info.OriginModelName)
|
|
|
|
|
|
|
+ var matchName string
|
|
|
|
|
+ modelRatio, success, matchName = ratio_setting.GetModelRatio(info.OriginModelName)
|
|
|
if !success {
|
|
if !success {
|
|
|
acceptUnsetRatio := false
|
|
acceptUnsetRatio := false
|
|
|
if info.UserSetting.AcceptUnsetRatioModel {
|
|
if info.UserSetting.AcceptUnsetRatioModel {
|
|
|
acceptUnsetRatio = true
|
|
acceptUnsetRatio = true
|
|
|
}
|
|
}
|
|
|
if !acceptUnsetRatio {
|
|
if !acceptUnsetRatio {
|
|
|
- return PriceData{}, fmt.Errorf("模型 %s 倍率或价格未配置,请联系管理员设置或开始自用模式;Model %s ratio or price not set, please set or start self-use mode", info.OriginModelName, info.OriginModelName)
|
|
|
|
|
|
|
+ return PriceData{}, fmt.Errorf("模型 %s 倍率或价格未配置,请联系管理员设置或开始自用模式;Model %s ratio or price not set, please set or start self-use mode", matchName, matchName)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
completionRatio = ratio_setting.GetCompletionRatio(info.OriginModelName)
|
|
completionRatio = ratio_setting.GetCompletionRatio(info.OriginModelName)
|
|
@@ -152,7 +153,7 @@ func ContainPriceOrRatio(modelName string) bool {
|
|
|
if ok {
|
|
if ok {
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
- _, ok = ratio_setting.GetModelRatio(modelName)
|
|
|
|
|
|
|
+ _, ok, _ = ratio_setting.GetModelRatio(modelName)
|
|
|
if ok {
|
|
if ok {
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|