Python SDK for the Synthia API
Project description
synthiaresearch
Synthia evals your AI agent against simulated users: probe it to infer who it's for, generate a synthetic scenario dataset, play the scenarios against it, and judge every rollout — locally from this SDK, or as a CI gate on every pull request.
pip install synthiaresearch # Python ≥ 3.10; the import name is `synthia`
Quickstart
from synthia import Synthia
client = Synthia() # reads SYNTHIA_API_KEY / SYNTHIA_BASE_URL
# One call: probe + generate (or reuse this script's dataset), play every
# scenario against your agent, judge the rollouts server-side.
def rollout_agent(transcript, sandbox):
return my_agent.respond_with_tools(transcript, sandbox)
outcome = client.run(rollout_agent, agent_meta={"name": "my-agent"})
print(outcome.pass_rate, outcome.evaluations)
Each step — prepare(), rollouts.run(), rollouts.quality_check() — is
also available
individually
when you need to intervene between them.
In CI
The package ships the synthia CLI (also python -m synthia): point a
synthia.yaml at a module exporting agent(transcript, sandbox) -> reply
and gate PRs on the pass rate —
synthia validate # check config + entrypoint, no network
synthia run # play the suite, judge it, gate on thresholds
— or use the GitHub Action
with language: python. Setup guide:
Synthia in CI.
Documentation
- Python API reference
— every method, plus the deliberate divergences from the JS SDK (no
ready();wait(**kwargs); rollouts run on a thread pool, so your agent callable must be thread-safe). - CLI reference · synthia.yaml · environment & sessions
- Runnable examples: examples/
Mirrors the JS/TypeScript SDK
(synthiaresearch on npm) — same API surface, same CLI, same yaml,
byte-identical results-JSON contract. Replies and tool events are
redacted by default
before upload. MIT licensed.
Development
src/synthia/client.py— the SDK: theSynthiaclient, resource classes, and the local probe/rollout loops with tool-call tracing.src/synthia/cli/— thesynthiaCLI, a module-for-module mirror of the JS CLI (same schema, same exit codes, same report contract).pyproject.toml— thesynthiaresearchpackage definition (httpxandpyyamlas the only runtime dependencies; the import name stayssynthia).
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 synthiaresearch-0.1.0.tar.gz.
File metadata
- Download URL: synthiaresearch-0.1.0.tar.gz
- Upload date:
- Size: 39.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58b383490f4683e33b0d8402461ec3db0deed86e32e288ab45e824f9d2bd2799
|
|
| MD5 |
d74d7c6034d5a7fc6d238a07b029a9d0
|
|
| BLAKE2b-256 |
54ccb08923ec44b5719d9f09b00a78e84468a16cae5ad94f31775d74544428ff
|
Provenance
The following attestation bundles were made for synthiaresearch-0.1.0.tar.gz:
Publisher:
release.yml on SynthiaResearch/synthia-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synthiaresearch-0.1.0.tar.gz -
Subject digest:
58b383490f4683e33b0d8402461ec3db0deed86e32e288ab45e824f9d2bd2799 - Sigstore transparency entry: 2193337576
- Sigstore integration time:
-
Permalink:
SynthiaResearch/synthia-sdk@575fb5fa6a847244dd8542b61d6813ae039e22d0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SynthiaResearch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@575fb5fa6a847244dd8542b61d6813ae039e22d0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file synthiaresearch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: synthiaresearch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 36.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 |
cad2ae7b250f55b8692b07c7eae997031141e9595c4ada645df0dc606ea452c6
|
|
| MD5 |
4fbbb8b15e64e00c0e7fd277f592076d
|
|
| BLAKE2b-256 |
52664cc499bf8eec4c5506d9f212cca357cdda977af3b92abaf0c5714d396365
|
Provenance
The following attestation bundles were made for synthiaresearch-0.1.0-py3-none-any.whl:
Publisher:
release.yml on SynthiaResearch/synthia-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synthiaresearch-0.1.0-py3-none-any.whl -
Subject digest:
cad2ae7b250f55b8692b07c7eae997031141e9595c4ada645df0dc606ea452c6 - Sigstore transparency entry: 2193337578
- Sigstore integration time:
-
Permalink:
SynthiaResearch/synthia-sdk@575fb5fa6a847244dd8542b61d6813ae039e22d0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SynthiaResearch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@575fb5fa6a847244dd8542b61d6813ae039e22d0 -
Trigger Event:
push
-
Statement type: