Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/A2A.AspNetCore/A2AEndpointRouteBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ public static IEndpointConventionBuilder MapHttpA2A(this IEndpointRouteBuilder e

var routeGroup = endpoints.MapGroup(path);

// /card endpoint - Agent discovery
routeGroup.MapGet("/card", async context => await A2AHttpProcessor.GetAgentCard(taskManager, logger, $"{context.Request.Scheme}://{context.Request.Host}{path}"));
// /v1/card endpoint - Agent discovery
routeGroup.MapGet("v1/card", async context => await A2AHttpProcessor.GetAgentCard(taskManager, logger, $"{context.Request.Scheme}://{context.Request.Host}{path}"));

// /tasks/{id} endpoint
routeGroup.MapGet("/tasks/{id}", (string id, [FromQuery] int? historyLength, [FromQuery] string? metadata) =>
// /v1/tasks/{id} endpoint
routeGroup.MapGet("v1/tasks/{id}", (string id, [FromQuery] int? historyLength, [FromQuery] string? metadata) =>
A2AHttpProcessor.GetTask(taskManager, logger, id, historyLength, metadata));

// /tasks/{id}/cancel endpoint
routeGroup.MapPost("/tasks/{id}/cancel", (string id) => A2AHttpProcessor.CancelTask(taskManager, logger, id));
// /v1/tasks/{id}:cancel endpoint
routeGroup.MapPost("v1/tasks/{id}:cancel", (string id) => A2AHttpProcessor.CancelTask(taskManager, logger, id));

// /send endpoint
routeGroup.MapPost("/send", ([FromBody] MessageSendParams sendParams, int? historyLength, string? metadata) =>
// /v1/message:send endpoint
routeGroup.MapPost("v1/message:send", ([FromBody] MessageSendParams sendParams, int? historyLength, string? metadata) =>
A2AHttpProcessor.SendTaskMessage(taskManager, logger, null, sendParams, historyLength, metadata));

// /tasks/{id}/send endpoint
Expand All @@ -87,8 +87,8 @@ public static IEndpointConventionBuilder MapHttpA2A(this IEndpointRouteBuilder e
routeGroup.MapPut("/tasks/{id}/pushNotification", (string id, [FromBody] PushNotificationConfig pushNotificationConfig) =>
A2AHttpProcessor.SetPushNotification(taskManager, logger, id, pushNotificationConfig));

// /tasks/{id}/pushNotification endpoint - GET
routeGroup.MapGet("/tasks/{id}/pushNotification", (string id) => A2AHttpProcessor.GetPushNotification(taskManager, logger, id));
// /v1/tasks/{id}/pushNotification endpoint - GET
routeGroup.MapGet("v1/tasks/{id}/pushNotificationConfigs", (string id) => A2AHttpProcessor.GetPushNotification(taskManager, logger, id));

return routeGroup;
}
Expand Down