From 5e5c6976f11bf8a62fed9cf9308edb40a9cacd17 Mon Sep 17 00:00:00 2001 From: Tao Chen Date: Thu, 14 May 2026 17:13:33 -0700 Subject: [PATCH] Formatting --- python/packages/a2a/agent_framework_a2a/_agent.py | 4 +--- python/packages/core/tests/core/test_mcp.py | 4 +--- .../packages/openai/agent_framework_openai/_chat_client.py | 7 ++++--- .../openai/tests/openai/test_openai_chat_client.py | 4 +--- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/python/packages/a2a/agent_framework_a2a/_agent.py b/python/packages/a2a/agent_framework_a2a/_agent.py index a6f041ca64..bc175ccc48 100644 --- a/python/packages/a2a/agent_framework_a2a/_agent.py +++ b/python/packages/a2a/agent_framework_a2a/_agent.py @@ -157,9 +157,7 @@ class A2AAgent(AgentTelemetryLayer, BaseAgent): self.client = factory.create(agent_card, interceptors=interceptors) # type: ignore except Exception as transport_error: # Transport negotiation failed - fall back to minimal agent card with JSONRPC - fallback_url = ( - agent_card.supported_interfaces[0].url if agent_card.supported_interfaces else url - ) + fallback_url = agent_card.supported_interfaces[0].url if agent_card.supported_interfaces else url if not fallback_url: raise ValueError( "A2A transport negotiation failed and no fallback URL is available. " diff --git a/python/packages/core/tests/core/test_mcp.py b/python/packages/core/tests/core/test_mcp.py index 0fc5867d79..aea479ff86 100644 --- a/python/packages/core/tests/core/test_mcp.py +++ b/python/packages/core/tests/core/test_mcp.py @@ -4227,9 +4227,7 @@ async def test_mcp_tool_call_tool_forwards_tool_list_meta(): self.session.call_tool = AsyncMock( return_value=types.CallToolResult(content=[types.TextContent(type="text", text="result")]) ) - self.session.list_prompts = AsyncMock( - return_value=types.ListPromptsResult(prompts=[]) - ) + self.session.list_prompts = AsyncMock(return_value=types.ListPromptsResult(prompts=[])) def get_mcp_client(self) -> _AsyncGeneratorContextManager[Any, None]: return None diff --git a/python/packages/openai/agent_framework_openai/_chat_client.py b/python/packages/openai/agent_framework_openai/_chat_client.py index 40d9063b12..0cc2bfbe8b 100644 --- a/python/packages/openai/agent_framework_openai/_chat_client.py +++ b/python/packages/openai/agent_framework_openai/_chat_client.py @@ -1429,9 +1429,10 @@ class RawOpenAIChatClient( # type: ignore[misc] props = content.additional_properties or {} # Local-shell variant serializes as `local_shell_call` carrying a server-issued id; # plain function_call_output pairs by call_id and is safe under storage. - if ( - props.get(OPENAI_SHELL_OUTPUT_TYPE_KEY) == OPENAI_SHELL_OUTPUT_TYPE_LOCAL_SHELL_CALL - and props.get(OPENAI_LOCAL_SHELL_CALL_ITEM_ID_KEY) + if props.get( + OPENAI_SHELL_OUTPUT_TYPE_KEY + ) == OPENAI_SHELL_OUTPUT_TYPE_LOCAL_SHELL_CALL and props.get( + OPENAI_LOCAL_SHELL_CALL_ITEM_ID_KEY ): continue new_args: dict[str, Any] = {} diff --git a/python/packages/openai/tests/openai/test_openai_chat_client.py b/python/packages/openai/tests/openai/test_openai_chat_client.py index 325986a730..dfb5bdc9cd 100644 --- a/python/packages/openai/tests/openai/test_openai_chat_client.py +++ b/python/packages/openai/tests/openai/test_openai_chat_client.py @@ -4120,9 +4120,7 @@ async def test_prepare_options_with_conversation_id_strips_server_items_for_mixe types = [item.get("type") for item in options["input"]] assert "reasoning" not in types assert "function_call" not in types - output_call_ids = { - item["call_id"] for item in options["input"] if item.get("type") == "function_call_output" - } + output_call_ids = {item["call_id"] for item in options["input"] if item.get("type") == "function_call_output"} assert output_call_ids == {"call_history", "call_live"} assert options["previous_response_id"] == "resp_prev123"