Browse Source

fix: Adjust MaxTokens logic for non-Claude models in test request

1808837298@qq.com 11 months ago
parent
commit
73263e02d6
1 changed files with 3 additions and 1 deletions
  1. 3 1
      controller/channel-test.go

+ 3 - 1
controller/channel-test.go

@@ -187,7 +187,9 @@ func buildTestRequest(model string) *dto.GeneralOpenAIRequest {
 	if strings.HasPrefix(model, "o1") || strings.HasPrefix(model, "o3") {
 	if strings.HasPrefix(model, "o1") || strings.HasPrefix(model, "o3") {
 		testRequest.MaxCompletionTokens = 10
 		testRequest.MaxCompletionTokens = 10
 	} else if strings.Contains(model, "thinking") {
 	} else if strings.Contains(model, "thinking") {
-		testRequest.MaxTokens = 50
+		if !strings.Contains(model, "claude") {
+			testRequest.MaxTokens = 50
+		}
 	} else {
 	} else {
 		testRequest.MaxTokens = 10
 		testRequest.MaxTokens = 10
 	}
 	}