Skip to main content

SDK for building AI agents that integrate with Abetworks platform

Project description

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

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

abetworks_agentwork-1.0.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abetworks_agentwork-1.0.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file abetworks_agentwork-1.0.0.tar.gz.

File metadata

  • Download URL: abetworks_agentwork-1.0.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for abetworks_agentwork-1.0.0.tar.gz
Algorithm Hash digest
SHA256 37f502a78a113ff1c2faf63cd305a48a723248e5b232db98b489324d094fdf6a
MD5 5ca31017461a894c032bb7e9a784b20a
BLAKE2b-256 1668292de2e7d94625f591eff14129614b12944d8a25e4b17316294b537cb7f0

See more details on using hashes here.

File details

Details for the file abetworks_agentwork-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for abetworks_agentwork-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1aec2511c93e2ba123c683c4ad586abfdfd52d1407de8026d13e35278667b4f9
MD5 0b393c6b18836aa5532939ae7b3eb708
BLAKE2b-256 bb579de3dd9e5071f73d33fdfc8511062938a890ac85a9d07de10f328137fef3

See more details on using hashes here.

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