| """Cross-platform task runner. Run via `invoke <task>` after `pip install invoke`. | |
| Replaces the role of a Makefile so Windows/Mac/Linux users get the same UX. | |
| """ | |
| from __future__ import annotations | |
| from invoke import task | |
| def install(c): | |
| """Editable install with dev + llm extras.""" | |
| c.run('pip install -e ".[dev,llm]"') | |
| def lint(c): | |
| c.run("ruff check src/ tests/") | |
| def fmt(c): | |
| c.run("ruff format src/ tests/") | |
| def test(c): | |
| c.run("pytest tests/ -v") | |
| def smoke(c, q="매장 CCTV 안내문구 어떻게 써요?"): | |
| """Run a single end-to-end smoke through the RAG pipeline.""" | |
| c.run(f'python -m kpaa smoke "{q}"') | |
| def evalq(c): | |
| """Run golden-question evaluation.""" | |
| c.run("python -m kpaa eval") | |
| def serve(c): | |
| """Start the FastAPI backend on :8000.""" | |
| c.run("python -m kpaa serve") | |
| def up(c): | |
| c.run("docker compose up -d") | |
| def down(c): | |
| c.run("docker compose down") | |
| def refresh_cases(c, since=""): | |
| cmd = "python -m kpaa refresh-cases" | |
| if since: | |
| cmd += f" --since {since}" | |
| c.run(cmd) | |