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.1.6.tar.gz (7.0 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.1.6-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: authora_agentnet-0.1.6.tar.gz
  • Upload date:
  • Size: 7.0 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.1.6.tar.gz
Algorithm Hash digest
SHA256 3491e6a45ce47ae00ad65f91ea047c2899c067e7d86b223657b8299b61588048
MD5 ae74da075b27b1682c288228d56922fa
BLAKE2b-256 ce124835aafd64e3d8acd4a2cd3ab894d293f9edcbf150e13a0f37d435bd3306

See more details on using hashes here.

Provenance

The following attestation bundles were made for authora_agentnet-0.1.6.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.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for authora_agentnet-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5daa648017b3444b9c426e54b47dd5a0a870a08b8fbc01a1a7ae759dac1ecdeb
MD5 f866d0d9607e3e7e64e3ba09b4201733
BLAKE2b-256 104028d3324eee4102f633dfef2abeb1d2190b518bdd15a63a3e055db0d65249

See more details on using hashes here.

Provenance

The following attestation bundles were made for authora_agentnet-0.1.6-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