fix: Improve error handling for model ratio and price validation #800
This commit is contained in:
@@ -147,8 +147,8 @@ func testChannel(channel *model.Channel, testModel string) (err error, openAIErr
|
|||||||
}
|
}
|
||||||
modelPrice, usePrice := common.GetModelPrice(testModel, false)
|
modelPrice, usePrice := common.GetModelPrice(testModel, false)
|
||||||
modelRatio, success := common.GetModelRatio(testModel)
|
modelRatio, success := common.GetModelRatio(testModel)
|
||||||
if !success {
|
if !usePrice && !success {
|
||||||
return fmt.Errorf("模型 %s 倍率未设置", testModel), nil
|
return fmt.Errorf("模型 %s 倍率和价格均未设置", testModel), nil
|
||||||
}
|
}
|
||||||
completionRatio := common.GetCompletionRatio(testModel)
|
completionRatio := common.GetCompletionRatio(testModel)
|
||||||
ratio := modelRatio
|
ratio := modelRatio
|
||||||
|
|||||||
Reference in New Issue
Block a user