Skip to content

Commit c8ea787

Browse files
committed
fix typos
1 parent f2ae37c commit c8ea787

File tree

2 files changed

+22
-49
lines changed

2 files changed

+22
-49
lines changed

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

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import json
33
import logging
44
import traceback
5-
65
from abc import ABC, abstractmethod
76
from collections.abc import AsyncGenerator, Callable
87
from typing import TYPE_CHECKING, Any
@@ -11,46 +10,27 @@
1110

1211
from a2a.auth.user import UnauthenticatedUser
1312
from a2a.auth.user import User as A2AUser
14-
from a2a.extensions.common import (
15-
HTTP_EXTENSION_HEADER,
16-
get_requested_extensions,
17-
)
13+
from a2a.extensions.common import (HTTP_EXTENSION_HEADER,
14+
get_requested_extensions)
1815
from a2a.server.context import ServerCallContext
1916
from a2a.server.request_handlers.jsonrpc_handler import JSONRPCHandler
2017
from a2a.server.request_handlers.request_handler import RequestHandler
21-
from a2a.types import (
22-
A2AError,
23-
A2ARequest,
24-
AgentCard,
25-
CancelTaskRequest,
26-
DeleteTaskPushNotificationConfigRequest,
27-
GetAuthenticatedExtendedCardRequest,
28-
GetTaskPushNotificationConfigRequest,
29-
GetTaskRequest,
30-
InternalError,
31-
InvalidRequestError,
32-
JSONParseError,
33-
JSONRPCError,
34-
JSONRPCErrorResponse,
35-
JSONRPCRequest,
36-
JSONRPCResponse,
37-
ListTaskPushNotificationConfigRequest,
38-
SendMessageRequest,
39-
SendStreamingMessageRequest,
40-
SendStreamingMessageResponse,
41-
SetTaskPushNotificationConfigRequest,
42-
TaskResubscriptionRequest,
43-
UnsupportedOperationError,
44-
)
45-
from a2a.utils.constants import (
46-
AGENT_CARD_WELL_KNOWN_PATH,
47-
DEFAULT_RPC_URL,
48-
EXTENDED_AGENT_CARD_PATH,
49-
PREV_AGENT_CARD_WELL_KNOWN_PATH,
50-
)
18+
from a2a.types import (A2AError, A2ARequest, AgentCard, CancelTaskRequest,
19+
DeleteTaskPushNotificationConfigRequest,
20+
GetAuthenticatedExtendedCardRequest,
21+
GetTaskPushNotificationConfigRequest, GetTaskRequest,
22+
InternalError, InvalidRequestError, JSONParseError,
23+
JSONRPCError, JSONRPCErrorResponse, JSONRPCRequest,
24+
JSONRPCResponse, ListTaskPushNotificationConfigRequest,
25+
SendMessageRequest, SendStreamingMessageRequest,
26+
SendStreamingMessageResponse,
27+
SetTaskPushNotificationConfigRequest,
28+
TaskResubscriptionRequest, UnsupportedOperationError)
29+
from a2a.utils.constants import (AGENT_CARD_WELL_KNOWN_PATH, DEFAULT_RPC_URL,
30+
EXTENDED_AGENT_CARD_PATH,
31+
PREV_AGENT_CARD_WELL_KNOWN_PATH)
5132
from a2a.utils.errors import MethodNotImplementedError
5233

53-
5434
logger = logging.getLogger(__name__)
5535

5636
if TYPE_CHECKING:
@@ -529,7 +509,7 @@ def _modify_rpc_url(self, agent_card: AgentCard, request: Request):
529509
extra_path = forwarded_path[: -len(request.url.path)]
530510
new_path = extra_path + rpc_path
531511
# If original path was just "/",
532-
# we remove trailing "/" in the the extended one
512+
# we remove trailing "/" in the extended one
533513
if len(new_path) > 1 and rpc_path == '/':
534514
new_path = new_path.rstrip('/')
535515
rpc_path = new_path

src/a2a/server/apps/rest/rest_adapter.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import functools
22
import logging
3-
43
from collections.abc import AsyncIterable, AsyncIterator, Awaitable, Callable
54
from typing import TYPE_CHECKING, Any
65

7-
86
if TYPE_CHECKING:
97
from sse_starlette.sse import EventSourceResponse
108
from starlette.datastructures import URL
@@ -29,21 +27,16 @@
2927

3028
_package_starlette_installed = False
3129

32-
from a2a.server.apps.jsonrpc import (
33-
CallContextBuilder,
34-
DefaultCallContextBuilder,
35-
)
30+
from a2a.server.apps.jsonrpc import (CallContextBuilder,
31+
DefaultCallContextBuilder)
3632
from a2a.server.context import ServerCallContext
3733
from a2a.server.request_handlers.request_handler import RequestHandler
3834
from a2a.server.request_handlers.rest_handler import RESTHandler
3935
from a2a.types import AgentCard, AuthenticatedExtendedCardNotConfiguredError
40-
from a2a.utils.error_handlers import (
41-
rest_error_handler,
42-
rest_stream_error_handler,
43-
)
36+
from a2a.utils.error_handlers import (rest_error_handler,
37+
rest_stream_error_handler)
4438
from a2a.utils.errors import ServerError
4539

46-
4740
logger = logging.getLogger(__name__)
4841

4942

@@ -233,7 +226,7 @@ def _modify_rpc_url(self, agent_card: AgentCard, request: Request):
233226
extra_path = forwarded_path[: -len(request.url.path)]
234227
new_path = extra_path + rpc_path
235228
# If original path was just "/",
236-
# we remove trailing "/" in the the extended one
229+
# we remove trailing "/" in the extended one
237230
if len(new_path) > 1 and rpc_path == '/':
238231
new_path = new_path.rstrip('/')
239232
rpc_path = new_path

0 commit comments

Comments
 (0)