fix: baseclass should return MODEL_CAPABILITIES
This commit is contained in:
@@ -70,8 +70,11 @@ class ModelProvider(ABC):
|
||||
return self._finalise_capabilities(capabilities, resolved_name, model_name)
|
||||
|
||||
def get_all_model_capabilities(self) -> dict[str, ModelCapabilities]:
|
||||
"""Return the provider's statically declared model capabilities."""
|
||||
"""Return statically declared capabilities when available."""
|
||||
|
||||
model_map = getattr(self, "MODEL_CAPABILITIES", None)
|
||||
if isinstance(model_map, dict) and model_map:
|
||||
return {k: v for k, v in model_map.items() if isinstance(v, ModelCapabilities)}
|
||||
return {}
|
||||
|
||||
def list_models(
|
||||
|
||||
@@ -135,11 +135,6 @@ class GeminiModelProvider(ModelProvider):
|
||||
# Capability surface
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
def get_all_model_capabilities(self) -> dict[str, ModelCapabilities]:
|
||||
"""Return statically defined Gemini capabilities."""
|
||||
|
||||
return dict(self.MODEL_CAPABILITIES)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Client access
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
@@ -79,14 +79,6 @@ class OpenAICompatibleProvider(ModelProvider):
|
||||
f"Model '{requested_name}' is not allowed by restriction policy. Allowed models: {sorted(self.allowed_models)}"
|
||||
)
|
||||
|
||||
def get_all_model_capabilities(self) -> dict[str, ModelCapabilities]:
|
||||
"""Return statically declared capabilities for OpenAI-compatible providers."""
|
||||
|
||||
model_map = getattr(self, "MODEL_CAPABILITIES", None)
|
||||
if isinstance(model_map, dict):
|
||||
return {k: v for k, v in model_map.items() if isinstance(v, ModelCapabilities)}
|
||||
return {}
|
||||
|
||||
def _parse_allowed_models(self) -> Optional[set[str]]:
|
||||
"""Parse allowed models from environment variable.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user