This commit is contained in:
Fahad
2025-06-13 16:05:21 +04:00
parent 6739182c20
commit 048ebf90bf
13 changed files with 46 additions and 26 deletions

View File

@@ -212,9 +212,7 @@ class ModelProvider(ABC):
# Validate temperature
min_temp, max_temp = capabilities.temperature_range
if not min_temp <= temperature <= max_temp:
raise ValueError(
f"Temperature {temperature} out of range [{min_temp}, {max_temp}] " f"for model {model_name}"
)
raise ValueError(f"Temperature {temperature} out of range [{min_temp}, {max_temp}] for model {model_name}")
@abstractmethod
def supports_thinking_mode(self, model_name: str) -> bool:

View File

@@ -246,9 +246,7 @@ class OpenAICompatibleProvider(ModelProvider):
"""
# Validate model name against allow-list
if not self.validate_model_name(model_name):
raise ValueError(
f"Model '{model_name}' not in allowed models list. " f"Allowed models: {self.allowed_models}"
)
raise ValueError(f"Model '{model_name}' not in allowed models list. Allowed models: {self.allowed_models}")
# Validate parameters
self.validate_parameters(model_name, temperature)
@@ -367,7 +365,7 @@ class OpenAICompatibleProvider(ModelProvider):
# Check if we're using generic capabilities
if hasattr(capabilities, "_is_generic"):
logging.debug(
f"Using generic parameter validation for {model_name}. " "Actual model constraints may differ."
f"Using generic parameter validation for {model_name}. Actual model constraints may differ."
)
# Validate temperature using parent class method

View File

@@ -154,7 +154,7 @@ class OpenRouterModelRegistry:
if alias_lower in alias_map:
existing_model = alias_map[alias_lower]
raise ValueError(
f"Duplicate alias '{alias}' found for models " f"'{existing_model}' and '{config.model_name}'"
f"Duplicate alias '{alias}' found for models '{existing_model}' and '{config.model_name}'"
)
alias_map[alias_lower] = config.model_name