fix: correct type annotation

Overridden `supported_models` should be a `classmethod` rather than a `staticmethod`.

PiperOrigin-RevId: 790989895
This commit is contained in:
Google Team Member
2025-08-04 19:25:13 -07:00
committed by Copybara-Service
parent 283303032a
commit 97318bcd19
4 changed files with 9 additions and 8 deletions
+2 -2
View File
@@ -249,9 +249,9 @@ class Claude(BaseLlm):
model: str = "claude-3-5-sonnet-v2@20241022"
max_tokens: int = 8192
@staticmethod
@classmethod
@override
def supported_models() -> list[str]:
def supported_models(cls) -> list[str]:
return [r"claude-3-.*", r"claude-.*-4.*"]
@override
+2 -2
View File
@@ -75,9 +75,9 @@ class Gemini(BaseLlm):
```
"""
@staticmethod
@classmethod
@override
def supported_models() -> list[str]:
def supported_models(cls) -> list[str]:
"""Provides the list of supported models.
Returns:
+2 -2
View File
@@ -848,9 +848,9 @@ class LiteLlm(BaseLlm):
response = await self.llm_client.acompletion(**completion_args)
yield _model_response_to_generate_content_response(response)
@staticmethod
@classmethod
@override
def supported_models() -> list[str]:
def supported_models(cls) -> list[str]:
"""Provides the list of supported models.
LiteLlm supports all models supported by litellm. We do not keep track of
+3 -2
View File
@@ -282,8 +282,9 @@ class MockModel(BaseLlm):
return cls(responses=responses)
@staticmethod
def supported_models() -> list[str]:
@classmethod
@override
def supported_models(cls) -> list[str]:
return ['mock']
def generate_content(