mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Formatting
This commit is contained in:
@@ -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. "
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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] = {}
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user