Abetworks AgentWork SDK
Build AI agents for the Abetworks platform with Python. This SDK provides everything you need to create Flask or FastAPI agents that integrate seamlessly with Abetworks.
Installation
# Basic installation
pip install abetworks-agentwork
# With Flask support
pip install abetworks-agentwork[flask]
# With FastAPI support
pip install abetworks-agentwork[fastapi]
# With all frameworks
pip install abetworks-agentwork[all]
Quick Start
Flask Agent
from abetworks_agentwork import FlaskAgent, AgentResponse
from flask import Flask
app = Flask(__name__)
agent = FlaskAgent(
agent_id="my-custom-agent",
name="My Custom Agent",
api_key="your-abetworks-api-key"
)
@agent.task("process_data")
def process_data(input_data, org_id, task_id):
# Your agent logic here
result = {"processed": input_data.get("text", "").upper()}
return AgentResponse(
status="success",
output=result,
metadata={"chars_processed": len(input_data.get("text", ""))}
)
# Register routes with Flask
agent.register_routes(app)
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8000)
FastAPI Agent
from abetworks_agentwork import FastAPIAgent, AgentResponse
from fastapi import FastAPI
app = FastAPI()
agent = FastAPIAgent(
agent_id="my-custom-agent",
name="My Custom Agent",
api_key="your-abetworks-api-key"
)
@agent.task("analyze_sentiment")
async def analyze_sentiment(input_data, org_id, task_id):
text = input_data.get("text", "")
# Your NLP logic here
sentiment = "positive" if "good" in text.lower() else "neutral"
return AgentResponse(
status="success",
output={"sentiment": sentiment, "text": text},
metadata={"confidence": 0.95}
)
# Register routes with FastAPI
agent.register_routes(app)
Features
- 🔐 Built-in Authentication: Secure API key validation
- 🏢 Multi-tenant Support: Automatic org_id isolation
- ⚡ Framework Flexibility: Works with Flask or FastAPI
- 📝 Type Safety: Pydantic models for data validation
- 🔄 Auto Registration: Register your agent with Abetworks platform
- 📊 Error Handling: Standardized error responses
- 🧪 Testing Utilities: Built-in test helpers
Agent Registration
Register your agent with the Abetworks platform:
agent.register_with_platform(
abetworks_url="https://your-abetworks-instance.com",
description="Analyzes sentiment in customer feedback",
category="analytics",
icon="💬",
price=0
)
Documentation
- Full Documentation: https://docs.abetworks.in
- GitHub Repository: https://github.com/abetworks/abetworks-agentwork
- Website: https://abetworks.in
Support
- Email: contact@abetworks.in
- Issues: GitHub Issues
License
MIT License - see LICENSE file for details
Release files for abetworks-agentwork 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| abetworks_agentwork-1.0.0.tar.gz | 10.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| abetworks_agentwork-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.9 kB
Release files / abetworks_agentwork-1.0.0.tar.gz
| Download URL | abetworks_agentwork-1.0.0.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37f502a78a113ff1c2faf63cd305a48a723248e5b232db98b489324d094fdf6a
|
|
BLAKE2b-256 checksum How to use checksums |
1668292de2e7d94625f591eff14129614b12944d8a25e4b17316294b537cb7f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / abetworks_agentwork-1.0.0-py3-none-any.whl
| Download URL | abetworks_agentwork-1.0.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1aec2511c93e2ba123c683c4ad586abfdfd52d1407de8026d13e35278667b4f9
|
|
BLAKE2b-256 checksum How to use checksums |
bb579de3dd9e5071f73d33fdfc8511062938a890ac85a9d07de10f328137fef3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|