Skip to content

Commit

Permalink
fix: Improve error handling for model ratio and price validation #800
Browse files Browse the repository at this point in the history
  • Loading branch information
Calcium-Ion committed Mar 1, 2025
1 parent a508501 commit 2f9faba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controller/channel-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ func testChannel(channel *model.Channel, testModel string) (err error, openAIErr
}
modelPrice, usePrice := common.GetModelPrice(testModel, false)
modelRatio, success := common.GetModelRatio(testModel)
if !success {
return fmt.Errorf("模型 %s 倍率未设置", testModel), nil
if !usePrice && !success {
return fmt.Errorf("模型 %s 倍率和价格均未设置", testModel), nil
}
completionRatio := common.GetCompletionRatio(testModel)
ratio := modelRatio
Expand Down

0 comments on commit 2f9faba

Please sign in to comment.