Fix OpenAI test using max_tokens for GPT-5 models

This commit is contained in:
Yuri Karamian
2026-06-30 14:36:20 +02:00
parent 13bad87500
commit 6f4f526d07
+3 -1
View File
@@ -435,10 +435,12 @@ async fn test_anthropic(api_key: &str, model: &str) -> Result<String, String> {
async fn test_openai(url: &str, api_key: Option<&str>, model: &str) -> Result<String, String> { async fn test_openai(url: &str, api_key: Option<&str>, model: &str) -> Result<String, String> {
let client = Client::new(); let client = Client::new();
let is_gpt5 = model.starts_with("gpt-5");
let token_key = if is_gpt5 { "max_completion_tokens" } else { "max_tokens" };
let body = json!({ let body = json!({
"model": model, "model": model,
"max_tokens": 10, token_key: 10,
"messages": [ "messages": [
{ {
"role": "user", "role": "user",