Skip to content

Commit b72be77

Browse files
committed
Filter tools and update project dependenceis
1 parent 9b46eb9 commit b72be77

File tree

4 files changed

+36
-15
lines changed

4 files changed

+36
-15
lines changed

sdk/agentserver/azure-ai-agentserver-agentframework/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ classifiers = [
2020
keywords = ["azure", "azure sdk"]
2121

2222
dependencies = [
23-
"azure-ai-agentserver-core",
23+
"azure-ai-agentserver-core>=1.0.0b5",
2424
"agent-framework-azure-ai==1.0.0b251007",
2525
"agent-framework-core==1.0.0b251007",
2626
"opentelemetry-exporter-otlp-proto-grpc>=1.36.0",
@@ -66,4 +66,4 @@ pyright = false
6666
verifytypes = false # incompatible python version for -core
6767
verify_keywords = false
6868
mindependency = false # depends on -core package
69-
whl_no_aio = false
69+
whl_no_aio = false

sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/client/tools/_client.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,20 @@ def list_tools(self) -> List[FoundryTool]:
104104
tools: List[FoundryTool] = []
105105

106106
# Fetch MCP tools
107-
mcp_tools = self._mcp_tools.list_tools(existing_names)
108-
tools.extend(mcp_tools)
107+
if (
108+
self._config.tool_config._named_mcp_tools
109+
and len(self._config.tool_config._named_mcp_tools) > 0
110+
):
111+
mcp_tools = self._mcp_tools.list_tools(existing_names)
112+
tools.extend(mcp_tools)
109113

110114
# Fetch Tools API tools
111-
tools_api_tools = self._remote_tools.resolve_tools(existing_names)
112-
tools.extend(tools_api_tools)
115+
if (
116+
self._config.tool_config._remote_tools
117+
and len(self._config.tool_config._remote_tools) > 0
118+
):
119+
tools_api_tools = self._remote_tools.resolve_tools(existing_names)
120+
tools.extend(tools_api_tools)
113121

114122
for tool in tools:
115123
# Capture tool in a closure to avoid shadowing issues

sdk/agentserver/azure-ai-agentserver-core/azure/ai/agentserver/core/client/tools/aio/_client.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# ---------------------------------------------------------
44

55
from typing import Any, List, Mapping, Union, TYPE_CHECKING
6-
6+
from asyncio import gather
77
from azure.core import AsyncPipelineClient
88
from azure.core.pipeline import policies
99
from azure.core.tracing.decorator_async import distributed_trace_async
@@ -107,12 +107,25 @@ async def list_tools(self) -> List[FoundryTool]:
107107

108108
tools: List[FoundryTool] = []
109109

110-
# Fetch MCP tools
111-
mcp_tools = await self._mcp_tools.list_tools(existing_names)
112-
tools.extend(mcp_tools)
113-
# Fetch Tools API tools
114-
tools_api_tools = await self._remote_tools.resolve_tools(existing_names)
115-
tools.extend(tools_api_tools)
110+
# Fetch MCP tools and Tools API tools in parallel
111+
# Build list of coroutines to gather based on configuration
112+
tasks = []
113+
if (
114+
self._config.tool_config._named_mcp_tools
115+
and len(self._config.tool_config._named_mcp_tools) > 0
116+
):
117+
tasks.append(self._mcp_tools.list_tools(existing_names))
118+
if (
119+
self._config.tool_config._remote_tools
120+
and len(self._config.tool_config._remote_tools) > 0
121+
):
122+
tasks.append(self._remote_tools.resolve_tools(existing_names))
123+
124+
# Execute all tasks in parallel if any exist
125+
if tasks:
126+
results = await gather(*tasks)
127+
for result in results:
128+
tools.extend(result)
116129

117130
for tool in tools:
118131
# Capture tool in a closure to avoid shadowing issues

sdk/agentserver/azure-ai-agentserver-langgraph/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ classifiers = [
1919
keywords = ["azure", "azure sdk"]
2020

2121
dependencies = [
22-
"azure-ai-agentserver-core",
22+
"azure-ai-agentserver-core>=1.0.0b5",
2323
"langchain>0.3.5",
2424
"langchain-openai>0.3.10",
2525
"langchain-azure-ai[opentelemetry]>=0.1.4",
@@ -67,4 +67,4 @@ pyright = false
6767
verifytypes = false # incompatible python version for -core
6868
verify_keywords = false
6969
mindependency = false # depends on -core package
70-
whl_no_aio = false
70+
whl_no_aio = false

0 commit comments

Comments
 (0)