Skip to content

Commit e983473

Browse files
committed
refactor: make SDK class names concise
Signed-off-by: Shingo OKAWA <[email protected]>
1 parent 53fb802 commit e983473

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

examples/apicatalog/__main__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
)
1212
from dotenv import load_dotenv
1313

14-
from a2a.server.apps import A2AStarletteBuilder, A2AStarletteRouteBuilder
14+
from a2a.server.apps import StarletteBuilder, StarletteRouteBuilder
1515
from a2a.server.request_handlers import DefaultRequestHandler
1616
from a2a.server.tasks import InMemoryTaskStore
1717
from a2a.types import AgentCapabilities, AgentCard, AgentSkill
@@ -47,7 +47,7 @@ def main(host: str, port: int):
4747
agent_executor=HelloWorldAgentExecutor(),
4848
task_store=InMemoryTaskStore(),
4949
)
50-
hello_agent = A2AStarletteRouteBuilder(
50+
hello_agent = StarletteRouteBuilder(
5151
agent_card=hello_card,
5252
http_handler=hello_handler,
5353
)
@@ -74,12 +74,12 @@ def main(host: str, port: int):
7474
agent_executor=EchoAgentExecutor(),
7575
task_store=InMemoryTaskStore(),
7676
)
77-
echo_agent = A2AStarletteRouteBuilder(
77+
echo_agent = StarletteRouteBuilder(
7878
agent_card=echo_card,
7979
http_handler=echo_handler,
8080
)
8181

82-
server = A2AStarletteBuilder().mount(hello_agent).mount(echo_agent).build()
82+
server = StarletteBuilder().mount(hello_agent).mount(echo_agent).build()
8383
uvicorn.run(server, host=host, port=port)
8484

8585

src/a2a/server/apps/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
from a2a.server.apps.jsonrpc import (
44
A2AFastAPIApplication,
55
A2AStarletteApplication,
6-
A2AStarletteBuilder,
7-
A2AStarletteRouteBuilder,
86
CallContextBuilder,
9-
JSONRPCApplication,
7+
JSONRPCApplicationBuilder,
8+
StarletteBuilder,
9+
StarletteRouteBuilder,
1010
)
1111

1212

1313
__all__ = [
1414
'A2AFastAPIApplication',
1515
'A2AStarletteApplication',
16-
'A2AStarletteBuilder',
17-
'A2AStarletteRouteBuilder',
1816
'CallContextBuilder',
19-
'JSONRPCApplication',
17+
'JSONRPCApplicationBuilder',
18+
'StarletteBuilder',
19+
'StarletteRouteBuilder',
2020
]

src/a2a/server/apps/jsonrpc/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
from a2a.server.apps.jsonrpc.fastapi_app import A2AFastAPIApplication
44
from a2a.server.apps.jsonrpc.jsonrpc_app import (
55
CallContextBuilder,
6-
JSONRPCApplication,
6+
JSONRPCApplicationBuilder,
77
)
88
from a2a.server.apps.jsonrpc.starlette_app import (
99
A2AStarletteApplication,
10-
A2AStarletteBuilder,
11-
A2AStarletteRouteBuilder,
10+
StarletteBuilder,
11+
StarletteRouteBuilder,
1212
)
1313

1414

1515
__all__ = [
1616
'A2AFastAPIApplication',
1717
'A2AStarletteApplication',
18-
'A2AStarletteBuilder',
19-
'A2AStarletteRouteBuilder',
2018
'CallContextBuilder',
21-
'JSONRPCApplication',
19+
'JSONRPCApplicationBuilder',
20+
'StarletteBuilder',
21+
'StarletteRouteBuilder',
2222
]

src/a2a/server/apps/jsonrpc/jsonrpc_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ async def _handle_get_authenticated_extended_agent_card(
406406

407407

408408
@runtime_checkable
409-
class JSONRPCApplication(Protocol):
409+
class JSONRPCApplicationBuilder(Protocol):
410410
"""Protocol for building a JSON-RPC application.
411411
412412
Implementers of this protocol must provide a `build` method that returns a FastAPI

src/a2a/server/apps/jsonrpc/starlette_app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def build(
128128
return Starlette(**kwargs)
129129

130130

131-
class A2AStarletteRouteBuilder(JSONRPCApplicationAspect):
131+
class StarletteRouteBuilder(JSONRPCApplicationAspect):
132132
"""Configurable builder for Starlette routes that serve A2A protocol endpoints.
133133
134134
This builder constructs the necessary HTTP routes for an A2A-compliant agent.
@@ -238,7 +238,7 @@ def _get_path_from_url(url: str) -> str:
238238
return path if path else '/'
239239

240240

241-
class A2AStarletteBuilder:
241+
class StarletteBuilder:
242242
"""Builder class for assembling a Starlette application with A2A protocol routes.
243243
244244
This class enables mounting multiple A2AStarletteRouteBuilder instances under
@@ -276,7 +276,7 @@ async def _handle_get_api_catalog(self, request: Request) -> JSONResponse:
276276

277277
def mount(
278278
self,
279-
route_builder: A2AStarletteRouteBuilder,
279+
route_builder: StarletteRouteBuilder,
280280
) -> Self:
281281
"""Mounts routes generated by the given builder and adds metadata to the agent catalog.
282282

0 commit comments

Comments
 (0)