File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed
src/a2a/server/apps/jsonrpc Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change 2
2
3
3
from typing import Any
4
4
5
- from fastapi import FastAPI , Request , Response
5
+ from fastapi import FastAPI
6
6
7
7
from a2a .server .apps .jsonrpc .jsonrpc_app import (
8
8
CallContextBuilder ,
@@ -69,22 +69,13 @@ def add_routes_to_app(
69
69
rpc_url: The URL for the A2A JSON-RPC endpoint.
70
70
extended_agent_card_url: The URL for the authenticated extended agent card endpoint.
71
71
"""
72
-
73
- @app .post (rpc_url )
74
- async def handle_a2a_request (request : Request ) -> Response :
75
- return await self ._handle_requests (request )
76
-
77
- @app .get (agent_card_url )
78
- async def get_agent_card (request : Request ) -> Response :
79
- return await self ._handle_get_agent_card (request )
72
+ app .post (rpc_url )(self ._handle_requests )
73
+ app .get (agent_card_url )(self ._handle_get_agent_card )
80
74
81
75
if self .agent_card .supportsAuthenticatedExtendedCard :
82
-
83
- @app .get (extended_agent_card_url )
84
- async def get_extended_agent_card (request : Request ) -> Response :
85
- return await self ._handle_get_authenticated_extended_agent_card (
86
- request
87
- )
76
+ app .get (extended_agent_card_url )(
77
+ self ._handle_get_authenticated_extended_agent_card
78
+ )
88
79
89
80
def build (
90
81
self ,
You can’t perform that action at this time.
0 commit comments