feat(api): config + role→model routing (qwen3.5 narrator default, think off)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
21
api/tests/test_routing.py
Normal file
21
api/tests/test_routing.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import pytest
|
||||
|
||||
from app.routing import for_role
|
||||
|
||||
|
||||
def test_narrator_defaults():
|
||||
cfg = for_role("narrator")
|
||||
assert cfg.model == "qwen3.5:latest"
|
||||
assert cfg.think is False
|
||||
assert cfg.options["num_predict"] == 300
|
||||
assert cfg.options["temperature"] == 0.8
|
||||
|
||||
|
||||
def test_env_overrides_model(monkeypatch):
|
||||
monkeypatch.setenv("OLLAMA_NARRATOR_MODEL", "llama3.1:latest")
|
||||
assert for_role("narrator").model == "llama3.1:latest"
|
||||
|
||||
|
||||
def test_unknown_role_raises():
|
||||
with pytest.raises(KeyError):
|
||||
for_role("wizard")
|
||||
Reference in New Issue
Block a user