pyantra-eval
Trajectory evaluation, LLM judges, and a pytest plugin for Pyantra. Assert on how a workflow ran — not just whether it returned.
pip install pyantra-eval
Trajectory expectations
Judge a Run
against expectations covering status, errors, node visits, ordering, and step
count. evaluate runs several at once and returns an EvalReport.
from pyantra_eval import (
evaluate,
expect_completed,
expect_ordered,
expect_visited,
)
report = evaluate(
run,
expect_completed(),
expect_visited("fetch"),
expect_ordered("fetch", "parse", "store"),
)
assert report.passed
Available expectations:
expect_status(...)/expect_completed()/expect_failed(contains=..., pattern=...)expect_visited(node, at_least=...)/expect_not_visited(node)expect_ordered(*nodes)expect_max_steps(limit)expect_interrupt()expect_that(check, message=..., name=...)— arbitrary predicates
LLM judges
Score output against a rubric with any pyantra.LLM
provider. LLMJudge prompts the model, parses a numeric verdict (Score: 3
or Score: 7/10), clamps it to your scale, and records the rationale and usage.
from pyantra import MockLLM
from pyantra_eval import LLMJudge, expect_judged
judge = LLMJudge(MockLLM(responses=["Score: 8/10\nRationale: Accurate."]),
rubric="Factual accuracy", max_score=10.0)
verdict = judge.judge(answer) # JudgeResult(score, rationale, usage)
report = evaluate(run, expect_judged(judge, threshold=6.0))
expect_judged extracts the text to score from the run (default: the final
state) and passes the verdict through the report.
pytest plugin
Declare expectations inside a test via the pyantra_evals fixture; the test
fails at teardown with a summary if any expectation did not hold.
def test_order_flow(pyantra_evals):
run = app.run(state)
pyantra_evals.expect(run, expect_completed(), expect_ordered("a", "b", "c"))
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyantra_eval-0.5.1.tar.gz.
File metadata
- Download URL: pyantra_eval-0.5.1.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
170407b52a76f551dd6975e7aa2af415a187334c19c03beb5631efe01a15e904
|
|
| MD5 |
15009cf4a106dc78ba647a887a19c40c
|
|
| BLAKE2b-256 |
8833a5515a6664ab14b95ec83890c7fcdc6991fdcce17c3eb2c2a0758b28da60
|
Provenance
The following attestation bundles were made for pyantra_eval-0.5.1.tar.gz:
Publisher:
publish.yml on Eskaykaushik/pyantra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyantra_eval-0.5.1.tar.gz -
Subject digest:
170407b52a76f551dd6975e7aa2af415a187334c19c03beb5631efe01a15e904 - Sigstore transparency entry: 2488648063
- Sigstore integration time:
-
Permalink:
Eskaykaushik/pyantra@40bbc747ddf837839dea3ba7c641db59414129c7 -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/Eskaykaushik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@40bbc747ddf837839dea3ba7c641db59414129c7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyantra_eval-0.5.1-py3-none-any.whl.
File metadata
- Download URL: pyantra_eval-0.5.1-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06d04e37b7ac94d5f4a6416f9fc74ff56971050692b25684a2e7f8529fb4b7ef
|
|
| MD5 |
453a59f26b53a4f131a5b1692ceaf3e7
|
|
| BLAKE2b-256 |
b64cb8feb140bfb7626ae7c45ede5bd43511155a518e955fac965f38a44fc606
|
Provenance
The following attestation bundles were made for pyantra_eval-0.5.1-py3-none-any.whl:
Publisher:
publish.yml on Eskaykaushik/pyantra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyantra_eval-0.5.1-py3-none-any.whl -
Subject digest:
06d04e37b7ac94d5f4a6416f9fc74ff56971050692b25684a2e7f8529fb4b7ef - Sigstore transparency entry: 2488540152
- Sigstore integration time:
-
Permalink:
Eskaykaushik/pyantra@40bbc747ddf837839dea3ba7c641db59414129c7 -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/Eskaykaushik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@40bbc747ddf837839dea3ba7c641db59414129c7 -
Trigger Event:
push
-
Statement type: