-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__main__.py
More file actions
31 lines (22 loc) · 966 Bytes
/
__main__.py
File metadata and controls
31 lines (22 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""Eval-harness CLI: ``python -m src.eval`` runs the golden dataset and
prints the markdown report. The default ``answer_fn`` echoes the question
verbatim — wire your real agent loop in by importing this module and
constructing ``EvalRunner(answer_fn=your_callable)``.
"""
from __future__ import annotations
from src.eval.report import generate_report
from src.eval.runner import EvalRunner
def _identity_answer(question: str) -> str:
"""Default placeholder agent — returns the question verbatim.
Real users wire a ``Callable[[str], str]`` that hits their LLM / agent
loop. This default keeps the CLI runnable without LLM credentials.
"""
return question
def main() -> int:
runner = EvalRunner(answer_fn=_identity_answer)
results = runner.evaluate_all()
report = generate_report(results)
print(report)
return 0 if all(r.pass_result for r in results) else 1
if __name__ == "__main__":
raise SystemExit(main())