Skip to content

Commit 57420d5

Browse files
improved methods docstrings
1 parent 33be240 commit 57420d5

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/a2a/server/apps/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
11
"""HTTP application components for the A2A server."""
2-
3-
from a2a.server.apps.starlette_app import A2AStarletteApplication
4-
5-
6-
__all__ = ['A2AStarletteApplication']

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from abc import ABC, abstractmethod
77
from collections.abc import AsyncGenerator
8-
from typing import Any
8+
from typing import Any, Union
99

1010
from fastapi import FastAPI
1111
from pydantic import ValidationError
@@ -385,14 +385,17 @@ def build(
385385
agent_card_url: str = '/.well-known/agent.json',
386386
rpc_url: str = '/',
387387
**kwargs: Any,
388-
) -> Starlette | FastAPI:
389-
"""Builds and returns the FastAPI application instance.
388+
) -> Union[FastAPI, Starlette]:
389+
"""Builds and returns the JSONRPC application instance.
390390
391391
Args:
392392
agent_card_url: The URL for the agent card endpoint.
393393
rpc_url: The URL for the A2A JSON-RPC endpoint
394394
**kwargs: Additional keyword arguments to pass to the FastAPI constructor.
395395
396396
Returns:
397-
A configured FastAPI or Starlette application instance.
397+
A configured JSONRPC application instance.
398398
"""
399+
raise NotImplementedError(
400+
'Subclasses must implement the build method to create the application instance.'
401+
)

0 commit comments

Comments
 (0)