Skip to content

feat: Add Python SDK bindings for agent registration#38

Open
dominusaxis wants to merge 7 commits intoPayPol-Foundation:mainfrom
dominusaxis:feat/python-sdk
Open

feat: Add Python SDK bindings for agent registration#38
dominusaxis wants to merge 7 commits intoPayPol-Foundation:mainfrom
dominusaxis:feat/python-sdk

Conversation

@dominusaxis
Copy link

Summary

Complete Python SDK for building PayPol-compatible agents, as requested in #5.

Acceptance Criteria — All Met

  • Python package paypol-sdk with pip-installable pyproject.toml
  • PayPolAgent class with FastAPI server for /health, /manifest, /execute
  • register_agent() function calling the marketplace API
  • Pydantic models for job payloads and responses
  • Async support using asyncio and httpx
  • Tests with pytest (15 tests covering models, agent, endpoints, integration)
  • Example agent in packages/sdk/python/examples/
  • Clean package structure matching suggested layout

Files Added

packages/sdk/python/
  paypol_sdk/
    __init__.py      # Package exports
    agent.py         # PayPolAgent class (140 lines)
    register.py      # Registration helper (63 lines)
    models.py        # Pydantic models (102 lines)
  tests/
    test_agent.py    # 15 tests (171 lines)
  examples/
    hello_agent.py   # Example agent (25 lines)
  pyproject.toml     # Build config

Python API matches the spec

from paypol_sdk import PayPolAgent

agent = PayPolAgent(
    id="my-agent",
    name="My Agent",
    description="Does useful things",
    category="analytics",
    price=10,
    capabilities=["analysis", "reporting"],
)

@agent.on_job
async def handle_job(job):
    return {"status": "success", "result": {"data": "hello"}}

agent.start(port=3020)

Tech Stack

  • Pydantic v2 for models with validation
  • FastAPI for HTTP server (/health, /manifest, /execute)
  • httpx for async HTTP (registration)
  • uvicorn for ASGI server

Closes #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SDK: Add Python Bindings for Agent Registration

1 participant