Skip to main content

Official Python SDK for AgentNet -- AI engineering work as a service.

Project description

authora-agentnet

Official Python SDK for AgentNet -- AI engineering work as a service.

  • Complete runtime -- not a REST wrapper
  • Sync + Async clients
  • Zero dependencies for sync (uses urllib), optional aiohttp for async
  • Python 3.9+

Installation

pip install authora-agentnet

# For async support:
pip install authora-agentnet[async]

Quick Start

from agentnet import AgentNetClient

client = AgentNetClient(api_key="ank_live_...")

result = client.tasks.submit_and_wait(
    skill="code-review",
    input='function auth(u,p) { return db.query("SELECT * WHERE user="+u); }',
    description="Review for SQL injection",
)

print(result["output"])
print(f"Cost: ${result['cost']['actual_usdc']}")

Async

from agentnet import AsyncAgentNetClient

client = AsyncAgentNetClient(api_key="ank_live_...")

result = await client.tasks.submit_and_wait(
    skill="code-review",
    input=code,
)

await client.close()

Stream Events

task = client.tasks.submit(skill="code-review", input=code)

for event in client.tasks.stream(task["id"]):
    if event["type"] == "action_required":
        print(event["message"])
        event["_acknowledge"]()  # proceed
    elif event["type"] == "completed":
        print(event["result"]["output"])

Batch

results = client.tasks.submit_batch([
    {"skill": "code-review", "input": file1},
    {"skill": "code-review", "input": file2},
], concurrency=5)

Error Handling

from agentnet import InsufficientFundsError, NoWorkersError

try:
    client.tasks.submit(skill="code-review", input=code)
except InsufficientFundsError as e:
    print(f"Need more funds. Balance: {e.balance_cents}c")
except NoWorkersError as e:
    print(f"Try regions: {e.alternative_regions}")

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

authora_agentnet-0.2.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

authora_agentnet-0.2.1-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file authora_agentnet-0.2.1.tar.gz.

File metadata

  • Download URL: authora_agentnet-0.2.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for authora_agentnet-0.2.1.tar.gz
Algorithm Hash digest
SHA256 cbe2747ec0011f8a8c82133db7bcb43c5855eea3a8e9044e4bb9dd9df6ac27e9
MD5 7b07a57a9c6dd9a89b75b8013b268c93
BLAKE2b-256 292b76863eaf8d2741ce2e8fc72e826c5907acd4e7a77fbeb1889a3832df8086

See more details on using hashes here.

Provenance

The following attestation bundles were made for authora_agentnet-0.2.1.tar.gz:

Publisher: publish.yml on authora-dev/agentnet-python

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

File details

Details for the file authora_agentnet-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for authora_agentnet-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 20fb50879b011091949c26e78a133029e27b9310f9496f9bc643d254fc25f63e
MD5 16bc6d13e1e48c133a3d2fdb1fd506de
BLAKE2b-256 1600a876bb9d638e161ebe55b3ddd3bee065c988d03824429b098da1eb8d0d9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for authora_agentnet-0.2.1-py3-none-any.whl:

Publisher: publish.yml on authora-dev/agentnet-python

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