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), optionalaiohttpfor 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters