Skip to main content

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

# Probe + generate only when needed; re-runs reuse this script's dataset.
prepared = client.prepare(lambda probe: my_agent.respond(probe))

# Play the scenarios against your agent; tools run in a deterministic sandbox.
def rollout_agent(transcript, sandbox):
    return my_agent.respond_with_tools(transcript, sandbox)

results = client.rollouts.run(rollout_agent, prepared.dataset,
                              agent_meta={"name": "my-agent"})

# Judge every rollout server-side.
check = client.rollouts.quality_check(results)
check.wait(verbose=True)
print(check.rollouts())

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

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: the Synthia client, resource classes, and the local probe/rollout loops with tool-call tracing.
  • src/synthia/cli/ — the synthia CLI, a module-for-module mirror of the JS CLI (same schema, same exit codes, same report contract).
  • pyproject.toml — the synthiaresearch package definition (httpx and pyyaml as the only runtime dependencies; the import name stays synthia).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synthiaresearch-0.0.10.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synthiaresearch-0.0.10-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file synthiaresearch-0.0.10.tar.gz.

File metadata

  • Download URL: synthiaresearch-0.0.10.tar.gz
  • Upload date:
  • Size: 36.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for synthiaresearch-0.0.10.tar.gz
Algorithm Hash digest
SHA256 55d5e65afbaea2c5ce5b22d2ae8ea476d60cb88cff4c33992afbf84e6d246f5d
MD5 48e4051ef6404477006715646cd51c70
BLAKE2b-256 38d6c8209c139ab1c62a629010dc355737a8d97d32dccdcd4f0e933fe1e3f993

See more details on using hashes here.

Provenance

The following attestation bundles were made for synthiaresearch-0.0.10.tar.gz:

Publisher: release.yml on SynthiaResearch/synthia-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file synthiaresearch-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for synthiaresearch-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 7836d4ab1fc3fc8a2a29eec172219d1cbc54969c135f9ed2d003ebfa058e1493
MD5 333f5ecb4fb00a75f328fe8e8e3a88b4
BLAKE2b-256 686ccb783e4c57ebacc33322f4f9c07ad84fcf203b7f18a6724e88c88de606df

See more details on using hashes here.

Provenance

The following attestation bundles were made for synthiaresearch-0.0.10-py3-none-any.whl:

Publisher: release.yml on SynthiaResearch/synthia-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page