From 2f9faba40df759175420d40820d5cd9902c32b95 Mon Sep 17 00:00:00 2001 From: "1808837298@qq.com" <1808837298@qq.com> Date: Sat, 1 Mar 2025 15:27:32 +0800 Subject: [PATCH] fix: Improve error handling for model ratio and price validation #800 --- controller/channel-test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/channel-test.go b/controller/channel-test.go index f7b73f6a..23922073 100644 --- a/controller/channel-test.go +++ b/controller/channel-test.go @@ -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