Skip to main content

Typed Python client for the Coval evaluation platform API.

Project description

coval-sdk (Python)

Generated Python client for the Coval evaluation platform API. Built from the public OpenAPI specs via openapi-generator.

This package is currently demo-grade: it's the generated client without a hand-written ergonomic wrapper layer. The TypeScript SDK (@coval/sdk) ships with auth/retry/pagination helpers — those are still in flight on the Python side and will follow in a subsequent release.

Install

pip install coval-sdk

# For latest main before the next PyPI release:
# pip install "git+https://github.com/coval-ai/coval-examples.git#subdirectory=python-sdk"

# For local SDK development from the coval-examples repo:
# pip install -e ./python-sdk

Requires Python 3.9+.

Usage

import os
from coval_sdk import AgentsApi, ApiClient, Configuration

config = Configuration(host="https://api.coval.dev")
with ApiClient(config) as client:
    # Coval's gateway requires lowercase x-api-key. The bundled spec splits
    # the auth scheme per tag, so the cleanest pattern is to set the header
    # directly on the client:
    client.set_default_header("x-api-key", os.environ["COVAL_API_KEY"])

    agents_api = AgentsApi(client)
    page = agents_api.list_agents(page_size=50)
    for a in page.agents:
        print(a.id, a.display_name)

Run the example

COVAL_API_KEY=... python examples/list_agents.py
COVAL_API_KEY=... python examples/list_agents.py --raw   # bypass pydantic validation

Why --raw exists

The generated models enforce strict pydantic validation on responses (including regex patterns on IDs). If your org has any historical data that predates the current spec — for instance, an agent_id that doesn't match the ^[A-Za-z0-9]{22}$ regex — pydantic will raise a ValidationError mid-stream. The --raw flag falls back to list_agents_without_preload_content() which returns the raw HTTP response, so you can parse it manually.

For production use, prefer the typed call. If you hit ValidationErrors, file a docs/spec issue so we can either fix the data or relax the constraint.

What's in the box

  • 21 typed API classes (AgentsApi, ConversationsApi, MetricsApi, …)
  • Pydantic v2 models for every request and response shape
  • urllib3-based transport

Regenerating

From the repo root:

node scripts/bundle-spec.mjs
bash scripts/generate-sdks.sh

License

MIT.

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

coval_sdk-0.2.0.tar.gz (178.9 kB view details)

Uploaded Source

Built Distribution

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

coval_sdk-0.2.0-py3-none-any.whl (552.1 kB view details)

Uploaded Python 3

File details

Details for the file coval_sdk-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for coval_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0e2941872a8ec2752a960cb879ef5c03d5609bafe1d33cb65131f8b6b9e7c558
MD5 70505858db547a351cdc2c26d17ba021
BLAKE2b-256 87755abdbe8d3899a0150c6af65da5853d8dbb7d3b310151cbdd582066be50b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for coval_sdk-0.2.0.tar.gz:

Publisher: publish-coval-sdk.yml on coval-ai/coval-examples

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

File details

Details for the file coval_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: coval_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 552.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for coval_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60fea71a44da8ee8bcaf9439f8e6347e2b01376d249f545a4aab4d62e8d77812
MD5 1d2fc6c95a4be6cb302082b0336eaa48
BLAKE2b-256 0b690fa0417456d3273fcfc1bee926b4017600ef6347f8f9922dcd720fbfbfd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for coval_sdk-0.2.0-py3-none-any.whl:

Publisher: publish-coval-sdk.yml on coval-ai/coval-examples

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