fix: skip max_completion_tokens when maxTokens is None (#3284)

This commit is contained in:
Aymen El Amri 2026-02-24 20:04:03 +01:00 committed by GitHub
commit 549f48bc7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -84,8 +84,9 @@ class OpenAISamplingHandler:
kwargs: dict[str, Any] = {
"model": model,
"messages": openai_messages,
"max_completion_tokens": params.maxTokens,
}
if params.maxTokens is not None:
kwargs["max_completion_tokens"] = params.maxTokens
if params.temperature is not None:
kwargs["temperature"] = params.temperature
if params.stopSequences: