Skip to content

Commit 6854618

Browse files
committed
use bing resource name
1 parent 5a0fe67 commit 6854618

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

sdk/ai/azure-ai-agents/samples/agents_async/sample_agents_deep_research_async.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
the "Models + endpoints" tab in your Azure AI Foundry project.
2828
3) DEEP_RESEARCH_MODEL_DEPLOYMENT_NAME - The deployment name of the Deep Research AI model, as found under the "Name" column in
2929
the "Models + endpoints" tab in your Azure AI Foundry project.
30-
4) AZURE_BING_CONNECTION_ID - The ID of the Bing connection, in the format of:
31-
/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}/connections/{connection-name}
30+
4) BING_RESOURCE_NAME - The resource name of the Bing connection, you can find it in the "Connected resources" tab
31+
in the Management Center of your AI Foundry project.
3232
"""
3333

3434
import asyncio
@@ -98,9 +98,11 @@ async def main() -> None:
9898
credential=DefaultAzureCredential(),
9999
)
100100

101+
bing_connection = await project_client.connections.get(name=os.environ["BING_RESOURCE_NAME"])
102+
101103
# Initialize a Deep Research tool with Bing Connection ID and Deep Research model deployment name
102104
deep_research_tool = DeepResearchTool(
103-
bing_grounding_connection_id=os.environ["AZURE_BING_CONNECTION_ID"],
105+
bing_grounding_connection_id=bing_connection.id,
104106
deep_research_model=os.environ["DEEP_RESEARCH_MODEL_DEPLOYMENT_NAME"],
105107
)
106108

sdk/ai/azure-ai-agents/samples/agents_tools/sample_agents_deep_research.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
the "Models + endpoints" tab in your Azure AI Foundry project.
2828
3) DEEP_RESEARCH_MODEL_DEPLOYMENT_NAME - The deployment name of the Deep Research AI model, as found under the "Name" column in
2929
the "Models + endpoints" tab in your Azure AI Foundry project.
30-
4) AZURE_BING_CONNECTION_ID - The ID of the Bing connection, in the format of:
31-
/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}/connections/{connection-name}
30+
4) BING_RESOURCE_NAME - The resource name of the Bing connection, you can find it in the "Connected resources" tab
31+
in the Management Center of your AI Foundry project.
3232
"""
3333

3434
import os, time
@@ -93,7 +93,7 @@ def create_research_summary(
9393
)
9494

9595
# [START create_agent_with_deep_research_tool]
96-
conn_id = os.environ["AZURE_BING_CONNECTION_ID"]
96+
conn_id = project_client.connections.get(name=os.environ["BING_RESOURCE_NAME"]).id
9797

9898
# Initialize a Deep Research tool with Bing Connection ID and Deep Research model deployment name
9999
deep_research_tool = DeepResearchTool(

0 commit comments

Comments
 (0)