"""Synthetic smoke test, not a production benchmark. Requires laya 0.3.20."""
import json, platform, time
from pathlib import Path
from datetime import datetime, timezone
from importlib.metadata import version
from laya import Router
base = Path(__file__).resolve().parent
cases = json.loads((base / "laya-cases.json").read_text(encoding="utf-8"))
router = Router()
questions = {"department": {"type": "choice", "instructions": "Which queue should handle this message?", "criteria": {"billing": "invoices, charges and refunds", "technical": "application errors and failed functionality", "sales": "pre-purchase questions and quotes", "other": "everything else or insufficient information"}}}
rows = []
for case in cases:
    start = time.perf_counter()
    result = router.predict(case["text"], questions, model="english")
    rows.append({**case, "elapsed_seconds": time.perf_counter()-start, "raw_result": result})
report = {"date": datetime.now(timezone.utc).isoformat(), "python": platform.python_version(), "laya": version("laya"), "checkpoint_selection": "english", "note": "First call can include download/loading. Eight synthetic cases are not a benchmark.", "results": rows}
(base / "laya-results.json").write_text(json.dumps(report, indent=2, default=str), encoding="utf-8")
print("Saved raw results to laya-results.json")
