verbose live UI + tool-level SSE events + Groq default + regression tests

This commit is contained in:
2026-06-03 05:04:29 -03:00
parent 131f4d9b86
commit e124a8a7d9
69 changed files with 3030 additions and 137 deletions

30
tests/test_prompts.py Normal file
View File

@@ -0,0 +1,30 @@
"""Regression: every prompt file loads, render() substitutes placeholders."""
from pathlib import Path
import pytest
from api.prompts import PROMPTS_DIR, load, render
PROMPT_NAMES = sorted(
p.stem for p in PROMPTS_DIR.iterdir() if p.suffix == ".txt"
)
@pytest.mark.parametrize("name", PROMPT_NAMES)
def test_prompt_loads(name):
text = load(name)
assert text # non-empty
def test_render_substitutes():
out = render("synthesize.user", question="how many?", findings_block="x: 1")
assert "how many?" in out
assert "x: 1" in out
assert "{question}" not in out and "{findings_block}" not in out
def test_render_unknown_placeholder_raises():
# str.format raises KeyError on missing keys
with pytest.raises(KeyError):
render("synthesize.user", question="q") # missing findings_block