datarobot_genai.dragent.a2a.server.agent_executor_adapter
agent_executor_adapter
Adapter to bridge NAT workflows with A2A AgentExecutor interface.
This module implements a message-only A2A agent for Phase 1, providing stateless request/response interactions without task lifecycle management.
NATWorkflowAgentExecutor
Bases: AgentExecutor
Adapts NAT workflows to A2A AgentExecutor interface as a message-only agent.
This adapter implements Phase 1 support for A2A integration, providing stateless message-based interactions. Each request is handled independently without maintaining conversation state or task lifecycle.
Key characteristics: - Stateless: Each message is processed independently - Synchronous: Returns immediate responses (no long-running tasks) - Message-only: Returns Message objects, not Task objects - Concurrent: Uses SessionManager's semaphore for concurrency control
Note: Multi-turn conversations and task-based interactions are deferred to Phase 5.
Source code in datarobot_genai/dragent/a2a/server/agent_executor_adapter.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
__init__
Initialize the adapter with a NAT SessionManager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session_manager
|
SessionManager
|
The SessionManager for handling workflow execution with concurrency control via semaphore |
required |
Source code in datarobot_genai/dragent/a2a/server/agent_executor_adapter.py
execute
async
Execute the NAT workflow and return a message response.
This is a message-only implementation (Phase 1): 1. Extracts the user query from the A2A message 2. Runs the NAT workflow (stateless, no conversation history) 3. Returns the result as a Message object (not a Task)
For Phase 1, each message is handled independently with no state preservation between requests. The context_id and task_id from the A2A protocol are mapped to NAT's conversation_id and user_message_id for tracing purposes only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
RequestContext
|
The A2A request context containing the user message |
required |
event_queue
|
EventQueue
|
Queue for sending the response message back to the client |
required |
Raises
InvalidParamsError: If the request has no user input
InternalError: If the workflow fails
Source code in datarobot_genai/dragent/a2a/server/agent_executor_adapter.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
cancel
async
Handle task cancellation requests.
Not applicable for message-only agents in Phase 1. Cancellation is a task-based feature that will be implemented in Phase 5 along with long-running task support.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
_context
|
RequestContext
|
The request context (unused in Phase 1) |
required |
_event_queue
|
EventQueue
|
Event queue for sending updates (unused in Phase 1) |
required |
Raises
UnsupportedOperationError: Always