distributed-a2a 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ include README.md
2
+ include LICENSE
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.4
2
+ Name: distributed_a2a
3
+ Version: 0.1.1
4
+ Summary: A library for building A2A agents with routing capabilities
5
+ Home-page: https://github.com/Barra-Technologies/distributed-a2a
6
+ Author: Fabian Bell
7
+ Author-email: Fabian Bell <fabian.bell@barrabytes.com>
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/Barra-Technologies/distributed-a2a
10
+ Project-URL: Repository, https://github.com/Barra-Technologies/distributed-a2a
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: langchain>=0.1.0
23
+ Requires-Dist: langchain-core>=0.1.0
24
+ Requires-Dist: langchain-openai>=0.0.5
25
+ Requires-Dist: langgraph>=0.0.20
26
+ Requires-Dist: pydantic>=2.0.0
27
+ Requires-Dist: boto3>=1.28.0
28
+ Requires-Dist: a2a>=0.1.0
29
+ Dynamic: author
30
+ Dynamic: home-page
31
+ Dynamic: license-file
32
+ Dynamic: requires-python
33
+
34
+ # A2A Agent Library
35
+
36
+ A Python library for building A2A (Agent-to-Agent) agents with routing capabilities, DynamoDB-backed registry, and LangChain integration.
37
+
38
+ ## Features
39
+
40
+ - **StatusAgent**: Base agent implementation with status tracking and structured responses
41
+ - **RoutingAgentExecutor**: Agent executor with intelligent routing capabilities
42
+ - **DynamoDB Registry**: Dynamic agent card registry with heartbeat mechanism
43
+ - **Server Utilities**: FastAPI application builder with A2A protocol support
44
+ - **LangChain Integration**: Built on LangChain for flexible model integration
45
+
46
+ ## Installation
47
+
48
+ ```bash
49
+ pip install distributed-a2a
50
+ ```
51
+
52
+ ## Quick Start
53
+
54
+ ```python
55
+ from distributed_a2a import load_app
56
+ from a2a.types import AgentSkill
57
+
58
+ # Define your agent's skills
59
+ skills = [
60
+ AgentSkill(
61
+ id='example_skill',
62
+ name='Example Skill',
63
+ description='An example skill',
64
+ tags=['example']
65
+ )
66
+ ]
67
+
68
+ # Create your agent application
69
+ app = load_app(
70
+ name="MyAgent",
71
+ description="My specialized agent",
72
+ skills=skills,
73
+ api_key="your-api-key",
74
+ system_prompt="You are a helpful assistant...",
75
+ host="http://localhost:8000"
76
+ )
77
+ ```
78
+
79
+ ## Components
80
+
81
+ ### StatusAgent
82
+
83
+ A base agent class that provides status tracking and structured responses:
84
+
85
+ ```python
86
+ from distributed_a2a import StatusAgent, StringResponse
87
+
88
+ agent = StatusAgent[StringResponse](
89
+ system_prompt="Your system prompt",
90
+ name="AgentName",
91
+ api_key="your-api-key",
92
+ is_routing=False,
93
+ tools=[]
94
+ )
95
+
96
+ response = await agent("User message", context_id="context-123")
97
+ ```
98
+
99
+ ### RoutingAgentExecutor
100
+
101
+ An executor that can handle requests directly or route them to specialized agents:
102
+
103
+ ```python
104
+ from distributed_a2a import RoutingAgentExecutor
105
+
106
+ executor = RoutingAgentExecutor(
107
+ api_key="your-api-key",
108
+ system_prompt="Your system prompt",
109
+ routing_tool=routing_tool
110
+ )
111
+ ```
112
+
113
+ ### DynamoDB Registry
114
+
115
+ Dynamic agent registry with automatic heartbeat and expiration:
116
+
117
+ ```python
118
+ from distributed_a2a import DynamoDbRegistryLookup
119
+
120
+ registry = DynamoDbRegistryLookup(agent_card_tabel="agent-cards")
121
+ tool = registry.as_tool()
122
+ ```
123
+
124
+ ## Requirements
125
+
126
+ - Python 3.10+
127
+ - langchain
128
+ - langchain-core
129
+ - langchain-openai
130
+ - langgraph
131
+ - pydantic
132
+ - boto3
133
+ - a2a
134
+
135
+ ## License
136
+
137
+ MIT
138
+
139
+ ## Contributing
140
+
141
+ Contributions are welcome! Please feel free to submit a Pull Request.
@@ -0,0 +1,108 @@
1
+ # A2A Agent Library
2
+
3
+ A Python library for building A2A (Agent-to-Agent) agents with routing capabilities, DynamoDB-backed registry, and LangChain integration.
4
+
5
+ ## Features
6
+
7
+ - **StatusAgent**: Base agent implementation with status tracking and structured responses
8
+ - **RoutingAgentExecutor**: Agent executor with intelligent routing capabilities
9
+ - **DynamoDB Registry**: Dynamic agent card registry with heartbeat mechanism
10
+ - **Server Utilities**: FastAPI application builder with A2A protocol support
11
+ - **LangChain Integration**: Built on LangChain for flexible model integration
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ pip install distributed-a2a
17
+ ```
18
+
19
+ ## Quick Start
20
+
21
+ ```python
22
+ from distributed_a2a import load_app
23
+ from a2a.types import AgentSkill
24
+
25
+ # Define your agent's skills
26
+ skills = [
27
+ AgentSkill(
28
+ id='example_skill',
29
+ name='Example Skill',
30
+ description='An example skill',
31
+ tags=['example']
32
+ )
33
+ ]
34
+
35
+ # Create your agent application
36
+ app = load_app(
37
+ name="MyAgent",
38
+ description="My specialized agent",
39
+ skills=skills,
40
+ api_key="your-api-key",
41
+ system_prompt="You are a helpful assistant...",
42
+ host="http://localhost:8000"
43
+ )
44
+ ```
45
+
46
+ ## Components
47
+
48
+ ### StatusAgent
49
+
50
+ A base agent class that provides status tracking and structured responses:
51
+
52
+ ```python
53
+ from distributed_a2a import StatusAgent, StringResponse
54
+
55
+ agent = StatusAgent[StringResponse](
56
+ system_prompt="Your system prompt",
57
+ name="AgentName",
58
+ api_key="your-api-key",
59
+ is_routing=False,
60
+ tools=[]
61
+ )
62
+
63
+ response = await agent("User message", context_id="context-123")
64
+ ```
65
+
66
+ ### RoutingAgentExecutor
67
+
68
+ An executor that can handle requests directly or route them to specialized agents:
69
+
70
+ ```python
71
+ from distributed_a2a import RoutingAgentExecutor
72
+
73
+ executor = RoutingAgentExecutor(
74
+ api_key="your-api-key",
75
+ system_prompt="Your system prompt",
76
+ routing_tool=routing_tool
77
+ )
78
+ ```
79
+
80
+ ### DynamoDB Registry
81
+
82
+ Dynamic agent registry with automatic heartbeat and expiration:
83
+
84
+ ```python
85
+ from distributed_a2a import DynamoDbRegistryLookup
86
+
87
+ registry = DynamoDbRegistryLookup(agent_card_tabel="agent-cards")
88
+ tool = registry.as_tool()
89
+ ```
90
+
91
+ ## Requirements
92
+
93
+ - Python 3.10+
94
+ - langchain
95
+ - langchain-core
96
+ - langchain-openai
97
+ - langgraph
98
+ - pydantic
99
+ - boto3
100
+ - a2a
101
+
102
+ ## License
103
+
104
+ MIT
105
+
106
+ ## Contributing
107
+
108
+ Contributions are welcome! Please feel free to submit a Pull Request.
@@ -0,0 +1,5 @@
1
+ from .server import load_app
2
+
3
+ __all__ = [
4
+ "load_app"
5
+ ]
@@ -0,0 +1,58 @@
1
+ from typing import Literal
2
+
3
+ from a2a.types import TaskState
4
+ from langchain.agents import create_agent
5
+ from langchain_core.runnables import RunnableConfig
6
+ from langchain_core.tools import BaseTool
7
+ from langgraph.checkpoint.memory import MemorySaver
8
+ from pydantic import BaseModel, Field
9
+
10
+ from .model import get_model
11
+
12
+
13
+ class AgentResponse(BaseModel):
14
+ status: Literal[TaskState.rejected, TaskState.completed, TaskState.rejected, TaskState.failed] = Field(
15
+ description=(
16
+ f'You should select status as {TaskState.rejected} for requests that fall outside your area of expertise.'
17
+ f'You should select status as {TaskState.completed} if the request is fully addressed and no further input is needed. '
18
+ f'You should select status as {TaskState.input_required} if you need more information from the user or are asking a clarifying question. '
19
+ f'You should select status as {TaskState.failed} if an error occurred or the request cannot be fulfilled.'
20
+ )
21
+ )
22
+
23
+ class RoutingResponse(AgentResponse):
24
+ agent_card: str = Field(description="The stringified json of the agent card to be returned to the user")
25
+
26
+ class StringResponse(AgentResponse):
27
+ response: str = Field(description="The main response to be returned to the user")
28
+
29
+
30
+ class StatusAgent[ResponseT: AgentResponse]:
31
+
32
+ def __init__(self, system_prompt: str, name: str, api_key: str, is_routing: bool, tools: list[BaseTool]):
33
+ response_format: type[AgentResponse]
34
+ if is_routing:
35
+ response_format = RoutingResponse
36
+ else:
37
+ response_format = StringResponse
38
+
39
+ self.agent = create_agent(
40
+ get_model(api_key),
41
+ tools=tools,
42
+ checkpointer=MemorySaver(), # TODO replace by dynamodb
43
+ system_prompt=system_prompt,
44
+ response_format=response_format,
45
+ name=name
46
+ )
47
+
48
+ async def __call__(self, message: str, context_id: str = None) -> ResponseT:
49
+ config: RunnableConfig = RunnableConfig(configurable={'thread_id': context_id})
50
+ response = await self.agent.ainvoke(LangGraphMessage(message), config)
51
+ return response['structured_response']
52
+
53
+
54
+ class LangGraphMessage(BaseModel):
55
+ messages: list[tuple[Literal['user'], str]]
56
+
57
+ def __init__(self, messages: str):
58
+ super().__init__(messages=[("user", messages)])
@@ -0,0 +1,77 @@
1
+ import json
2
+ import logging
3
+
4
+ from a2a.server.agent_execution import AgentExecutor, RequestContext
5
+ from a2a.server.events import EventQueue
6
+ from a2a.types import TaskStatusUpdateEvent, TaskStatus, TaskState, TaskArtifactUpdateEvent, Artifact
7
+ from a2a.utils import new_text_artifact
8
+ from langchain_core.tools import BaseTool
9
+
10
+ from .agent import StatusAgent, RoutingResponse, StringResponse
11
+
12
+ logger = logging.getLogger(__name__)
13
+
14
+ ROUTING_SYSTEM_PROMPT = """
15
+ You are a helpful routing assistant which routes user requests to specialized remote agents. Your main task is to:
16
+ 1. look up available agents via their A2A agent cards
17
+ 2. select the best matching agent for the user query
18
+ 3. return the matching agent card for that agent."""
19
+
20
+
21
+ class RoutingAgentExecutor(AgentExecutor):
22
+
23
+ def __init__(self, api_key: str, system_prompt: str, routing_tool: BaseTool, tools: list[BaseTool] | None = None):
24
+ super().__init__()
25
+ self.agent = StatusAgent[StringResponse](
26
+ system_prompt=system_prompt,
27
+ name="Router",
28
+ api_key=api_key,
29
+ is_routing=False,
30
+ tools=[] if tools is None else tools,
31
+ )
32
+ self.routing_agent = StatusAgent[RoutingResponse](
33
+ system_prompt=ROUTING_SYSTEM_PROMPT,
34
+ name="Router",
35
+ api_key=api_key,
36
+ is_routing=True,
37
+ tools=[routing_tool]
38
+ )
39
+
40
+ async def cancel(self, context: RequestContext, event_queue: EventQueue) -> None:
41
+ raise NotImplementedError
42
+
43
+ async def execute(self, context: RequestContext, event_queue: EventQueue) -> None:
44
+ # set status to processing
45
+ await event_queue.enqueue_event(TaskStatusUpdateEvent(status=TaskStatus(state=TaskState.working),
46
+ final=False,
47
+ context_id=context.context_id,
48
+ task_id=context.task_id))
49
+ agent_response: StringResponse = await self.agent(message=context.get_user_input(),
50
+ context_id=context.context_id)
51
+
52
+ artifact: Artifact
53
+ if agent_response.status == TaskState.rejected:
54
+ agent_response: RoutingResponse = await self.routing_agent(message=context.get_user_input(),
55
+ context_id=context.context_id)
56
+ agent_name: str = json.loads(agent_response.agent_card)["name"]
57
+ logger.info(f"Request with id {context.context_id} got rejected and will be rerouted to a '{agent_name}'.",
58
+ extra={"card": agent_response.agent_card})
59
+ artifact = new_text_artifact(name='target_agent', description='New target agent for request.',
60
+ text=agent_response.agent_card)
61
+ else:
62
+ logger.info(f"Request with id {context.context_id} was successfully processed by agent.")
63
+ artifact = new_text_artifact(name='current_result', description='Result of request to agent.',
64
+ text=agent_response.response)
65
+
66
+ # publish actual result
67
+ await event_queue.enqueue_event(TaskArtifactUpdateEvent(append=False,
68
+ context_id=context.context_id,
69
+ task_id=context.task_id,
70
+ last_chunk=True,
71
+ artifact=artifact))
72
+ # set and publish the final status
73
+ await event_queue.enqueue_event(TaskStatusUpdateEvent(status=TaskStatus(
74
+ state=TaskState(agent_response.status)),
75
+ final=True,
76
+ context_id=context.context_id,
77
+ task_id=context.task_id))
@@ -0,0 +1,11 @@
1
+ from langchain_core.language_models import BaseChatModel
2
+ from langchain_openai import ChatOpenAI
3
+
4
+
5
+ def get_model(api_key: str) -> BaseChatModel:
6
+ return ChatOpenAI(
7
+ model="google/gemini-2.5-flash",
8
+ base_url="https://openrouter.ai/api/v1",
9
+ api_key=lambda: api_key,
10
+ reasoning_effort="medium"
11
+ )
@@ -0,0 +1,18 @@
1
+ import boto3
2
+ from langchain_core.tools import StructuredTool
3
+
4
+
5
+ class DynamoDbRegistryLookup:
6
+ def __init__(self, agent_card_tabel: str):
7
+ dynamo = boto3.resource("dynamodb", region_name="eu-central-1")
8
+ self.table = dynamo.Table(agent_card_tabel)
9
+
10
+ def get_agent_cards(self) -> list[str]:
11
+
12
+ items = self.table.scan().get("Items", [])
13
+ cards: list[str] = [it["card"] for it in items]
14
+ return cards
15
+
16
+ def as_tool(self) -> StructuredTool:
17
+ return StructuredTool.from_function(func=lambda: self.get_agent_cards(), name="agent_card_lookup",
18
+ description="Gets all available agent cards")
@@ -0,0 +1,75 @@
1
+ import asyncio
2
+ import time
3
+ from contextlib import asynccontextmanager
4
+
5
+ import boto3
6
+ from a2a.server.apps import A2ARESTFastAPIApplication
7
+ from a2a.server.request_handlers import DefaultRequestHandler
8
+ from a2a.server.tasks import InMemoryTaskStore
9
+ from a2a.types import AgentSkill, \
10
+ AgentCapabilities, AgentCard, TransportProtocol
11
+ from fastapi import FastAPI
12
+
13
+ from .executors import RoutingAgentExecutor
14
+ from .registry import DynamoDbRegistryLookup
15
+
16
+ CAPABILITIES = AgentCapabilities(streaming=False, push_notifications=False)
17
+
18
+ HEART_BEAT_INTERVAL_SEC = 5
19
+ MAX_HEART_BEAT_MISSES = 3
20
+
21
+ AGENT_CARD_TABLE = "agent-cards"
22
+
23
+ def get_expire_at() -> int:
24
+ return int(time.time() + MAX_HEART_BEAT_MISSES * HEART_BEAT_INTERVAL_SEC)
25
+
26
+ async def heart_beat(name: str, agent_card_table: str, agent_card: AgentCard):
27
+ table = boto3.resource("dynamodb", region_name="eu-central-1").Table(agent_card_table)
28
+ table.put_item(Item={"id": name, "card": agent_card.model_dump_json(), "expireAt": get_expire_at()})
29
+ while True:
30
+ await asyncio.sleep(HEART_BEAT_INTERVAL_SEC)
31
+ table.update_item(
32
+ Key={"id": name},
33
+ UpdateExpression="SET expireAt = :expire_at",
34
+ ExpressionAttributeValues={":expire_at": get_expire_at()}
35
+ )
36
+
37
+
38
+ def load_app(name: str, description: str, skills: list[AgentSkill], api_key: str, system_prompt: str,
39
+ host: str) -> FastAPI:
40
+
41
+ routing_skill = AgentSkill(
42
+ id='routing',
43
+ name='Agent routing',
44
+ description='Identifies the most suitable agent for the given task and returns the agent card',
45
+ tags=['agent', 'routing']
46
+ )
47
+
48
+ agent_card = AgentCard(
49
+ name=name,
50
+ description=description,
51
+ url=host,
52
+ version='1.0.0',
53
+ default_input_modes=['text', 'text/plain'],
54
+ default_output_modes=['text', 'text/plain'],
55
+ capabilities=CAPABILITIES,
56
+ skills=skills + [routing_skill],
57
+ preferred_transport=TransportProtocol.http_json
58
+ )
59
+
60
+
61
+ executor = RoutingAgentExecutor(api_key=api_key, system_prompt=system_prompt, routing_tool=DynamoDbRegistryLookup(agent_card_tabel=AGENT_CARD_TABLE).as_tool())
62
+
63
+ @asynccontextmanager
64
+ async def lifespan(_: FastAPI):
65
+ asyncio.create_task(heart_beat(name=name, agent_card_table=AGENT_CARD_TABLE, agent_card=agent_card))
66
+ yield
67
+
68
+
69
+ return A2ARESTFastAPIApplication(
70
+ agent_card=agent_card,
71
+ http_handler=DefaultRequestHandler(
72
+ agent_executor=executor,
73
+ task_store=InMemoryTaskStore()
74
+ )
75
+ ).build(title=name, lifespan=lifespan)
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.4
2
+ Name: distributed_a2a
3
+ Version: 0.1.1
4
+ Summary: A library for building A2A agents with routing capabilities
5
+ Home-page: https://github.com/Barra-Technologies/distributed-a2a
6
+ Author: Fabian Bell
7
+ Author-email: Fabian Bell <fabian.bell@barrabytes.com>
8
+ License: MIT
9
+ Project-URL: Homepage, https://github.com/Barra-Technologies/distributed-a2a
10
+ Project-URL: Repository, https://github.com/Barra-Technologies/distributed-a2a
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: langchain>=0.1.0
23
+ Requires-Dist: langchain-core>=0.1.0
24
+ Requires-Dist: langchain-openai>=0.0.5
25
+ Requires-Dist: langgraph>=0.0.20
26
+ Requires-Dist: pydantic>=2.0.0
27
+ Requires-Dist: boto3>=1.28.0
28
+ Requires-Dist: a2a>=0.1.0
29
+ Dynamic: author
30
+ Dynamic: home-page
31
+ Dynamic: license-file
32
+ Dynamic: requires-python
33
+
34
+ # A2A Agent Library
35
+
36
+ A Python library for building A2A (Agent-to-Agent) agents with routing capabilities, DynamoDB-backed registry, and LangChain integration.
37
+
38
+ ## Features
39
+
40
+ - **StatusAgent**: Base agent implementation with status tracking and structured responses
41
+ - **RoutingAgentExecutor**: Agent executor with intelligent routing capabilities
42
+ - **DynamoDB Registry**: Dynamic agent card registry with heartbeat mechanism
43
+ - **Server Utilities**: FastAPI application builder with A2A protocol support
44
+ - **LangChain Integration**: Built on LangChain for flexible model integration
45
+
46
+ ## Installation
47
+
48
+ ```bash
49
+ pip install distributed-a2a
50
+ ```
51
+
52
+ ## Quick Start
53
+
54
+ ```python
55
+ from distributed_a2a import load_app
56
+ from a2a.types import AgentSkill
57
+
58
+ # Define your agent's skills
59
+ skills = [
60
+ AgentSkill(
61
+ id='example_skill',
62
+ name='Example Skill',
63
+ description='An example skill',
64
+ tags=['example']
65
+ )
66
+ ]
67
+
68
+ # Create your agent application
69
+ app = load_app(
70
+ name="MyAgent",
71
+ description="My specialized agent",
72
+ skills=skills,
73
+ api_key="your-api-key",
74
+ system_prompt="You are a helpful assistant...",
75
+ host="http://localhost:8000"
76
+ )
77
+ ```
78
+
79
+ ## Components
80
+
81
+ ### StatusAgent
82
+
83
+ A base agent class that provides status tracking and structured responses:
84
+
85
+ ```python
86
+ from distributed_a2a import StatusAgent, StringResponse
87
+
88
+ agent = StatusAgent[StringResponse](
89
+ system_prompt="Your system prompt",
90
+ name="AgentName",
91
+ api_key="your-api-key",
92
+ is_routing=False,
93
+ tools=[]
94
+ )
95
+
96
+ response = await agent("User message", context_id="context-123")
97
+ ```
98
+
99
+ ### RoutingAgentExecutor
100
+
101
+ An executor that can handle requests directly or route them to specialized agents:
102
+
103
+ ```python
104
+ from distributed_a2a import RoutingAgentExecutor
105
+
106
+ executor = RoutingAgentExecutor(
107
+ api_key="your-api-key",
108
+ system_prompt="Your system prompt",
109
+ routing_tool=routing_tool
110
+ )
111
+ ```
112
+
113
+ ### DynamoDB Registry
114
+
115
+ Dynamic agent registry with automatic heartbeat and expiration:
116
+
117
+ ```python
118
+ from distributed_a2a import DynamoDbRegistryLookup
119
+
120
+ registry = DynamoDbRegistryLookup(agent_card_tabel="agent-cards")
121
+ tool = registry.as_tool()
122
+ ```
123
+
124
+ ## Requirements
125
+
126
+ - Python 3.10+
127
+ - langchain
128
+ - langchain-core
129
+ - langchain-openai
130
+ - langgraph
131
+ - pydantic
132
+ - boto3
133
+ - a2a
134
+
135
+ ## License
136
+
137
+ MIT
138
+
139
+ ## Contributing
140
+
141
+ Contributions are welcome! Please feel free to submit a Pull Request.
@@ -0,0 +1,17 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ requirements.txt
6
+ setup.py
7
+ distributed_a2a/__init__.py
8
+ distributed_a2a/agent.py
9
+ distributed_a2a/executors.py
10
+ distributed_a2a/model.py
11
+ distributed_a2a/registry.py
12
+ distributed_a2a/server.py
13
+ distributed_a2a.egg-info/PKG-INFO
14
+ distributed_a2a.egg-info/SOURCES.txt
15
+ distributed_a2a.egg-info/dependency_links.txt
16
+ distributed_a2a.egg-info/requires.txt
17
+ distributed_a2a.egg-info/top_level.txt
@@ -0,0 +1,7 @@
1
+ langchain>=0.1.0
2
+ langchain-core>=0.1.0
3
+ langchain-openai>=0.0.5
4
+ langgraph>=0.0.20
5
+ pydantic>=2.0.0
6
+ boto3>=1.28.0
7
+ a2a>=0.1.0
@@ -0,0 +1 @@
1
+ distributed_a2a
@@ -0,0 +1,32 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "distributed_a2a"
7
+ version = "0.1.1"
8
+ description = "A library for building A2A agents with routing capabilities"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ {name = "Fabian Bell", email = "fabian.bell@barrabytes.com"}
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Developers",
18
+ "Topic :: Software Development :: Libraries :: Python Modules",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ ]
25
+ dynamic = ["dependencies"]
26
+
27
+ [tool.setuptools.dynamic]
28
+ dependencies = {file = ["requirements.txt"]}
29
+
30
+ [project.urls]
31
+ Homepage = "https://github.com/Barra-Technologies/distributed-a2a"
32
+ Repository = "https://github.com/Barra-Technologies/distributed-a2a"
@@ -0,0 +1,7 @@
1
+ langchain>=0.1.0
2
+ langchain-core>=0.1.0
3
+ langchain-openai>=0.0.5
4
+ langgraph>=0.0.20
5
+ pydantic>=2.0.0
6
+ boto3>=1.28.0
7
+ a2a>=0.1.0
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,31 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ with open("README.md", "r", encoding="utf-8") as fh:
4
+ long_description = fh.read()
5
+
6
+ with open("requirements.txt", "r", encoding="utf-8") as fh:
7
+ requirements = [line.strip() for line in fh if line.strip() and not line.startswith("#")]
8
+
9
+ setup(
10
+ name="distributed_a2a",
11
+ version="0.1.1",
12
+ author="Fabian Bell",
13
+ author_email="fabian.bell@barrabytes.com",
14
+ description="A library for building A2A agents with routing capabilities",
15
+ long_description=long_description,
16
+ long_description_content_type="text/markdown",
17
+ url="https://github.com/Barra-Technologies/distributed-a2a",
18
+ packages=find_packages(),
19
+ classifiers=[
20
+ "Development Status :: 3 - Alpha",
21
+ "Intended Audience :: Developers",
22
+ "Topic :: Software Development :: Libraries :: Python Modules",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Programming Language :: Python :: 3",
25
+ "Programming Language :: Python :: 3.10",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ ],
29
+ python_requires=">=3.10",
30
+ install_requires=requirements,
31
+ )