Lightweight SDK for building custom agentevals evaluators
Project description
agentevals-evaluator-sdk
Lightweight SDK for building custom agentevals evaluators.
An evaluator is a standalone program that scores agent traces. It reads EvalInput JSON from stdin and writes EvalResult JSON to stdout. This SDK provides the Python types and a @evaluator decorator that handles all the plumbing.
Installation
pip install agentevals-evaluator-sdk
Usage
from agentevals_evaluator_sdk import evaluator, EvalInput, EvalResult
@evaluator
def my_evaluator(input: EvalInput) -> EvalResult:
scores = []
for inv in input.invocations:
score = 1.0 if inv.final_response else 0.0
scores.append(score)
return EvalResult(
score=sum(scores) / len(scores) if scores else 0.0,
per_invocation_scores=scores,
)
if __name__ == "__main__":
my_evaluator.run()
The @evaluator decorator marks your function as a runnable evaluator. Call .run() to execute it as a stdin/stdout script -- it reads JSON from stdin, calls your function, and writes the result to stdout. The decorated function can still be called directly in tests.
Types
EvalInput-- input payload withmetric_name,threshold,config,invocations, and optionalexpected_invocationsEvalResult-- output payload withscore(0.0-1.0), optionalstatus,per_invocation_scores, anddetails(dict)InvocationData-- a single agent turn withuser_content,final_response, andintermediate_stepsIntermediateStepData-- the steps between user input and final response:tool_callsandtool_responses
Documentation
See the custom evaluators documentation for the full protocol reference and examples in other languages.
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 agentevals_evaluator_sdk-0.1.1.tar.gz.
File metadata
- Download URL: agentevals_evaluator_sdk-0.1.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d69872bc94c5f1d213a9156f2c3205ad9c89c9e37ffd49435070ac6dcc791c6
|
|
| MD5 |
fcc0d371ab602a05d6461b49e7c931a2
|
|
| BLAKE2b-256 |
00ed737397ee14c859dd08056949a9e6dccef2f96b3219809c021984f3113b64
|
File details
Details for the file agentevals_evaluator_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: agentevals_evaluator_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7169549f9deaa8d659beeaea36268fbd72035dd59baba6f128da2234992ccdd
|
|
| MD5 |
3771fc5b26eb2c0f20366623abc6b96c
|
|
| BLAKE2b-256 |
a92183d22806c064950f07bd4f4c6764fde77ab677e08453d01c1786ef93bcbd
|