Class AutonomyA2ARequestHandler
-
- All Implemented Interfaces:
-
com.embabel.agent.a2a.server.A2ARequestHandler
@Service()@Profile(value = {"a2a"}) public final class AutonomyA2ARequestHandler implements A2ARequestHandlerHandle A2A messages according to the A2A protocol. Doesn't dictate mapping to URLs: a router or controller in front of this class must handle that.
-
-
Constructor Summary
Constructors Constructor Description AutonomyA2ARequestHandler(Autonomy autonomy, AgenticEventListener agenticEventListener, A2AStreamingHandler streamingHandler)
-
Method Summary
Modifier and Type Method Description SseEmitterhandleJsonRpcStream(StreamingJSONRPCRequest<?> request)Handles a streaming JSON-RPC request using Server-Sent Events (SSE). JSONRPCResponse<?>handleJsonRpc(NonStreamingJSONRPCRequest<?> request)Handle a JSON-RPC request according to the A2A protocol. final SseEmitterhandleMessageStream(SendStreamingMessageRequest request)-
-
Constructor Detail
-
AutonomyA2ARequestHandler
AutonomyA2ARequestHandler(Autonomy autonomy, AgenticEventListener agenticEventListener, A2AStreamingHandler streamingHandler)
-
-
Method Detail
-
handleJsonRpcStream
SseEmitter handleJsonRpcStream(StreamingJSONRPCRequest<?> request)
Handles a streaming JSON-RPC request using Server-Sent Events (SSE). This method is called when a client requests a streaming response for methods like "message/stream".
The default implementation throws UnsupportedOperationException as streaming is not supported. Override this method in implementations that support streaming responses.
- Parameters:
request- The JSON-RPC request containing the method name, parameters, and request ID- Returns:
An SseEmitter that will be used to send streaming events to the client
-
handleJsonRpc
JSONRPCResponse<?> handleJsonRpc(NonStreamingJSONRPCRequest<?> request)
Handle a JSON-RPC request according to the A2A protocol.
- Parameters:
request- the JSON-RPC request- Returns:
the JSON-RPC response
-
handleMessageStream
final SseEmitter handleMessageStream(SendStreamingMessageRequest request)
-
-
-
-