From 97f01b692855da7b295e57d7ee19126474b8fd95 Mon Sep 17 00:00:00 2001 From: aiedwardyi <41576951+aiedwardyi@users.noreply.github.com> Date: Wed, 26 Aug 2026 12:38:59 +0900 Subject: [PATCH] chore: format A2A routing files --- .../litellm_completion_bridge/handler.py | 4 +--- .../providers/watsonx_orchestrate/handler.py | 12 +++--------- litellm/proxy/agent_endpoints/a2a_routing.py | 4 +--- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/litellm/a2a_protocol/litellm_completion_bridge/handler.py b/litellm/a2a_protocol/litellm_completion_bridge/handler.py index 3546ae0891d..3cd2e9329dc 100644 --- a/litellm/a2a_protocol/litellm_completion_bridge/handler.py +++ b/litellm/a2a_protocol/litellm_completion_bridge/handler.py @@ -52,9 +52,7 @@ class A2ACompletionBridgeHandler: merged = dict(previous) for key, value in current.items(): merged[key] = ( - A2ACompletionBridgeHandler._merge_stream_values(merged[key], value) - if key in merged - else value + A2ACompletionBridgeHandler._merge_stream_values(merged[key], value) if key in merged else value ) return merged if isinstance(previous, list) and isinstance(current, list): diff --git a/litellm/a2a_protocol/providers/watsonx_orchestrate/handler.py b/litellm/a2a_protocol/providers/watsonx_orchestrate/handler.py index 2d3e5cb1569..fe9d1ac3c15 100644 --- a/litellm/a2a_protocol/providers/watsonx_orchestrate/handler.py +++ b/litellm/a2a_protocol/providers/watsonx_orchestrate/handler.py @@ -39,9 +39,7 @@ def _build_wxo_headers( { key: value for key, value in static_headers.items() - if isinstance(key, str) - and isinstance(value, str) - and key.lower() not in _WXO_RESERVED_HEADERS + if isinstance(key, str) and isinstance(value, str) and key.lower() not in _WXO_RESERVED_HEADERS } if isinstance(static_headers, Mapping) else {} @@ -309,9 +307,7 @@ class WatsonxOrchestrateHandler: ) -> dict[str, object]: wxo: Final = WatsonxOrchestrateHandler._extract_litellm_params(litellm_params) - client: Final = WatsonxOrchestrateHandler._http_client( - timeout=timeout if timeout is not None else 90.0 - ) + client: Final = WatsonxOrchestrateHandler._http_client(timeout=timeout if timeout is not None else 90.0) token: Final = await WatsonxOrchestrateHandler._get_bearer_token( cp4d_host=wxo.cp4d_host, auth_mode=wxo.auth_mode, @@ -362,9 +358,7 @@ class WatsonxOrchestrateHandler: ) -> AsyncIterator[dict[str, object]]: wxo: Final = WatsonxOrchestrateHandler._extract_litellm_params(litellm_params) - client: Final = WatsonxOrchestrateHandler._http_client( - timeout=timeout if timeout is not None else 120.0 - ) + client: Final = WatsonxOrchestrateHandler._http_client(timeout=timeout if timeout is not None else 120.0) token: Final = await WatsonxOrchestrateHandler._get_bearer_token( cp4d_host=wxo.cp4d_host, auth_mode=wxo.auth_mode, diff --git a/litellm/proxy/agent_endpoints/a2a_routing.py b/litellm/proxy/agent_endpoints/a2a_routing.py index 5f5b5fc7705..36557d8bfeb 100644 --- a/litellm/proxy/agent_endpoints/a2a_routing.py +++ b/litellm/proxy/agent_endpoints/a2a_routing.py @@ -150,9 +150,7 @@ async def _route_registered_provider( registered_provider: Final = litellm_params.get("custom_llm_provider") registered_model: Final = litellm_params.get("model") native_provider: Final = registered_provider == "pydantic_ai_agents" or ( - registered_provider == "bedrock" - and isinstance(registered_model, str) - and "agentcore" in registered_model + registered_provider == "bedrock" and isinstance(registered_model, str) and "agentcore" in registered_model ) bridge_params: Final = _OBJECT_DICT_ADAPTER.validate_python( {"message": params["message"]} if native_provider else params