mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-05 08:05:12 +00:00
The Anthropic and Bedrock account test payloads always sent
temperature: 1, so testing claude-opus-4-8 failed with HTTP 400
("temperature is deprecated for this model") and a working account was
reported as broken.
Add claude.RejectsTemperature for Opus 4.7/4.8, Opus 5.5, Fable 5.2 and
Mythos 5.2, and skip the field for those models. Other models keep the
existing payload.
Fixes #8625
22 lines
434 B
Go
22 lines
434 B
Go
package claude
|
|
|
|
import "strings"
|
|
|
|
var temperatureRejectingFamilies = []string{
|
|
"claude-opus-4-7",
|
|
"claude-opus-4-8",
|
|
}
|
|
|
|
func RejectsTemperature(model string) bool {
|
|
if IsOpus55(model) || IsFable52(model) || IsMythos52(model) {
|
|
return true
|
|
}
|
|
id := normalizeEffortModelID(model)
|
|
for _, family := range temperatureRejectingFamilies {
|
|
if id == family || strings.HasPrefix(id, family+"-") {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|