fix(providers): omit temperature for sonnet 5
Add sonnet-5 to the Anthropic omit-temperature model families and cover adaptive, enabled, and non-thinking request paths. Fixes #4683
This commit is contained in:
@@ -545,10 +545,12 @@ class AnthropicProvider(LLMProvider):
|
||||
max_tokens = max(1, max_tokens)
|
||||
thinking_enabled = bool(reasoning_effort) and reasoning_effort.lower() != "none"
|
||||
|
||||
# Several Anthropic models (opus-4-7, opus-4-8, fable) deprecated the
|
||||
# Several Anthropic models (opus-4-7, opus-4-8, sonnet-5, fable) deprecated the
|
||||
# `temperature` parameter — the API returns 400 if it is present.
|
||||
_model_lower = model_name.lower()
|
||||
omit_temperature = any(m in _model_lower for m in ("opus-4-7", "opus-4-8", "fable"))
|
||||
omit_temperature = any(
|
||||
m in _model_lower for m in ("opus-4-7", "opus-4-8", "sonnet-5", "fable")
|
||||
)
|
||||
|
||||
kwargs: dict[str, Any] = {
|
||||
"model": model_name,
|
||||
|
||||
Reference in New Issue
Block a user