You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/agents/how-to/tools/bing-grounding.md
+33-37Lines changed: 33 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,63 +19,53 @@ recommendations: false
19
19
20
20
**Grounding with Bing Search** allows your Azure AI Agents to incorporate real-time public web data when generating responses. You need to create a Grounding with Bing Search resource, and then connect this resource to your Azure AI Agents. When a user sends a query, Azure AI Agents decide if Grounding with Bing Search should be leveraged or not. If so, it will leverage Bing to search over public web data and return relevant chunks. Lastly, Azure AI Agents will use returned chunks to generate a response.
21
21
22
-
You can ask questions such as "*what is the weather in Seattle?*" or "*what is the recent update in the retail industry in the US?*", which require real-time public data.
22
+
You can ask questions such as "*what is the top news today*" or "*what is the recent update in the retail industry in the US?*", which require real-time public data.
23
23
24
24
Developers and end users don't have access to raw content returned from Grounding with Bing Search. The response, however, includes citations with links to the websites used to generate the response, and a link to the Bing query used for the search. These two *References* must be retained and displayed in the exact form provided by Microsoft, as per Grounding with Bing Search's [Use and Display Requirements](https://www.microsoft.com/en-us/bing/apis/grounding-legal#use-and-display-requirements). See the [how to display Grounding with Bing Search results](#how-to-display-grounding-with-bing-search-results) section for details.
25
25
26
26
>[!IMPORTANT]
27
-
> Your usage of Grounding with Bing Search may incur costs. See the [pricing page](https://www.microsoft.com/bing/apis/grounding-pricing) for details.
27
+
> 1. Your usage of Grounding with Bing Search may incur costs. See the [pricing page](https://www.microsoft.com/bing/apis/grounding-pricing) for details.
28
+
> 1. If you choose to create a new Grounding with Bing Search resource programatically, such as the Azure CLI or using a deployment template, you automatically agree to be bound by and comply with the [terms of use and use and display requirements](https://www.microsoft.com/en-us/bing/apis/grounding-legal).
29
+
28
30
29
31
## Setup
30
32
31
-
> [!IMPORTANT]
32
-
> Grounding with Bing Search only works with the following AOAI models: `gpt-3.5-turbo-0125`, `gpt-4-0125-preview`, `gpt-4-turbo-2024-04-09`, `gpt-4o-0513`
33
+
> [!NOTE]
34
+
> Grounding with Bing Search only works with the following Azure OpenAI models: `gpt-3.5-turbo-0125`, `gpt-4-0125-preview`, `gpt-4-turbo-2024-04-09`, `gpt-4o-0513`
35
+
36
+
In one click, you can start creating a **new Azure AI Foundry project and Grounding with Bing Search resource** with the available [deployment template](../../quickstart.md#choose-basic-or-standard-agent-setup). After the deployment, you can find your resources including: an AI hub, project, Grounding with Bing Search resource and more created in your resource group. You can find your Grounding with Bing Search connection in the **connected resources** for your project in Azure AI Foundry portal.
33
37
34
-
1. Ensure you've completed the prerequisites and setup steps in the [quickstart](../../quickstart.md).
38
+
:::image type="content" source="../../media/tools/bing/connected-resources.png" alt-text="A screenshot showing the connected resources for a project in the Azure AI Foundry portal." lightbox="../../media/tools/bing/connected-resources.png":::
35
39
36
-
1. Create a new Grounding with Bing Search resource. <!--You can find the template file [here](./bingsearch_arm.json) and parameter file [here](./bingsearch_para.json).-->
37
-
You can do this directly in [Azure portal](https://portal.azure.com/#create/Microsoft.BingGroundingSearch), and select the different fields in the creation form.
40
+
1. If you already have a Grounding with Bing Search resource, you can provide your resource ID in the bicep file. Your resource ID should be in this format `/subscriptions/{subscription ID}/resourceGroups/{resource group name}/providers/Microsoft.Bing/accounts/{resource name}`. Replace the following empty string with your resource ID:
41
+
42
+
```bicep
43
+
@description('The full ARM Bing Resource ID. This is an optional field, and if not provided, the resource will be created.')
44
+
param bingSearchResourceID string = ''
45
+
```
38
46
39
-
Alternatively, you can create the resource through Azure CLI. By using this method, you automatically agree to be bound by and comply with the [Terms of use and Use and Display Requirements](https://www.microsoft.com/en-us/bing/apis/grounding-legal).
40
47
41
-
Make sure you create this Grounding with Bing Search resource in the same resource group as your Azure AI Agent, AI Project, and other resources.
48
+
Alternatively, you can also follow the step-by-step guide below:
42
49
43
-
1. Ensure you have logged in to Azure, using `az login`
50
+
1. Create a standard Azure AI Agent by following the steps in the [quickstart](../../quickstart.md).
51
+
52
+
1. Register the Bing Search provider.
44
53
45
-
1. Register the Bing Search provider
46
54
```console
47
55
az provider register --namespace 'Microsoft.Bing'
48
56
```
49
57
50
-
1. Create the resource.
51
-
52
-
```console
53
-
az deployment group create
54
-
--name "$deployment_name"
55
-
--resource-group "$resource_group"
56
-
--template-file "$path_to_arm_template_file"
57
-
--parameters "$path_to_parameters_file";
58
-
```
59
-
An example of the CLI command:
60
-
```console
61
-
az deployment group create
62
-
--name az-cli-ARM-TEST
63
-
--resource-group ApiSearch-Test-WestUS2
64
-
--template-file bingsearch_arm.json
65
-
--parameters bingsearch_para.json
66
-
```
58
+
1. Create a new Grounding with Bing Search resource in the [Azure portal](https://portal.azure.com/#create/Microsoft.BingGroundingSearch), and select the different fields in the creation form. Make sure you create this Grounding with Bing Search resource in the same resource group as your Azure AI Agent, AI Project, and other resources.
67
59
68
-
1. After you have created a Grounding with Bing Search resource, you can find it in [Azure portal](https://portal.azure.com/#home). Going to the resource group you have created the resource at, search for the Grounding with Bing Search resource you have created.
60
+
1. After you have created a Grounding with Bing Search resource, you can find it in [Azure portal](https://portal.azure.com/#home). Navigate to the resource group you've created the resource in, search for the Grounding with Bing Search resource you have created.
69
61
70
62
:::image type="content" source="../../media/tools/bing/resource-azure-portal.png" alt-text="A screenshot of the Bing resource in the Azure portal." lightbox="../../media/tools/bing/resource-azure-portal.png":::
71
63
72
64
1. Select the Grounding with Bing Search resource you have created and copy any of the API keys.
73
65
74
66
:::image type="content" source="../../media/tools/bing/key-endpoint-resource-azure-portal.png" alt-text="A screenshot of the key and endpoint screen for the Bing resource in the Azure portal." lightbox="../../media/tools/bing/key-endpoint-resource-azure-portal.png":::
75
67
76
-
77
-
78
-
1. Go to [Azure AI Studio](https://ai.azure.com/) and select the AI Project (make sure it's in the same resource group of your Grounding with Bing Search resource). Click **Settings**.
68
+
1. Go to the [Azure AI Foundry portal](https://ai.azure.com/) and select the AI Project (make sure it's in the same resource group of your Grounding with Bing Search resource). Click **connected resources**.
79
69
80
70
:::image type="content" source="../../media/tools/bing/project-settings-button.png" alt-text="A screenshot of the settings button for an AI project." lightbox="../../media/tools/bing/project-settings-button.png":::
81
71
@@ -102,6 +92,12 @@ Developers and end users don't have access to raw content returned from Groundin
102
92
103
93
According to Grounding with Bing's [terms of use and use and display requirements](https://www.microsoft.com/en-us/bing/apis/grounding-legal#use-and-display-requirements), you need to display both website URLs and Bing search query URLs in your custom interface. You can find website URLs through `annotations` parameter in API response and Bing search query URLs through `runstep` details.
@@ -114,7 +110,7 @@ Your use of Grounding with Bing Search will be governed by the Terms of Use. By
114
110
115
111
::: zone pivot="code-example"
116
112
117
-
## Step 1: Create an agent with bing grounding
113
+
## Step 1: Create an agent with Grounding with Bing Search
118
114
119
115
Create a client object, which will contain the connection string for connecting to your AI project and other resources.
120
116
@@ -159,9 +155,9 @@ var projectClient = new AIProjectClient(connectionString, new DefaultAzureCreden
159
155
160
156
---
161
157
162
-
## Step 2: Enable the Bing search tool
158
+
## Step 2: Enable the Grounding with Bing search tool
163
159
164
-
To make the Bing search tool available to your agent, create a Bing connection to initialize the Bing search tool and attach it to the agent.
160
+
To make the Grounding with Bing search tool available to your agent, use a connection to initialize the tool and attach it to the agent. You can find your connection in the **connected resources** section of your project in the Azure AI Foundry portal.
0 commit comments