fix: ensure proper model listings

This commit is contained in:
Greyson Lalonde
2026-02-27 17:03:12 -05:00
parent 86cee35294
commit e47ebb7169
3 changed files with 17 additions and 1 deletions

View File

@@ -2416,6 +2416,9 @@ class LLM(BaseLLM):
"gpt-4.1",
"claude-3",
"claude-4",
"claude-sonnet-4",
"claude-opus-4",
"claude-haiku-4",
"gemini",
)
model_lower = self.model.lower()

View File

@@ -1597,7 +1597,14 @@ class AnthropicCompletion(BaseLLM):
Returns:
True if the model supports images and PDFs.
"""
return "claude-3" in self.model.lower() or "claude-4" in self.model.lower()
model_lower = self.model.lower()
return (
"claude-3" in model_lower
or "claude-4" in model_lower
or "claude-sonnet-4" in model_lower
or "claude-opus-4" in model_lower
or "claude-haiku-4" in model_lower
)
def get_file_uploader(self) -> Any:
"""Get an Anthropic file uploader using this LLM's clients.

View File

@@ -2079,12 +2079,18 @@ class BedrockCompletion(BaseLLM):
model_lower = self.model.lower()
vision_models = (
"anthropic.claude-3",
"anthropic.claude-sonnet-4",
"anthropic.claude-opus-4",
"anthropic.claude-haiku-4",
"amazon.nova-lite",
"amazon.nova-pro",
"amazon.nova-premier",
"us.amazon.nova-lite",
"us.amazon.nova-pro",
"us.amazon.nova-premier",
"us.anthropic.claude-sonnet-4",
"us.anthropic.claude-opus-4",
"us.anthropic.claude-haiku-4",
)
return any(model_lower.startswith(m) for m in vision_models)