Every existing tool evaluates what the agent said. OpenEval evaluates what the agent did.
Project description
OpenEval
Every existing tool evaluates what the agent said. OpenEval evaluates what the agent did.
Installation
pip install openeval-core
Note: While the package is installed as openeval-core, the CLI command to run it is openeval.
Usage
Run a single test case using the included example:
openeval run --trace examples/simple_agent/trace.json --testcase examples/simple_agent/testcase.json
Run a test suite:
openeval run --suite tests/ --output results/
Generate a report:
openeval report --input results/ --format markdown
Note: The report command will exit with a non-zero status code (1) if any JSON file in the input directory is malformed or fails to load, guaranteeing pipeline failures on corrupted evals.
Quickstart
Get your first deterministic evaluation running in under 2 minutes. OpenEval is completely framework-agnostic.
Tier 1: The Core Engine (No Framework Required)
The core engine requires zero dependencies on external frameworks or LLM SDKs. You just feed it plain Python data.
1. Install the package
pip install openeval-core
2. Score a trace deterministically
Create a file named hello_eval.py and run it:
from openeval.metrics import ToolSelectionAccuracy
from openeval.models import AgentTrace, EvalTestCase, TraceStep
# 1. Define what the agent was supposed to do
test_case = EvalTestCase(
task_id="quickstart-1",
input="Search for the weather in Tokyo",
expected_tool_calls=[{"tool": "search", "args": {"query": "weather in Tokyo"}}],
expected_final_state={},
expected_output_contains=[],
max_steps=5,
timeout_seconds=10.0
)
# 2. Provide the raw trace of what the agent actually did
trace = AgentTrace(
task_id="quickstart-1",
input="Search for the weather in Tokyo",
steps=[
TraceStep(
step_id=1,
type="tool_call",
content="",
tool_name="search",
tool_args={"query": "weather in Tokyo"},
tool_result="85 degrees and sunny",
timestamp=0.0
)
],
final_output="The weather in Tokyo is 85 degrees and sunny.",
actual_state={},
metadata={}
)
# 3. Score it deterministically (no LLM required)
metric = ToolSelectionAccuracy()
result = metric.score(trace, test_case)
print(f"Metric: {result.metric_name}")
print(f"Score: {result.score} (Passed: {result.passed})")
print(f"Details: {result.details}")
Expected Output:
Metric: Tool Selection Accuracy
Score: 1.0 (Passed: True)
Details: Correctly called 1 of 1 expected tools.
Tier 2: Using OpenEval with LangChain
If your traces come from LangChain, you can use our built-in adapter to automatically convert LangChain runs into OpenEval traces.
1. Install with LangChain support
pip install "openeval-core[langchain]"
2. Convert and Score
(See the examples/ directory in our GitHub repository for full, runnable agent scripts using this adapter.)
from openeval.adapters.langchain import from_langchain_run
from langchain_core.tracers.context import collect_runs
with collect_runs() as cb:
# Run your langchain agent
agent.invoke({"input": "task input"})
# Convert the run to an OpenEval AgentTrace
trace = from_langchain_run(cb.traced_runs[0])
# Score it exactly like Tier 1
# metric.score(trace, test_case)
OpenAI Tool Calling
OpenEval can automatically convert raw OpenAI chat completions message lists into AgentTrace objects.
LIMITATION: This adapter flattens the message list. Only the first user message is used as the input, and the final assistant message without tool calls is used as the output. Any intermediate non-tool conversational turns are not captured structurally.
from openeval.adapters.openai import from_openai_messages
messages = [
# ... your OpenAI messages list
]
# Convert the messages
trace = from_openai_messages(messages)
GitHub Action
OpenEval provides a GitHub Action to seamlessly gate PRs based on your agents' performance.
steps:
- uses: actions/checkout@v4
- name: Grade Agent Execution
uses: organization/openeval-core@v1
with:
suite: path/to/your/test_suite_dir
fail-under: '0.8' # Fail the step if average metric score is < 80%
Project details
Release history Release notifications | RSS feed
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 openeval_core-0.1.2.tar.gz.
File metadata
- Download URL: openeval_core-0.1.2.tar.gz
- Upload date:
- Size: 22.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a801ab4cf6a58bf7db4c17c2d666dbffc6e5889cb9369dc19bbeeec39f8df50e
|
|
| MD5 |
14b531dcf9361d5a898057e1eea8ba28
|
|
| BLAKE2b-256 |
3cf380abfc92936ce7a495103c43feb53afa58553bea12862104ea32bf9cffeb
|
Provenance
The following attestation bundles were made for openeval_core-0.1.2.tar.gz:
Publisher:
publish.yml on yash161004/OpenEval
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openeval_core-0.1.2.tar.gz -
Subject digest:
a801ab4cf6a58bf7db4c17c2d666dbffc6e5889cb9369dc19bbeeec39f8df50e - Sigstore transparency entry: 2054761507
- Sigstore integration time:
-
Permalink:
yash161004/OpenEval@5e67d52b7a476e9e2c7039f0978e2d3c7c952711 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/yash161004
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5e67d52b7a476e9e2c7039f0978e2d3c7c952711 -
Trigger Event:
release
-
Statement type:
File details
Details for the file openeval_core-0.1.2-py3-none-any.whl.
File metadata
- Download URL: openeval_core-0.1.2-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a081c40297fe70b390c06eab8f3dab8e69986872beaf6d36da875f74ab35beec
|
|
| MD5 |
c4a4db375bbe7df0e01046c531e2a07c
|
|
| BLAKE2b-256 |
1c42c0e59cce628c60156e7e1ceaa00f9b546e2188a6861daff7b2fd6af53043
|
Provenance
The following attestation bundles were made for openeval_core-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on yash161004/OpenEval
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openeval_core-0.1.2-py3-none-any.whl -
Subject digest:
a081c40297fe70b390c06eab8f3dab8e69986872beaf6d36da875f74ab35beec - Sigstore transparency entry: 2054761569
- Sigstore integration time:
-
Permalink:
yash161004/OpenEval@5e67d52b7a476e9e2c7039f0978e2d3c7c952711 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/yash161004
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5e67d52b7a476e9e2c7039f0978e2d3c7c952711 -
Trigger Event:
release
-
Statement type: