소스 검색

fix: Improve error handling for model ratio and price validation #800

1808837298@qq.com 1 년 전
부모
커밋
2f9faba40d
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      controller/channel-test.go

+ 2 - 2
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