fix: address test failures and PR feedback

- Fix ModelContext constructor call in consensus tool (remove invalid parameters)
- Refactor temperature pattern matching for better readability per code review
- All tests now passing (799/799 passed)
This commit is contained in:
Sven Lito
2025-08-23 18:50:49 +07:00
parent 3b4fd88d7e
commit 6bd9d6709a
2 changed files with 11 additions and 14 deletions

View File

@@ -210,15 +210,16 @@ class CustomProvider(OpenAICompatibleProvider):
# Check for specific model patterns that don't support temperature # Check for specific model patterns that don't support temperature
for pattern in _TEMP_UNSUPPORTED_PATTERNS: for pattern in _TEMP_UNSUPPORTED_PATTERNS:
if ( conditions = (
pattern == model_lower pattern == model_lower,
or model_lower.startswith(f"{pattern}-") model_lower.startswith(f"{pattern}-"),
or model_lower.startswith(f"openai/{pattern}") model_lower.startswith(f"openai/{pattern}"),
or model_lower.startswith(f"deepseek/{pattern}") model_lower.startswith(f"deepseek/{pattern}"),
or model_lower.endswith(f"-{pattern}") model_lower.endswith(f"-{pattern}"),
or f"/{pattern}" in model_lower f"/{pattern}" in model_lower,
or f"-{pattern}-" in model_lower f"-{pattern}-" in model_lower,
): )
if any(conditions):
return False, f"detected non-temperature-supporting model pattern '{pattern}'" return False, f"detected non-temperature-supporting model pattern '{pattern}'"
# Check for specific keywords that indicate non-supporting variants # Check for specific keywords that indicate non-supporting variants

View File

@@ -548,11 +548,7 @@ of the evidence, even when it strongly points in one direction.""",
system_prompt = self._get_stance_enhanced_prompt(stance, stance_prompt) system_prompt = self._get_stance_enhanced_prompt(stance, stance_prompt)
# Get model context for temperature validation # Get model context for temperature validation
model_context = ModelContext( model_context = ModelContext(model_name=model_name)
model_name=model_name,
provider=provider.get_provider_type(),
provider_instance=provider,
)
# Validate temperature against model constraints (respects supports_temperature) # Validate temperature against model constraints (respects supports_temperature)
validated_temperature, temp_warnings = self.validate_and_correct_temperature( validated_temperature, temp_warnings = self.validate_and_correct_temperature(