From 693a291412ac94f4541b3288def5cbb61d6c2981 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 7 Mar 2026 02:45:24 +0000 Subject: [PATCH] fix: resolve ruff lint errors and mypy type error - Remove unused import get_user_credential (F401) - Add noqa: PLR0915 for 3 large functions exceeding 50 statements - Cast result_data['q'] to str for _append_domain_filters (mypy arg-type) Co-authored-by: Ishaan Jaff --- litellm/a2a_protocol/main.py | 2 +- litellm/llms/searchapi/search/transformation.py | 2 +- litellm/proxy/_experimental/mcp_server/server.py | 2 +- litellm/proxy/agent_endpoints/a2a_endpoints.py | 2 +- litellm/proxy/management_endpoints/mcp_management_endpoints.py | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/litellm/a2a_protocol/main.py b/litellm/a2a_protocol/main.py index 0067af3c7db..47a6d8be558 100644 --- a/litellm/a2a_protocol/main.py +++ b/litellm/a2a_protocol/main.py @@ -439,7 +439,7 @@ def _build_streaming_logging_obj( return logging_obj -async def asend_message_streaming( +async def asend_message_streaming( # noqa: PLR0915 a2a_client: Optional["A2AClientType"] = None, request: Optional["SendStreamingMessageRequest"] = None, api_base: Optional[str] = None, diff --git a/litellm/llms/searchapi/search/transformation.py b/litellm/llms/searchapi/search/transformation.py index 826f2436cb7..f3333bb20c9 100644 --- a/litellm/llms/searchapi/search/transformation.py +++ b/litellm/llms/searchapi/search/transformation.py @@ -159,7 +159,7 @@ class SearchAPIConfig(BaseSearchConfig): domains = optional_params["search_domain_filter"] if isinstance(domains, list) and len(domains) > 0: result_data["q"] = self._append_domain_filters( - result_data["q"], domains + str(result_data["q"]), domains ) if "country" in optional_params: diff --git a/litellm/proxy/_experimental/mcp_server/server.py b/litellm/proxy/_experimental/mcp_server/server.py index 5c063839304..99f6a5234a1 100644 --- a/litellm/proxy/_experimental/mcp_server/server.py +++ b/litellm/proxy/_experimental/mcp_server/server.py @@ -1644,7 +1644,7 @@ if MCP_AVAILABLE: }, ) - async def execute_mcp_tool( + async def execute_mcp_tool( # noqa: PLR0915 name: str, arguments: Dict[str, Any], allowed_mcp_servers: List[MCPServer], diff --git a/litellm/proxy/agent_endpoints/a2a_endpoints.py b/litellm/proxy/agent_endpoints/a2a_endpoints.py index 344070d17fc..3ffced7a12c 100644 --- a/litellm/proxy/agent_endpoints/a2a_endpoints.py +++ b/litellm/proxy/agent_endpoints/a2a_endpoints.py @@ -269,7 +269,7 @@ async def get_agent_card( tags=["[beta] A2A Agents"], dependencies=[Depends(user_api_key_auth)], ) -async def invoke_agent_a2a( +async def invoke_agent_a2a( # noqa: PLR0915 agent_id: str, request: Request, fastapi_response: Response, diff --git a/litellm/proxy/management_endpoints/mcp_management_endpoints.py b/litellm/proxy/management_endpoints/mcp_management_endpoints.py index b48db72a536..f7a4cec301b 100644 --- a/litellm/proxy/management_endpoints/mcp_management_endpoints.py +++ b/litellm/proxy/management_endpoints/mcp_management_endpoints.py @@ -81,7 +81,6 @@ if MCP_AVAILABLE: delete_user_credential, get_all_mcp_servers_for_user, get_mcp_server, - get_user_credential, store_user_credential, update_mcp_server, )