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
# How to use Grounding with Bing Custom Search (preview)
18
18
19
+
Use this article to find step-by-step instructions and code samples for using the Grounding with Bing Custom Search tool in the Azure AI Foundry Agent Service.
Save this endpoint to an environment variable named `PROJECT_ENDPOINT`.
49
+
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**.
51
+
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":::
53
+
54
+
Save this resource name to an environment variable named `BING_CUSTOM_CONNECTION_NAME`.
55
+
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
+
62
+
* The names of your model's deployment name. You can find it in **Models + Endpoints** in the left navigation menu.
63
+
64
+
:::image type="content" source="../../media/tools/model-deployment-portal.png" alt-text="A screenshot showing the model deployment screen the AI Foundry portal." lightbox="../../media/tools/model-deployment-portal.png":::
65
+
66
+
Save the name of your model deployment name as an environment variable named `MODEL_DEPLOYMENT_NAME`.
67
+
42
68
## Create a project client
43
69
44
70
Create a client object, which will contain the connection string for connecting to your AI project and other resources.
45
71
46
72
```python
47
73
import os
48
74
from azure.ai.projects import AIProjectClient
49
-
from azure.ai.projects.models import MessageRole, BingCustomSearchTool
50
75
from azure.identity import DefaultAzureCredential
76
+
from azure.ai.agents.models import BingCustomSearchTool
51
77
52
78
53
79
# Create an Azure AI Client from an endpoint, copied from your Azure AI Foundry project.
credential=DefaultAzureCredential(), # Use Azure Default Credential for authentication
61
-
api_version="latest",
86
+
credential=DefaultAzureCredential(),
62
87
)
63
88
```
64
89
65
90
66
91
## Create an Agent with the Grounding with Bing Custom Search tool enabled
67
92
68
-
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. You can find your connection in the **connected resources** section of your project in the [Azure AI Foundry portal](https://ai.azure.com/?cid=learnDocs).
93
+
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.
Copy file name to clipboardExpand all lines: articles/ai-foundry/agents/how-to/tools/deep-research-samples.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,9 +29,8 @@ Use this article to learn how to use the Deep Research tool with the Azure AI Pr
29
29
30
30
* Your Azure AI Foundry Project endpoint.
31
31
32
-
You can find your endpoint in the main project **overview** for your project in the [Azure AI Foundry portal](https://ai.azure.com/?cid=learnDocs), under **Endpoint and keys** > **Libraries** > **Azure AI Foundry**.
33
-
34
-
:::image type="content" source="../../media/quickstart/portal-endpoint-string.png" alt-text="A screenshot showing the endpoint in the Azure AI Foundry portal." lightbox="../../media/quickstart/portal-endpoint-string.png":::
Save this endpoint to an environment variable named `PROJECT_ENDPOINT`.
43
+
44
+
45
+
* The name of your Microsoft Fabric connection name. You can find it in the Azure AI Foundry portal by selecting **Management center** from the left navigation menu. Then selecting **Connected resources**.
Save this endpoint to an environment variable named `FABRIC_CONNECTION_ID`
50
+
51
+
52
+
* The names of your model's deployment name. You can find it in **Models + Endpoints** in the left navigation menu.
53
+
54
+
:::image type="content" source="../../media/tools/model-deployment-portal.png" alt-text="A screenshot showing the model deployment screen the AI Foundry portal." lightbox="../../media/tools/model-deployment-portal.png":::
55
+
56
+
Save the name of your model deployment name as an environment variable named `MODEL_DEPLOYMENT_NAME`.
57
+
37
58
## Setup
59
+
38
60
> [!NOTE]
39
61
> * The model you selected in Azure AI Foundry Agent setup is only used for agent orchestration and response generation. It doesn't impact which model Fabric data agent uses for NL2SQL operation.
40
62
> * To help your model invoke your Microsoft Fabric tool in the expected way, make sure you update agent instructions with descriptions of your Fabric data agent and what data it can access. An example is "for customer and product sales related data, please use the Fabric tool". We recommend using a smaller AI model such as `gpt-4o-mini`. You can also use `tool_choice` parameter in SDK or API to force Fabric tool to be invoked at each run.
@@ -65,7 +87,7 @@ You can add the Microsoft Fabric tool to an agent programmatically using the cod
65
87
:::image type="content" source="../../media\tools\fabric-foundry.png" alt-text="A screenshot showing the fabric connection in the Azure AI Foundry portal." lightbox="../../media\tools\fabric-foundry.png":::
66
88
67
89
:::zone-end
68
-
<!--
90
+
69
91
:::zone pivot="python"
70
92
71
93
## Create a project client
@@ -74,18 +96,17 @@ Create a client object, which will contain the connection string for connecting
74
96
75
97
```python
76
98
import os
77
-
from azure.identity import DefaultAzureCredential
78
99
from azure.ai.projects import AIProjectClient
79
-
from azure.ai.agents.models import FabricTool
100
+
from azure.identity import DefaultAzureCredential
101
+
from azure.ai.agents.models import FabricTool, ListSortOrder
80
102
81
103
# Retrieve the endpoint and credentials
82
104
project_endpoint = os.environ["PROJECT_ENDPOINT"] # Ensure the PROJECT_ENDPOINT environment variable is set
83
105
84
106
# Initialize the AIProjectClient
85
107
project_client = AIProjectClient(
86
108
endpoint=project_endpoint,
87
-
credential=DefaultAzureCredential(exclude_interactive_browser_credential=False), # Use Azure Default Credential for authentication
0 commit comments