Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions src/a2a/server/request_handlers/jsonrpc_handler.py
Original file line number Diff line number Diff line change
@@ -1,55 +1,53 @@
import logging

from collections.abc import AsyncIterable, Callable

from a2a.server.context import ServerCallContext
from a2a.server.request_handlers.request_handler import RequestHandler
from a2a.server.request_handlers.response_helpers import prepare_response_object
from a2a.types import (
AgentCard,
AuthenticatedExtendedCardNotConfiguredError,
CancelTaskRequest,
CancelTaskResponse,
CancelTaskSuccessResponse,
DeleteTaskPushNotificationConfigRequest,
DeleteTaskPushNotificationConfigResponse,
DeleteTaskPushNotificationConfigSuccessResponse,
GetAuthenticatedExtendedCardRequest,
GetAuthenticatedExtendedCardResponse,
GetAuthenticatedExtendedCardSuccessResponse,
GetTaskPushNotificationConfigRequest,
GetTaskPushNotificationConfigResponse,
GetTaskPushNotificationConfigSuccessResponse,
GetTaskRequest,
GetTaskResponse,
GetTaskSuccessResponse,
InternalError,
JSONRPCErrorResponse,
ListTaskPushNotificationConfigRequest,
ListTaskPushNotificationConfigResponse,
ListTaskPushNotificationConfigSuccessResponse,
Message,
SendMessageRequest,
SendMessageResponse,
SendMessageSuccessResponse,
SendStreamingMessageRequest,
SendStreamingMessageResponse,
SendStreamingMessageSuccessResponse,
SetTaskPushNotificationConfigRequest,
SetTaskPushNotificationConfigResponse,
SetTaskPushNotificationConfigSuccessResponse,
Task,
TaskArtifactUpdateEvent,
TaskNotFoundError,
TaskPushNotificationConfig,
TaskResubscriptionRequest,
TaskStatusUpdateEvent,
)
from a2a.utils.errors import ServerError
from a2a.utils.helpers import validate
from a2a.utils.telemetry import SpanKind, trace_class

Check failure on line 49 in src/a2a/server/request_handlers/jsonrpc_handler.py

View workflow job for this annotation

GitHub Actions / Lint Code Base

Ruff (I001)

src/a2a/server/request_handlers/jsonrpc_handler.py:1:1: I001 Import block is un-sorted or un-formatted


logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -425,14 +423,10 @@
Returns:
A `GetAuthenticatedExtendedCardResponse` object containing the config or a JSON-RPC error.
"""
if (
self.extended_agent_card is None
and self.extended_card_modifier is None
):
return GetAuthenticatedExtendedCardResponse(
root=JSONRPCErrorResponse(
id=request.id,
error=AuthenticatedExtendedCardNotConfiguredError(),
if not self.agent_card.supports_authenticated_extended_card:
raise ServerError(
error=AuthenticatedExtendedCardNotConfiguredError(
message='Authenticated card not supported'
)
)

Comment thread
rajeshvelicheti marked this conversation as resolved.
Expand Down
Loading