Skip to main content

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

Support

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)

Source distribution for abetworks-agentwork 1.0.0
File Size Uploaded
abetworks_agentwork-1.0.0.tar.gz 10.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for abetworks-agentwork 1.0.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page