|
25 | 25 | from a2a.client.middleware import ClientCallContext |
26 | 26 | from a2a.server.events import Event as A2AEvent |
27 | 27 | from a2a.types import Message as A2AMessage |
28 | | -from a2a.types import MessageSendConfiguration |
29 | 28 | from pydantic import BaseModel |
30 | 29 |
|
| 30 | +from ...a2a.converters.part_converter import A2APartToGenAIPartConverter |
| 31 | +from ...a2a.converters.part_converter import convert_a2a_part_to_genai_part |
| 32 | +from ...a2a.converters.to_adk_event import A2AArtifactUpdateToEventConverter |
| 33 | +from ...a2a.converters.to_adk_event import A2AMessageToEventConverter |
| 34 | +from ...a2a.converters.to_adk_event import A2AStatusUpdateToEventConverter |
| 35 | +from ...a2a.converters.to_adk_event import A2ATaskToEventConverter |
| 36 | +from ...a2a.converters.to_adk_event import convert_a2a_artifact_update_to_event |
| 37 | +from ...a2a.converters.to_adk_event import convert_a2a_message_to_event |
| 38 | +from ...a2a.converters.to_adk_event import convert_a2a_status_update_to_event |
| 39 | +from ...a2a.converters.to_adk_event import convert_a2a_task_to_event |
31 | 40 | from ...agents.invocation_context import InvocationContext |
32 | 41 | from ...events.event import Event |
33 | 42 |
|
@@ -71,6 +80,31 @@ class RequestInterceptor(BaseModel): |
71 | 80 |
|
72 | 81 |
|
73 | 82 | class A2aRemoteAgentConfig(BaseModel): |
74 | | - """Configuration for the RemoteA2aAgent.""" |
| 83 | + """Configuration for A2A remote agents.""" |
| 84 | + |
| 85 | + # Converts standard A2A Messages into ADK Event. |
| 86 | + a2a_message_converter: A2AMessageToEventConverter = ( |
| 87 | + convert_a2a_message_to_event |
| 88 | + ) |
| 89 | + |
| 90 | + # Converts an A2A Task into an ADK Event. |
| 91 | + a2a_task_converter: A2ATaskToEventConverter = convert_a2a_task_to_event |
| 92 | + |
| 93 | + # Converts A2A TaskStatusUpdateEvents into ADK Event. |
| 94 | + a2a_status_update_converter: A2AStatusUpdateToEventConverter = ( |
| 95 | + convert_a2a_status_update_to_event |
| 96 | + ) |
| 97 | + |
| 98 | + # Converts A2A TaskArtifactUpdateEvents into ADK Event. |
| 99 | + a2a_artifact_update_converter: A2AArtifactUpdateToEventConverter = ( |
| 100 | + convert_a2a_artifact_update_to_event |
| 101 | + ) |
| 102 | + |
| 103 | + # A low-level hook that converts individual A2A Message Parts |
| 104 | + # into native ADK/GenAI Part objects. |
| 105 | + # This is utilized internally by the other converters. |
| 106 | + a2a_part_converter: A2APartToGenAIPartConverter = ( |
| 107 | + convert_a2a_part_to_genai_part |
| 108 | + ) |
75 | 109 |
|
76 | 110 | request_interceptors: Optional[list[RequestInterceptor]] = None |
0 commit comments