Restrict temperature override for unsupported models (o* and gpt-5*).
This commit is contained in:
@@ -50,7 +50,12 @@ func (o openaiImpl) newRequestToOpenAIRequest(request Request) openai.ChatComple
|
||||
}
|
||||
|
||||
if request.Temperature != nil {
|
||||
res.Temperature = openai.Float(*request.Temperature)
|
||||
// these are known models that do not support custom temperatures
|
||||
// all the o* models
|
||||
// gpt-5* models
|
||||
if !strings.HasPrefix(o.model, "o") && strings.HasPrefix(o.model, "gpt-5") {
|
||||
res.Temperature = openai.Float(*request.Temperature)
|
||||
}
|
||||
}
|
||||
|
||||
return res
|
||||
|
Reference in New Issue
Block a user