Cleanup
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user