mirror of
https://github.com/alibaba/open-code-review.git
synced 2026-07-09 17:28:58 +00:00
fix(llm): use max_completion_tokens instead of deprecated max_tokens for OpenAI requests
Fixes #30 — newer OpenAI models (o1, o3, o4, gpt-5.x) reject the deprecated max_tokens parameter with a 400 error.
This commit is contained in:
parent
8d187f607f
commit
5fad9ce2fa
1 changed files with 1 additions and 1 deletions
|
|
@ -390,7 +390,7 @@ func (c *OpenAIClient) buildOpenAIParams(model string, req ChatRequest) openai.C
|
|||
params.Tools = tools
|
||||
}
|
||||
if req.MaxTokens > 0 {
|
||||
params.MaxTokens = openai.Int(int64(req.MaxTokens))
|
||||
params.MaxCompletionTokens = openai.Int(int64(req.MaxTokens))
|
||||
}
|
||||
if req.Temperature != nil {
|
||||
params.Temperature = openai.Float(*req.Temperature)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue