Skip to main content

agent2agent-server

This repository is a wrapper for building google a2a servers, without explicitly copying the code to the native development codebase. This repository support - a2a server core, - a2a server utils, - a2a server types under the package called commons. Infact this package is direct lift and shift from google's repository.

How to install

clone this repository

  • option-1

    • git clone https://github.com/pavanjava/agent2agent-server.git
    • pip install -e .
  • option-2

    • pip install agent2agent-server from pypi.org

How to use this?

# --- Agent Card Definition ---
from common_server.types import AgentCapabilities, AgentSkill, AgentCard

SEARCH_AGENT_CARD = AgentCard(
    name="Search Agent",
    description="A simple Agno A2A agent that search internet for user messages.",
    url="http://localhost:8001/agno-a2a", # Where this server will run
    version="0.1.0",
    capabilities=AgentCapabilities(
        streaming=False, # This simple agent won't stream
        pushNotifications=False,
        stateTransitionHistory=False
    ),
    authentication=None, # No auth for this simple example
    defaultInputModes=["text"],
    defaultOutputModes=["text"],
    skills=[
        AgentSkill(
            id="search-agent",
            name="Search Message",
            description="Receives a text message and searches it in internet.",
            inputModes=["text"],
            outputModes=["text"]
        )
    ]
)
#--- agent_task_manager.py-----
import asyncio
from typing import Union, AsyncIterable
import logging

from common_server.server import TaskManager
from common_server.types import TaskResubscriptionRequest, SendTaskResponse, JSONRPCResponse, \
    GetTaskPushNotificationRequest, \
    GetTaskPushNotificationResponse, SetTaskPushNotificationRequest, SetTaskPushNotificationResponse, \
    SendTaskStreamingRequest, SendTaskStreamingResponse, SendTaskRequest, CancelTaskRequest, CancelTaskResponse, \
    GetTaskRequest, GetTaskResponse, Task, JSONRPCError, TextPart, TaskStatus, TaskState, Message

from search_agent import search_agent_team

# Configure basic logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)


class SearchAgentTaskManager(TaskManager):
    def __init__(self):
        pass

    async def on_get_task(self, request: GetTaskRequest) -> GetTaskResponse:
        pass

    async def on_cancel_task(self, request: CancelTaskRequest) -> CancelTaskResponse:
        pass

    async def on_send_task(self, request: SendTaskRequest) -> SendTaskResponse:
        # call your agent here.
        pass

    async def on_send_task_subscribe(self, request: SendTaskStreamingRequest) -> Union[
        AsyncIterable[SendTaskStreamingResponse], JSONRPCResponse]:
        pass

    async def on_set_task_push_notification(self,
                                            request: SetTaskPushNotificationRequest) -> SetTaskPushNotificationResponse:
        pass

    async def on_get_task_push_notification(self,
                                            request: GetTaskPushNotificationRequest) -> GetTaskPushNotificationResponse:
        pass

    async def on_resubscribe_to_task(self, request: TaskResubscriptionRequest) -> Union[
        AsyncIterable[SendTaskResponse], JSONRPCResponse]:
        pass
#---- agent_server.py-------
import logging

from common_server.server import A2AServer

from a2a_agent_cards import SEARCH_AGENT_CARD
from a2a_task_manager import SearchAgentTaskManager
from dotenv import load_dotenv, find_dotenv

load_dotenv(find_dotenv())

# Configure basic logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)


if __name__ == "__main__":
    task_manager = SearchAgentTaskManager()
    server = A2AServer(
        host="localhost",
        port=8001,
        endpoint="/search-a2a", # Matches AgentCard URL path
        agent_card=SEARCH_AGENT_CARD,
        task_manager=task_manager
    )
    print("Starting A2A Server on http://localhost:8001")
    # Use server.start() which calls uvicorn.run
    # Note: For production, use a proper ASGI server like uvicorn or hypercorn directly
    server.start()
    # Alternatively, run directly with uvicorn:
    # uvicorn.run(server.app, host="localhost", port=8001)

Metadata

Release files for agent2agent-server 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent2agent-server 0.0.7
File Size Uploaded Provenance
agent2agent_server-0.0.7.tar.gz 16.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agent2agent-server 0.0.7
File Interpreter ABI Platform
agent2agent_server-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 32.5 kB

Release files / agent2agent_server-0.0.7.tar.gz

Download URL agent2agent_server-0.0.7.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d5e62e83d746b024f89be4c7633d0d1848f8c3ac210955eeb3e36d07f45eaf0f
BLAKE2b-256 checksum
How to use checksums
6720e065911becd54d503a2de2a69fc88716c34ac72e19e3332d8ddb0ab8ee84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / agent2agent_server-0.0.7-py3-none-any.whl

Download URL agent2agent_server-0.0.7-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
773d235858f4bb4ff043b49135ff3deccf7988e5d2dc9893b008d3d87fecbb8f
BLAKE2b-256 checksum
How to use checksums
51f1184e5d43a4b120ed4be2b63df3a25c6db269f90f49f4ef1d3cbd2e288bbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for agent2agent-server 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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