distributed-a2a 0.1.5rc16__py3-none-any.whl → 0.1.5rc18__py3-none-any.whl

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.
distributed_a2a/agent.py CHANGED
@@ -5,6 +5,7 @@ from langchain.agents import create_agent
5
5
  from langchain_core.runnables import RunnableConfig
6
6
  from langchain_core.tools import BaseTool
7
7
  from langgraph.checkpoint.memory import MemorySaver
8
+ from langgraph_dynamodb_checkpoint import DynamoDBSaver
8
9
  from pydantic import BaseModel, Field
9
10
 
10
11
  from .model import get_model, AgentConfig, LLMConfig
@@ -20,29 +21,39 @@ class AgentResponse(BaseModel):
20
21
  )
21
22
  )
22
23
 
24
+
23
25
  class RoutingResponse(AgentResponse):
24
26
  agent_card: str = Field(description="The stringified json of the agent card to be returned to the user")
25
27
 
28
+
26
29
  class StringResponse(AgentResponse):
27
30
  response: str = Field(description="The main response to be returned to the user")
28
31
 
29
32
 
30
33
  class StatusAgent[ResponseT: AgentResponse]:
31
34
 
32
- def __init__(self, llm_config: LLMConfig, name: str, system_prompt: str, api_key: str, is_routing: bool, tools: list[BaseTool]):
35
+ def __init__(self, llm_config: LLMConfig, name: str, system_prompt: str, api_key: str, is_routing: bool,
36
+ tools: list[BaseTool]):
33
37
  response_format: type[AgentResponse]
34
38
  if is_routing:
35
39
  response_format = RoutingResponse
36
40
  else:
37
41
  response_format = StringResponse
38
42
 
43
+
44
+ saver = DynamoDBSaver(
45
+ table_name="your-dynamodb-table-name",
46
+ max_read_request_units=20, ## TODO find correct value for app
47
+ max_write_request_units=20, ## TODO find correct value for app
48
+ ttl_seconds=86400
49
+ )
39
50
  self.agent = create_agent(
40
51
  get_model(api_key=api_key,
41
52
  model=llm_config.model,
42
53
  base_url=llm_config.base_url,
43
54
  reasoning_effort=llm_config.reasoning_effort),
44
55
  tools=tools,
45
- checkpointer=MemorySaver(), # TODO replace by dynamodb
56
+ checkpointer=saver,
46
57
  system_prompt=system_prompt,
47
58
  response_format=response_format,
48
59
  name=name
@@ -27,7 +27,7 @@ class RoutingAgentExecutor(AgentExecutor):
27
27
  api_key = os.environ.get(agent_config.agent.llm.api_key_env)
28
28
  self.agent = StatusAgent[StringResponse](
29
29
  llm_config=agent_config.agent.llm,
30
- system_prompt=agent_config.agent.get_system_prompt(),
30
+ system_prompt=agent_config.agent.system_prompt,
31
31
  name=agent_config.agent.card.name,
32
32
  api_key=api_key,
33
33
  is_routing=False,
distributed_a2a/server.py CHANGED
@@ -77,7 +77,6 @@ def load_app(agent_config: dict[str, Any]) -> FastAPI:
77
77
  asyncio.create_task(heart_beat(name=agent_card.name, agent_card_table=AGENT_CARD_TABLE, agent_card=agent_card))
78
78
  yield
79
79
 
80
-
81
80
  return A2ARESTFastAPIApplication(
82
81
  agent_card=agent_card,
83
82
  http_handler=DefaultRequestHandler(
@@ -0,0 +1,6 @@
1
+ from distributed_a2a.distributed_a2a.registry import ToolRegistry
2
+
3
+ if __name__ == '__main__':
4
+ reg = ToolRegistry(tools_table="mcp_tools")
5
+ res = reg.get_tool_by_name(tool_name="my_second_tool")
6
+ print(res)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: distributed_a2a
3
- Version: 0.1.5rc16
3
+ Version: 0.1.5rc18
4
4
  Summary: A library for building A2A agents with routing capabilities
5
5
  Home-page: https://github.com/Barra-Technologies/distributed-a2a
6
6
  Author: Fabian Bell
@@ -23,6 +23,7 @@ Requires-Dist: langchain>=0.1.0
23
23
  Requires-Dist: langchain-core>=0.1.0
24
24
  Requires-Dist: langchain-openai>=0.0.5
25
25
  Requires-Dist: langgraph>=0.0.20
26
+ Requires-Dist: langgraph-dynamodb-checkpoint>=0.2.6.4
26
27
  Requires-Dist: pydantic>=2.0.0
27
28
  Requires-Dist: boto3>=1.28.0
28
29
  Requires-Dist: a2a>=0.1.0
@@ -0,0 +1,13 @@
1
+ distributed_a2a/__init__.py,sha256=1q_7gRfBCGe-7sF_9YKzevyS97XQhtuFnZiYHIqaU-0,120
2
+ distributed_a2a/agent.py,sha256=PsbnTQLqP45AmLQb0uzbfPRMjdCZ2kARK0m3rDb77FM,2910
3
+ distributed_a2a/client.py,sha256=2974Uw8YUuyBytwxxJJKYsWXCpEaIbGmMUHDraITxJ0,4149
4
+ distributed_a2a/executors.py,sha256=TNHO3eEIlKWObqBblcx_XiP5KahcfaGK1YuajWmQ5rE,4187
5
+ distributed_a2a/model.py,sha256=pvuoVg8QChYq21us49wZa7Pv-BlIU-mlfN2auVQvqdY,2676
6
+ distributed_a2a/registry.py,sha256=197eZVR6TW0isOUE0VjWSWs7aCqbWqnBzcV8EVXAxrI,677
7
+ distributed_a2a/server.py,sha256=iTowUWA3Kwa1eCpF7SdEu7jF9oxpi5Gj9j1On3eoArg,3084
8
+ distributed_a2a/tool_registry_test.py,sha256=xqnFKzogI8c6K3HoXjCXCgT4IlZEPQj3hlKTIwdYNyE,215
9
+ distributed_a2a-0.1.5rc18.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
10
+ distributed_a2a-0.1.5rc18.dist-info/METADATA,sha256=6gkP288uHWYZ79b6h3x-k2fFY9vOzo-DaRVTEGSuLtE,3161
11
+ distributed_a2a-0.1.5rc18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ distributed_a2a-0.1.5rc18.dist-info/top_level.txt,sha256=23qJ8n5k7796BHDK7a58uuO-X4GV0EgUWcGi8NIn-0k,16
13
+ distributed_a2a-0.1.5rc18.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- distributed_a2a/__init__.py,sha256=1q_7gRfBCGe-7sF_9YKzevyS97XQhtuFnZiYHIqaU-0,120
2
- distributed_a2a/agent.py,sha256=CpIeEASjkIflGCiVo4f5c5_xUg3VwMr27l-o4cj73Mw,2597
3
- distributed_a2a/client.py,sha256=2974Uw8YUuyBytwxxJJKYsWXCpEaIbGmMUHDraITxJ0,4149
4
- distributed_a2a/executors.py,sha256=5Zp1fHERVAGFWZ3yYUCiAlLl2EO8-k5AhfTW_hqQ49I,4193
5
- distributed_a2a/model.py,sha256=pvuoVg8QChYq21us49wZa7Pv-BlIU-mlfN2auVQvqdY,2676
6
- distributed_a2a/registry.py,sha256=197eZVR6TW0isOUE0VjWSWs7aCqbWqnBzcV8EVXAxrI,677
7
- distributed_a2a/server.py,sha256=eVccqBos4nMQqe9feyglGlMmUYIGz2t5jmBbMVt-NGE,3085
8
- distributed_a2a-0.1.5rc16.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
9
- distributed_a2a-0.1.5rc16.dist-info/METADATA,sha256=KQmM0yOX12PWi_5gJjvQjnUN6dbohO_5O-zAdvYBqc4,3107
10
- distributed_a2a-0.1.5rc16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- distributed_a2a-0.1.5rc16.dist-info/top_level.txt,sha256=23qJ8n5k7796BHDK7a58uuO-X4GV0EgUWcGi8NIn-0k,16
12
- distributed_a2a-0.1.5rc16.dist-info/RECORD,,