diff --git a/python/packages/foundry/agent_framework_foundry/_agent.py b/python/packages/foundry/agent_framework_foundry/_agent.py index 0c7f93ba1f..626881b3ac 100644 --- a/python/packages/foundry/agent_framework_foundry/_agent.py +++ b/python/packages/foundry/agent_framework_foundry/_agent.py @@ -34,7 +34,7 @@ from azure.core.credentials import TokenCredential from azure.core.credentials_async import AsyncTokenCredential -from ._tools import sanitize_foundry_response_tool +from ._tools import _sanitize_foundry_response_tool # pyright: ignore[reportPrivateUsage] if sys.version_info >= (3, 13): from typing import TypeVar # type: ignore # pragma: no cover @@ -321,7 +321,7 @@ def _prepare_tools_for_openai( surface. """ response_tools = super()._prepare_tools_for_openai(tools) - return [sanitize_foundry_response_tool(tool_item) for tool_item in response_tools] + return [_sanitize_foundry_response_tool(tool_item) for tool_item in response_tools] def _prepare_messages_for_azure_ai(self, messages: Sequence[Message]) -> tuple[list[Message], str | None]: """Extract system/developer messages as instructions for Azure AI. diff --git a/python/packages/foundry/agent_framework_foundry/_chat_client.py b/python/packages/foundry/agent_framework_foundry/_chat_client.py index 735ba9fb57..353268a129 100644 --- a/python/packages/foundry/agent_framework_foundry/_chat_client.py +++ b/python/packages/foundry/agent_framework_foundry/_chat_client.py @@ -33,7 +33,7 @@ from azure.core.credentials import TokenCredential from azure.core.credentials_async import AsyncTokenCredential -from ._tools import fetch_toolbox, sanitize_foundry_response_tool +from ._tools import _sanitize_foundry_response_tool, fetch_toolbox # pyright: ignore[reportPrivateUsage] if sys.version_info >= (3, 13): from typing import TypeVar # type: ignore # pragma: no cover @@ -235,7 +235,7 @@ def _prepare_tools_for_openai( them downstream. """ response_tools = super()._prepare_tools_for_openai(tools) - return [sanitize_foundry_response_tool(tool_item) for tool_item in response_tools] + return [_sanitize_foundry_response_tool(tool_item) for tool_item in response_tools] async def configure_azure_monitor( self, diff --git a/python/packages/foundry/agent_framework_foundry/_tools.py b/python/packages/foundry/agent_framework_foundry/_tools.py index 4c5956fcfe..40b8bf0905 100644 --- a/python/packages/foundry/agent_framework_foundry/_tools.py +++ b/python/packages/foundry/agent_framework_foundry/_tools.py @@ -155,8 +155,7 @@ def _validate_hosted_tool_payload(sanitized: Mapping[str, Any]) -> None: ) -@experimental(feature_id=ExperimentalFeature.TOOLBOXES) -def sanitize_foundry_response_tool(tool_item: Any) -> Any: +def _sanitize_foundry_response_tool(tool_item: Any) -> Any: # pyright: ignore[reportUnusedFunction] """Return a Responses-API-safe tool payload for Foundry hosted tools. Reconciles known mismatches between toolbox reads and the Responses API: