Files
goclaw/internal
e5f8a2a7da fix(openai): use max_completion_tokens and skip temperature for GPT-5/o-series models (#213)
GPT-5 and o-series models reject the legacy max_tokens parameter and
require max_completion_tokens instead. Additionally, gpt-5-mini,
gpt-5-nano, and o-series models only support the default temperature (1).

This patch adds model-aware branching in buildRequestBody() to:
- Send max_completion_tokens instead of max_tokens for gpt-5*/o1/o3/o4
- Skip temperature parameter for gpt-5-mini/gpt-5-nano/o-series

Co-authored-by: Marcelo Emmerich <marcelo@agenticsystems.de>
2026-03-15 19:39:39 +07:00
..