Skip to content

Commit 853c17d

Browse files
committed
instructions for prereqs
1 parent 2d3b8f3 commit 853c17d

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

articles/ai-foundry/agents/how-to/tools/bing-custom-search-samples.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,18 @@ Use this article to find step-by-step instructions and code samples for using th
4747

4848
Save this endpoint to an environment variable named `PROJECT_ENDPOINT`.
4949

50-
* The name of your Grounding with Bing Search resource name. You can find it in the Azure AI Foundry portal by selecting **Management center** from the left navigation menu. Then selecting **Connected resources**.
50+
* The name of your Grounding with Bing Custom Search resource name. You can find it in the Azure AI Foundry portal by selecting **Management center** from the left navigation menu. Then selecting **Connected resources**.
5151

52-
:::image type="content" source="../../media/tools/deep-research/bing-resource-name.png" alt-text="A screenshot showing the Grounding with Bing Search resource name. " lightbox="../../media/tools/deep-research/bing-resource-name.png":::
52+
:::image type="content" source="../../media/tools/bing/custom-resource-name.png" alt-text="A screenshot showing the Grounding with Bing Custom Search resource name. " lightbox="../../media/tools/bing/custom-resource-name.png":::
5353

5454
Save this resource name to an environment variable named `BING_CUSTOM_CONNECTION_NAME`.
5555

56+
* The name of your Grounding with Bing Custom Search configuration, which contains the URLs you want to allow or disallow. You can find it by navigating to the overview page for your resource in the [Azure portal](https://portal.azure.com/). Select **Configurations**, then select your configuration.
57+
58+
:::image type="content" source="../../media/tools/bing/custom-connection-name.png" alt-text="A screenshot showing the Grounding with Bing Custom Search connection name. " lightbox="../../media/tools/bing/custom-connection-name.png":::
59+
60+
Save this connection name to an environment variable named `BING_CUSTOM_CONNECTION_NAME`.
61+
5662
## Create a project client
5763

5864
Create a client object, which will contain the connection string for connecting to your AI project and other resources.
@@ -81,13 +87,14 @@ project_client = AIProjectClient(
8187
To make the Grounding with Bing Custom Search tool available to your agent, use a connection to initialize the tool and attach it to the agent.
8288

8389
```python
84-
bing_custom_connection = project_client.connections.get(connection_name=os.environ["BING_CUSTOM_CONNECTION_NAME"])
90+
bing_custom_connection = project_client.connections.get(name=os.environ["BING_CUSTOM_CONNECTION_NAME"])
8591
conn_id = bing_custom_connection.id
8692

8793
print(conn_id)
8894

89-
# Initialize Bing Custom Search tool with connection id and instance name
90-
bing_custom_tool = BingCustomSearchTool(connection_id=conn_id, instance_name="<config_instance_name>")
95+
configuration_name = os.environ["BING_CUSTOM_INSTANCE_NAME"]
96+
# Initialize Bing Custom Search tool with connection id and configuration name
97+
bing_custom_tool = BingCustomSearchTool(connection_id=conn_id, instance_name=configuration_name)
9198

9299
# Create agent with the bing custom search tool and process assistant run
93100
with project_client:
88.4 KB
Loading
83.3 KB
Loading

0 commit comments

Comments
 (0)