feat: add config-driven AI model tier routing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
24
backend/tests/test_config_model_tiers.py
Normal file
24
backend/tests/test_config_model_tiers.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""Tests for AI model tier configuration."""
|
||||
from app.core.config import settings
|
||||
|
||||
|
||||
def test_ai_model_tiers_exist():
|
||||
assert "fast" in settings.AI_MODEL_TIERS
|
||||
assert "standard" in settings.AI_MODEL_TIERS
|
||||
|
||||
|
||||
def test_action_model_map_covers_all_actions():
|
||||
valid_tiers = set(settings.AI_MODEL_TIERS.keys())
|
||||
for action, tier in settings.ACTION_MODEL_MAP.items():
|
||||
assert tier in valid_tiers, f"Action '{action}' maps to unknown tier '{tier}'"
|
||||
|
||||
|
||||
def test_get_model_for_action():
|
||||
model = settings.get_model_for_action("generate_full")
|
||||
assert isinstance(model, str)
|
||||
assert len(model) > 0
|
||||
|
||||
|
||||
def test_get_model_for_action_unknown_falls_back():
|
||||
model = settings.get_model_for_action("nonexistent_action")
|
||||
assert model == settings.AI_MODEL_TIERS["standard"]
|
||||
Reference in New Issue
Block a user