Agent testing SDK. Instrument, assert, classify.
Project description
Test your AI agents. Catch failures before your users do.
Quick Links: Quickstart · Assertions · Failure Types · Contributing
pip install playagent[all]
from playagent import record
from playagent.adapters.openai import OpenAI
client = OpenAI()
@record
def run_agent(user_input: str):
return client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": user_input}],
)
session sess_a1b2c3d4
agent run_agent
started 2026-04-05 09:14:32
duration 3.24s
status passed
──────────────────────── turn 1 ─────────────────────────
model gpt-4o
latency 812ms
▸ user
What's the weather in Lagos today?
▸ assistant
I'll look that up for you.
⬡ tool call get_weather
location "Lagos, NG"
units "celsius"
| Command | What it does |
|---|---|
playagent trace list |
Lists recent trace sessions. |
playagent trace view <trace_id> |
Shows turn-by-turn trace details. |
playagent report |
Shows aggregate pass/fail and failure breakdowns. |
playagent report --format json |
Emits report stats as JSON for CI pipelines. |
playagent --version |
Prints installed PlayAgent version. |
Why PlayAgent
- You stay local-first. PlayAgent writes to SQLite on your machine; nothing is sent to a hosted dashboard by default.
- You can test behavior, not only outputs. Assertions check tool-call order, parameters, and call counts directly.
- If you already use LangSmith, PlayAgent is a smaller option for local SDK-level checks; if you need hosted traces, collaboration, and observability dashboards, LangSmith is the better fit.
License
MIT
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
playagent-0.1.0.tar.gz
(30.6 kB
view details)
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
playagent-0.1.0-py3-none-any.whl
(24.7 kB
view details)
File details
Details for the file playagent-0.1.0.tar.gz.
File metadata
- Download URL: playagent-0.1.0.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fda7a0b59848a3d0c4753a693634eb54881978d608f352267b777a7965de6003
|
|
| MD5 |
42084722d1321e00b346bd83602f8435
|
|
| BLAKE2b-256 |
f346f3cd8fe570cb86a8df33ee84b2e4224a9691a81bf4fc28aec88061a06c1e
|
File details
Details for the file playagent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: playagent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91c528deb6f806e7f304961dae3a256af4c0ec2eff1b2a25de9ed5c478e8a7b3
|
|
| MD5 |
52df35dbb484cac1b7f2eb298a90eb13
|
|
| BLAKE2b-256 |
2efbe16dc136038af09f7a7037bdb984e69b59ec2023665ff61714a866e66cd8
|