Files
k8sgpt/pkg/ai
kk573 c80b2e2c34 fix: use MaxCompletionTokens instead of deprecated MaxTokens for OpenAI (#1604)
The OpenAI API deprecated 'max_tokens' parameter in favor of
'max_completion_tokens' for newer models (o1, gpt-4o, etc.).

This change fixes the error:
'Unsupported parameter: max_tokens is not supported with this model.
Use max_completion_tokens instead.'

Refs: https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_tokens

Signed-off-by: Evgenii Kuzakov <evgeniy.kuzakov@csssr.com>
Co-authored-by: Evgenii Kuzakov <evgeniy.kuzakov@csssr.com>
2026-01-27 17:46:51 +00:00
..
2025-06-20 16:30:50 +01:00
2024-01-14 20:22:00 +00:00
2024-11-12 12:04:01 +00:00
2026-01-05 12:05:17 +00:00
2026-01-05 12:05:17 +00:00
2024-07-03 21:16:06 +01:00