mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
feat(llm): added Claude Opus 4.5 model and corresponding test (#11841)
This commit is contained in:
@@ -188,12 +188,14 @@ class LLM(RetryMixin, DebugMixin):
|
||||
if 'claude-opus-4-1' in self.config.model.lower():
|
||||
kwargs['thinking'] = {'type': 'disabled'}
|
||||
|
||||
# Anthropic constraint: Opus 4.1 and Sonnet 4 models cannot accept both temperature and top_p
|
||||
# Anthropic constraint: Opus 4.1, Opus 4.5, and Sonnet 4 models cannot accept both temperature and top_p
|
||||
# Prefer temperature (drop top_p) if both are specified.
|
||||
_model_lower = self.config.model.lower()
|
||||
# Apply to Opus 4.1 and Sonnet 4 models to avoid API errors
|
||||
# Apply to Opus 4.1, Opus 4.5, and Sonnet 4 models to avoid API errors
|
||||
if (
|
||||
('claude-opus-4-1' in _model_lower) or ('claude-sonnet-4' in _model_lower)
|
||||
('claude-opus-4-1' in _model_lower)
|
||||
or ('claude-opus-4-5' in _model_lower)
|
||||
or ('claude-sonnet-4' in _model_lower)
|
||||
) and ('temperature' in kwargs and 'top_p' in kwargs):
|
||||
kwargs.pop('top_p', None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user