From d05a3415f8f700d7a6a3282e310618148967c90a Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 24 Apr 2026 16:12:59 +0000 Subject: [PATCH] Fix lint: remove unused imports, fix formatting, fix ambiguous char MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: João --- lib/crewai/src/crewai/a2a/_compat.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/crewai/src/crewai/a2a/_compat.py b/lib/crewai/src/crewai/a2a/_compat.py index 878da1eb4..093c2a77b 100644 --- a/lib/crewai/src/crewai/a2a/_compat.py +++ b/lib/crewai/src/crewai/a2a/_compat.py @@ -10,6 +10,7 @@ from typing import Any from a2a.client.errors import A2AClientError + # --------------------------------------------------------------------------- # Error re-exports # In v0.3 the class was called A2AClientHTTPError; v1.0 renamed it to @@ -19,7 +20,7 @@ from a2a.client.errors import A2AClientError A2AClientHTTPError = A2AClientError # back-compat alias # --------------------------------------------------------------------------- -# Type helpers – Protobuf Part access +# Type helpers - Protobuf Part access # In v0.3 Part was a Pydantic discriminated-union with ``part.root.kind`` # and ``part.root.text``; in v1.0 Part is a protobuf message with a # ``content`` oneof. @@ -56,6 +57,7 @@ def part_has_file(part: Part) -> bool: from a2a.types import Role, TaskState # noqa: E402 + # TaskState aliases TASK_STATE_SUBMITTED = TaskState.TASK_STATE_SUBMITTED TASK_STATE_WORKING = TaskState.TASK_STATE_WORKING @@ -94,12 +96,11 @@ def agent_card_to_dict(agent_card: Any, *, exclude_none: bool = True) -> dict[st Works like ``agent_card.model_dump(exclude_none=True)`` did in v0.3. """ - d = MessageToDict( + return MessageToDict( agent_card, preserving_proto_field_name=True, always_print_fields_with_no_presence=not exclude_none, ) - return d def proto_copy(msg: Any) -> Any: @@ -145,7 +146,7 @@ def new_text_message( ) -def make_send_request(message: Message) -> "SendMessageRequest": +def make_send_request(message: Message) -> Any: """Wrap a Message in a SendMessageRequest (v1.0 API). In v0.3, ``client.send_message(message)`` accepted a bare ``Message``. @@ -215,8 +216,6 @@ def agent_card_protocol_version(agent_card: AgentCard) -> str: # --------------------------------------------------------------------------- from a2a.types import ( # noqa: E402 StreamResponse, - Task, - TaskArtifactUpdateEvent, TaskStatusUpdateEvent, ) @@ -281,6 +280,7 @@ def create_client_config( from a2a.types import GetTaskRequest, SubscribeToTaskRequest # noqa: E402 + # Expose v0.3 names as aliases for the v1.0 types TaskQueryParams = GetTaskRequest TaskIdParams = SubscribeToTaskRequest