Skip to main content

TheProtocol SDK — Build and call A2A agents. Protocol bridges for ACP, ADK, and more.

Project description

theprotocol-sdk

Build and call A2A (Agent-to-Agent) agents on TheProtocol.

Install

pip install theprotocol-sdk           # Client only (call agents)
pip install theprotocol-sdk[server]   # + FastAPI router (build agents)
pip install theprotocol-sdk[all]      # Everything

Build an Agent (10 lines)

from theprotocol.agent import BaseA2AAgent, create_a2a_router
from theprotocol.models import Message, TextPart
from fastapi import FastAPI

class MyAgent(BaseA2AAgent):
    async def handle_task_send(self, task_id, message):
        return "task-1"  # Return task ID
    async def handle_task_get(self, task_id):
        ...  # Return Task object
    async def handle_task_cancel(self, task_id):
        return True
    async def handle_subscribe_request(self, task_id):
        yield  # SSE events

app = FastAPI()
app.include_router(create_a2a_router(MyAgent()))

Call a Remote Agent

from theprotocol.client import A2AClient, KeyManager
from theprotocol.models import Message, TextPart

async with A2AClient() as client:
    task_id = await client.initiate_task(agent_card, message, key_manager)
    task = await client.get_task_status(agent_card, task_id, key_manager)
    print(task.state)  # COMPLETED

Protocol Bridges (coming soon)

Translate between A2A and other agent protocols:

from theprotocol.bridges.acp import ACPBridge  # ACP ↔ A2A
from theprotocol.bridges.adk import ADKBridge  # Google ADK ↔ A2A

Registry Operations

For governance, staking, transfers, and discovery — use MCP tools instead of SDK functions. 19 tools available via Claude Desktop or any MCP client.

License

Apache-2.0

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

theprotocol_sdk-0.1.0.tar.gz (34.1 kB view details)

Uploaded Source

Built Distribution

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

theprotocol_sdk-0.1.0-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

Details for the file theprotocol_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: theprotocol_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 34.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for theprotocol_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6102cbad92fa1111109bff859b8f37fcd5803fa32db177520933f47421b309ed
MD5 f991f4a07f5c2f99fda8afd6ca34a4c0
BLAKE2b-256 8297b886dddd26026b28699ff9ce514feb7a69c286ad51156b9966cf3f54065f

See more details on using hashes here.

File details

Details for the file theprotocol_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for theprotocol_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31a68d5c19b77925b4e8463cc5793142ac4eb3a03a1706fd6e2a3a37aec85e83
MD5 1747a903a27651cf31f1a5a55e78264d
BLAKE2b-256 9ee25337aaea0be94f9638817bf23cf1d7f7bf340c6e6c584e859a61df678d37

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