-
Notifications
You must be signed in to change notification settings - Fork 45
Description
Description
The 3.5. Method Mapping and Naming Conventions section of the specification defines conventions for JSON-RPC/gRPC/REST methods mapping and defines existence of custom or extensions methods.
Currently, the handlers for the same methods for different transports are implemented on different places taking information from ad-hoc source locations and custom or extension methods are not supported, see JSON-RPC server implementation vs. JSON-RPC client implementation vs. REST implementation. gRPC method handlers does not seem to be implemented either?
Within this task, propose a way how to abstract all information needed to serve and handle requests to agent methods (including custom or extension ones) for all supported transports so adding a new method will be matter of deriving single abstract class and its registration without the necessity of changing transport-specific handlers implementations on multiple places.
NOTE: Command or similar design-pattern can be utilized for this.
NOTE: Adding support for custom or extension methods might involve adding a new method to A2AEndpointRouteBuilderExtensions.cs or adding a new parameter to A2AEndpointRouteBuilderExtensions.MapA2A() that will allow defining the custom methods. Alternatively, similar concept as TaskManager can be introduced to manage custom methods implementations.
Motivation
- Reduce code duplication and improve architecture of the library (open-close principle).
- Enable user-defined custom or extensions methods implemented using the same mechanisms as built-in methods are.