distributed-a2a 0.1.5rc5__py3-none-any.whl → 0.1.5rc7__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
@@ -7,7 +7,7 @@ from langchain_core.tools import BaseTool
7
7
  from langgraph.checkpoint.memory import MemorySaver
8
8
  from pydantic import BaseModel, Field
9
9
 
10
- from .model import get_model, AgentConfig
10
+ from .model import get_model, AgentConfig, LLMConfig
11
11
 
12
12
 
13
13
  class AgentResponse(BaseModel):
@@ -29,7 +29,7 @@ class StringResponse(AgentResponse):
29
29
 
30
30
  class StatusAgent[ResponseT: AgentResponse]:
31
31
 
32
- def __init__(self, agent_config: AgentConfig, api_key: str, is_routing: bool, tools: list[BaseTool]):
32
+ def __init__(self, llm_config: LLMConfig, name: str, system_prompt: str, api_key: str, is_routing: bool, tools: list[BaseTool]):
33
33
  response_format: type[AgentResponse]
34
34
  if is_routing:
35
35
  response_format = RoutingResponse
@@ -38,14 +38,14 @@ class StatusAgent[ResponseT: AgentResponse]:
38
38
 
39
39
  self.agent = create_agent(
40
40
  get_model(api_key=api_key,
41
- model=agent_config.agent.llm.model,
42
- base_url=agent_config.agent.llm.base_url,
43
- reasoning_effort=agent_config.agent.llm.reasoning_effort),
41
+ model=llm_config.model,
42
+ base_url=llm_config.base_url,
43
+ reasoning_effort=llm_config.reasoning_effort),
44
44
  tools=tools,
45
45
  checkpointer=MemorySaver(), # TODO replace by dynamodb
46
- system_prompt=agent_config.agent.llm.system_prompt,
46
+ system_prompt=system_prompt,
47
47
  response_format=response_format,
48
- name=agent_config.agent.card.name
48
+ name=name
49
49
  )
50
50
 
51
51
  async def __call__(self, message: str, context_id: str = None) -> ResponseT:
@@ -7,7 +7,6 @@ from a2a.server.events import EventQueue
7
7
  from a2a.types import TaskStatusUpdateEvent, TaskStatus, TaskState, TaskArtifactUpdateEvent, Artifact
8
8
  from a2a.utils import new_text_artifact
9
9
  from langchain_core.tools import BaseTool
10
- from openai import api_key
11
10
 
12
11
  from .agent import StatusAgent, RoutingResponse, StringResponse
13
12
  from .model import AgentConfig
@@ -27,6 +26,7 @@ class RoutingAgentExecutor(AgentExecutor):
27
26
  super().__init__()
28
27
  api_key = os.environ.get(agent_config.agent.llm.api_key_env)
29
28
  self.agent = StatusAgent[StringResponse](
29
+ llm_config=agent_config.agent.llm,
30
30
  system_prompt=agent_config.agent.llm.system_prompt,
31
31
  name="Router",
32
32
  api_key=api_key,
@@ -34,6 +34,7 @@ class RoutingAgentExecutor(AgentExecutor):
34
34
  tools=[] if tools is None else tools,
35
35
  )
36
36
  self.routing_agent = StatusAgent[RoutingResponse](
37
+ llm_config=agent_config.agent.llm,
37
38
  system_prompt=ROUTING_SYSTEM_PROMPT,
38
39
  name="Router",
39
40
  api_key=api_key,
distributed_a2a/server.py CHANGED
@@ -1,5 +1,4 @@
1
1
  import asyncio
2
- import logging
3
2
  import time
4
3
  from contextlib import asynccontextmanager
5
4
  from typing import Any
@@ -41,9 +40,8 @@ async def heart_beat(name: str, agent_card_table: str, agent_card: AgentCard):
41
40
 
42
41
 
43
42
  def load_app(agent_config: dict[str, Any]) -> FastAPI:
44
- logging.info("Loading agent app")
45
- logging.info(f"config dictionary: {agent_config}")
46
- agent_config=AgentConfig.model_validate(agent_config)
43
+
44
+ agent_config= AgentConfig.model_validate(agent_config)
47
45
 
48
46
  skills = [AgentSkill(
49
47
  id=skill.id,
@@ -67,6 +65,7 @@ def load_app(agent_config: dict[str, Any]) -> FastAPI:
67
65
  default_output_modes=agent_config.agent.card.default_output_modes,
68
66
  skills=skills,
69
67
  preferred_transport=agent_config.agent.card.preferred_transport_protocol,
68
+ capabilities=CAPABILITIES
70
69
  )
71
70
 
72
71
 
@@ -84,5 +83,5 @@ def load_app(agent_config: dict[str, Any]) -> FastAPI:
84
83
  http_handler=DefaultRequestHandler(
85
84
  agent_executor=executor,
86
85
  task_store=InMemoryTaskStore() #TODO replace with dynamodb store
87
- )
88
- ).build(title=agent_card.name, lifespan=lifespan)
86
+
87
+ )).build(title=agent_card.name, lifespan=lifespan, root_path=agent_config.agent.card.name) #TODO use extra parameter
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: distributed_a2a
3
- Version: 0.1.5rc5
3
+ Version: 0.1.5rc7
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
@@ -0,0 +1,12 @@
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=m8Z48r4gWYE_39wq-lS4Btk5lOsKTuS7JSYNYF2Ejaw,4171
5
+ distributed_a2a/model.py,sha256=yXiqEBZfQh-B_ld5klUVSUuXxninYfZ1aC9IJmmJdMg,2323
6
+ distributed_a2a/registry.py,sha256=197eZVR6TW0isOUE0VjWSWs7aCqbWqnBzcV8EVXAxrI,677
7
+ distributed_a2a/server.py,sha256=stBQ926uT8Ye8KeBYR3cFIM5vqFOFa4Ozceai5aIWP0,3079
8
+ distributed_a2a-0.1.5rc7.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
9
+ distributed_a2a-0.1.5rc7.dist-info/METADATA,sha256=HiG7eJxznlt7ygJzCjOdj8joWP4nsQBGtvIIOWJYARQ,3106
10
+ distributed_a2a-0.1.5rc7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ distributed_a2a-0.1.5rc7.dist-info/top_level.txt,sha256=23qJ8n5k7796BHDK7a58uuO-X4GV0EgUWcGi8NIn-0k,16
12
+ distributed_a2a-0.1.5rc7.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=fW3htAZkZucuuowvROO0jcscpUMOsH-5loxBZOf6G4U,2642
3
- distributed_a2a/client.py,sha256=2974Uw8YUuyBytwxxJJKYsWXCpEaIbGmMUHDraITxJ0,4149
4
- distributed_a2a/executors.py,sha256=PMBAxeE3-ZY2YNiRbgzdksxrsJb4Q10kHzGjt020TEo,4104
5
- distributed_a2a/model.py,sha256=yXiqEBZfQh-B_ld5klUVSUuXxninYfZ1aC9IJmmJdMg,2323
6
- distributed_a2a/registry.py,sha256=197eZVR6TW0isOUE0VjWSWs7aCqbWqnBzcV8EVXAxrI,677
7
- distributed_a2a/server.py,sha256=65k3_p1cS77E-_wVOD1eBb5xjRMtDQvAPthNo2BZTro,3089
8
- distributed_a2a-0.1.5rc5.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
9
- distributed_a2a-0.1.5rc5.dist-info/METADATA,sha256=r9PU1E1b7kHMnXJBOiDYs4hCd0P3C7OfuPM4Z-qvNx0,3106
10
- distributed_a2a-0.1.5rc5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- distributed_a2a-0.1.5rc5.dist-info/top_level.txt,sha256=23qJ8n5k7796BHDK7a58uuO-X4GV0EgUWcGi8NIn-0k,16
12
- distributed_a2a-0.1.5rc5.dist-info/RECORD,,