Skip to main content

Python SDK for the Durable Agents public API.

Project description

Durable Agents Python SDK

First-party Python SDK for the Durable Agents public API.

Install

pip install durable-agents-sdk

Quickstart

import os

from durable_agents import DurableClient

client = DurableClient(api_key=os.environ["DURABLE_API_KEY"])
models = client.models.list()
print(models)
client.close()

Agents And Runs

agent = client.agents.create({
    "name": "SDK smoke agent",
})

run = client.agents.prompt(agent["id"], {
    "prompt": "Reply with READY only.",
})

Stream run events:

for event in client.runs.watch(run["id"]):
    print(event.event, event.data)

Data Sources

sources = client.sources.list(limit=50)
print(sources)

Pagination

for agent in client.agents.iterate(limit=100):
    print(agent)

Errors

from durable_agents import DurableApiError

try:
    client.models.list()
except DurableApiError as error:
    print(error.status_code, error.code, error.request_id, error.details)
    raise

Generated Client

The public compatibility surface is DurableClient. Kiota-generated low-level code is also available under durable_agents.generated for advanced users, but it is not the primary ergonomic API.

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

durable_agents_sdk-1.0.20260616006.tar.gz (78.6 kB view details)

Uploaded Source

Built Distribution

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

durable_agents_sdk-1.0.20260616006-py3-none-any.whl (304.9 kB view details)

Uploaded Python 3

File details

Details for the file durable_agents_sdk-1.0.20260616006.tar.gz.

File metadata

File hashes

Hashes for durable_agents_sdk-1.0.20260616006.tar.gz
Algorithm Hash digest
SHA256 48843c1c180848d143b9bd4c357d56cfb5a737f7680e795a0c480a629417a6fc
MD5 aa7c938baf67b352baf4f1f52c60d2c9
BLAKE2b-256 d6250cc47a97f1b94b360c72b8d96b15af63e9e180c093d318aa5f7d7f8721fd

See more details on using hashes here.

File details

Details for the file durable_agents_sdk-1.0.20260616006-py3-none-any.whl.

File metadata

File hashes

Hashes for durable_agents_sdk-1.0.20260616006-py3-none-any.whl
Algorithm Hash digest
SHA256 a937f09c7918cca195e168488906b018fd091b4fb1098d8a63e86d564635e611
MD5 dc7b0b17db3b03c6703566ce61831d5e
BLAKE2b-256 cd4117928321689afa90f0cc4a4bac8d3ac863588e10d35307a57204e3c75157

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