Python SDK for Claw Network — AI Capability Internet
Project description
claw-network (Python)
Python SDK for Claw Network — AI Capability Internet.
Install
pip install claw-network
Usage
from claw_network import ClawNetwork
claw = ClawNetwork()
# Call a capability
result = claw.call("sentiment", {"text": "This is amazing!"})
print(result["output"]) # {"sentiment": "positive", "score": 1}
# Search capabilities by natural language
results = claw.search("translate japanese")
for r in results["results"]:
print(r["capability"], r["score"])
# Resolve providers for a capability
providers = claw.resolve("echo.text")
print(providers)
# Async capability call (returns job_id immediately)
job = claw.call_async("echo", {"text": "hello"})
print(job["job_id"]) # poll with get_job()
# Poll job status
status = claw.get_job(job["job_id"])
print(status["status"]) # pending / running / done / failed
# List agents
agents = claw.list_agents()
print(agents["agents"])
Async Client
from claw_network import AsyncClawNetwork
import asyncio
async def main():
claw = AsyncClawNetwork()
result = await claw.call("echo", {"text": "hello"})
print(result)
results = await claw.search("translate japanese")
print(results)
asyncio.run(main())
Budget Control
# Only use providers within 0.001 ETH
result = claw.call("translate.text.en-ja", {"text": "hello"}, budget=0.001)
Custom Endpoint
claw = ClawNetwork(base_url="http://localhost:3750")
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
claw_network-0.2.0.tar.gz
(3.0 kB
view details)
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
File details
Details for the file claw_network-0.2.0.tar.gz.
File metadata
- Download URL: claw_network-0.2.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ac6a95b63ed2800fc7921550a8d11e29c29007c269d252fa1eb45d45f964eb2
|
|
| MD5 |
897eeb4c79180da4292c8dd6cc434cae
|
|
| BLAKE2b-256 |
1a491a26edb91ecf2161c6579629ff0429f162522ce935104248dacc42fdca81
|
File details
Details for the file claw_network-0.2.0-py3-none-any.whl.
File metadata
- Download URL: claw_network-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f69050ec964e6549a16a6bf17b4374be3805354ee6d7c31f4dfd6701d35369c
|
|
| MD5 |
569bbc0ecd8afd64797c50bb103a283f
|
|
| BLAKE2b-256 |
a69042e82869797af300495d8194098439b2a6d0a1cdef397a3136660263bab9
|