a2a.server.routes.rest_dispatcher moduleÂķ
- class a2a.server.routes.rest_dispatcher.A2AJSONResponse(content: Any, status_code: int = 200, headers: Mapping[str, str] | None = None, media_type: str | None = None, background: BackgroundTask | None = None)Âķ
Bases:
JSONResponseJSONResponse labelled with the A2A media type.
- media_type = 'application/a2a+json'Âķ
- class a2a.server.routes.rest_dispatcher.RestDispatcher(request_handler: RequestHandler, context_builder: ServerCallContextBuilder | None = None, shutdown_grace_period: float = 0)Âķ
Bases:
objectDispatches incoming REST requests to the appropriate handler methods.
Handles context building, routing to RequestHandler directly, and response formatting (JSON/SSE).
- async delete_push_notification(request: Request) ResponseÂķ
Handles the âtasks/pushNotificationConfig/deleteâ REST method.
- async get_push_notification(request: Request) ResponseÂķ
Handles the âtasks/pushNotificationConfig/getâ REST method.
- async handle_authenticated_agent_card(request: Request) ResponseÂķ
Handles the âagentCardâ REST method.
- async list_push_notifications(request: Request) ResponseÂķ
Handles the âtasks/pushNotificationConfig/listâ REST method.
- async list_tasks(request: Request) ResponseÂķ
Handles the âtasks/listâ REST method.
- async on_cancel_task(request: Request) ResponseÂķ
Handles the âtasks/cancelâ REST method.
- async on_get_task(request: Request) ResponseÂķ
Handles the âtasks/{id}â REST method.
- async on_message_send(request: Request) ResponseÂķ
Handles the âmessage/sendâ REST method.
- async on_message_send_stream(request: Request) EventSourceResponseÂķ
Handles the âmessage/streamâ REST method.
- async on_subscribe_to_task(request: Request) EventSourceResponseÂķ
Handles the âSubscribeToTaskâ REST method.
- async set_push_notification(request: Request) ResponseÂķ
Handles the âtasks/pushNotificationConfig/setâ REST method.