Skip to main content

wovyr-sdk

A Python client for the Wovyr AI Platform HTTP API, hand-written from the actual wovyr-server routes (see docs/09-api/openapi.yaml for the full contract) — the same source sdks/typescript was generated from, so the two clients cover identical ground.

Zero runtime dependencies: the HTTP layer is built on urllib from the standard library rather than requests/httpx, so there's nothing to install to use it.

Install

Published as wovyr-sdk on PyPI:

pip install wovyr-sdk

Usage

from wovyr_sdk import WovyrClient

client = WovyrClient(
    "http://127.0.0.1:8080",
    tenant="acme",       # optional, defaults to the server's "default" tenant
    principal="alice",   # optional
)

result = client.agents.run({"manifest": my_agent_yaml, "input": {"message": "Hi"}})
print(result["output"]["message"])

# Streaming:
for frame in client.agents.stream({"manifest": my_agent_yaml, "input": {}}):
    if frame["type"] == "delta":
        print(frame["text"], end="")
    if frame["type"] == "result":
        print("\ndone:", frame["output"]["message"])

Every resource is namespaced on the client: client.agents, client.workflows, client.memory, client.plugins, client.marketplace, client.secrets, client.organizations, client.projects, client.webhooks, client.audit, client.tools.

Errors are raised as WovyrApiError (.status, .code, .request_id, .body) mapping the server's {error: {...}} envelope.

Pagination: every list method returns a Page dict (data/has_more/ next_cursor/total_estimate); paginate_all drains every page:

from wovyr_sdk import paginate_all

for agent_id in paginate_all(client.agents.list, limit=25):
    ...

Development

No package manager is required to run this SDK — it's stdlib-only. To run the tests:

cargo run -p wovyr-cli -- dev --addr 127.0.0.1:8080 &
python3 -m unittest discover -s tests -v

Tests are integration tests against a real, locally running server (skip cleanly, not failing, if WOVYR_TEST_BASE_URL — default http://127.0.0.1:8080 — is unreachable), plus a handful of unit tests for the retry/backoff logic against a fake opener (no socket).

One test (test_projects_create_with_stale_if_match_is_rejected) exercises organization/project creation, which — unlike agents/workflows/memory — has no anonymous-default-tenant back-compat bypass; it needs a real org.admin role. Start the server with WOVYR_PLATFORM_ADMINS=sdk-test-admin for that test to run instead of skip.

Asyncio

For asyncio programs, wovyr_sdk.aio.AsyncWovyrClient exposes the same resource surface with every method awaitable (the sync transport runs in a worker thread, so the event loop never blocks; streaming yields frames as they arrive):

from wovyr_sdk.aio import AsyncWovyrClient

client = AsyncWovyrClient("http://127.0.0.1:8080")
result = await client.agents.run({"manifest": my_agent_yaml, "input": {"message": "Hi"}})
final = await client.workflows.wait_for_completion(execution_id)
async for frame in client.agents.stream({"manifest": my_agent_yaml}):
    ...

Retries, polling, versions

  • GET requests retry transient failures (429/502/503/504, network errors) with exponential backoff — configurable via retry=RetryOptions(...).
  • Mutations retry only when keyed: pass idempotency_key= and the same retry policy applies — the server's replay middleware makes it safe. A keyless mutation never auto-retries (it could double-execute).
  • client.workflows.wait_for_completion(execution_id) polls to a terminal status and returns the final snapshot (WovyrTimeoutError on deadline) — no more hand-rolled poll loops.
  • Versioning: the SDK version tracks the platform release it targets (same major.minor = same API surface; see CHANGELOG.md). health() emits an WovyrVersionSkewWarning once per client if the server's major.minor differs.

Known gaps

  • No redocly-style contract test wired against openapi.yaml (the TypeScript SDK's npm test runs one; this package has no npm-equivalent tool available in this environment to wire the same check to).

Download files

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

Source Distribution

wovyr_sdk-0.4.1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

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

wovyr_sdk-0.4.1-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file wovyr_sdk-0.4.1.tar.gz.

File metadata

  • Download URL: wovyr_sdk-0.4.1.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for wovyr_sdk-0.4.1.tar.gz
Algorithm Hash digest
SHA256 5d2ac0ffb3de9901ed8b625896e69d134428729447771fc4271a1214c90bdaa4
MD5 5e8ddf9dd821e59428263537e086724a
BLAKE2b-256 0d49a4eb4321db3145b884a37409cd5f741a5697eebdb6b274e8c64989921959

See more details on using hashes here.

File details

Details for the file wovyr_sdk-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: wovyr_sdk-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for wovyr_sdk-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f763013adc0e1e4d2327f7a6042de6c4d63293807d7b4b83e8dcaa8710e2d3f6
MD5 f03aa607c69f860d6f7a9c0c9d3e5d1a
BLAKE2b-256 323ecc1dc21a0c32f47c4ac32e9adf15a266bc8cbf42f5277a43fd6eeb57602a

See more details on using hashes here.

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