Files
sub2api/backend/internal/pkg/claude/sampling.go
T
Echways 75290a9f26 fix(accounts): omit temperature from account tests for models that reject it
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
2026-11-17 23:08:42 +03:00

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
}