File tree Expand file tree Collapse file tree 4 files changed +15
-12
lines changed
Expand file tree Collapse file tree 4 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 1- from a2a .server .apps .http_app import HttpApp
21from a2a .server .apps .default_app import DefaultA2AApplication
3- from a2a .server .apps .starlette_app import A2AStarletteApplication
42from a2a .server .apps .fastapi_app import A2AFastAPIApplication
3+ from a2a .server .apps .http_app import HttpApp
4+ from a2a .server .apps .starlette_app import A2AStarletteApplication
55
66
77__all__ = [
8+ 'A2AFastAPIApplication' ,
9+ 'A2AStarletteApplication' ,
810 'DefaultA2AApplication' ,
9- 'A2AStarletteApplication' ,
10- 'A2AFastAPIApplication' ,
11- 'HttpApp'
11+ 'HttpApp' ,
1212]
Original file line number Diff line number Diff line change 11import json
22import logging
33import traceback
4- from abc import ABC , abstractmethod
54
5+ from abc import ABC , abstractmethod
66from collections .abc import AsyncGenerator
7- from typing import Any , Optional , Union
7+ from typing import Any
88
9+ from fastapi import FastAPI
910from pydantic import ValidationError
1011from sse_starlette .sse import EventSourceResponse
1112from starlette .applications import Starlette
12- from fastapi import FastAPI
1313from starlette .requests import Request
1414from starlette .responses import JSONResponse , Response
1515
3939)
4040from a2a .utils .errors import MethodNotImplementedError
4141
42+
4243logger = logging .getLogger (__name__ )
4344
4445
@@ -258,7 +259,7 @@ def build(
258259 agent_card_url : str = '/.well-known/agent.json' ,
259260 rpc_url : str = '/' ,
260261 ** kwargs : Any ,
261- ) -> Union [ Starlette , FastAPI ] :
262+ ) -> Starlette | FastAPI :
262263 """Builds and returns the FastAPI application instance.
263264
264265 Args:
@@ -269,4 +270,3 @@ def build(
269270 Returns:
270271 A configured FastAPI application instance.
271272 """
272- pass
Original file line number Diff line number Diff line change 11import logging
2+
23from typing import Any
34
45from fastapi import FastAPI , Request
78from a2a .server .request_handlers .jsonrpc_handler import RequestHandler
89from a2a .types import AgentCard
910
11+
1012logger = logging .getLogger (__name__ )
1113
1214
@@ -15,7 +17,8 @@ class A2AFastAPIApplication(DefaultA2AApplication):
1517
1618 Handles incoming JSON-RPC requests, routes them to the appropriate
1719 handler methods, and manages response generation including Server-Sent Events
18- (SSE)."""
20+ (SSE).
21+ """
1922
2023 def __init__ (self , agent_card : AgentCard , http_handler : RequestHandler ):
2124 """Initializes the A2A FastAPI application.
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ def routes(
5959 name = 'agent_card' ,
6060 ),
6161 ]
62-
62+
6363 def build (
6464 self ,
6565 agent_card_url : str = '/.well-known/agent.json' ,
You can’t perform that action at this time.
0 commit comments