File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
scenarios/Agents/samples/bing-search Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 2626import os
2727from azure .ai .projects import AIProjectClient
2828from azure .identity import DefaultAzureCredential
29- from azure .ai .projects . models import BingGroundingTool
29+ from azure .ai .projects import BingGroundingTool
3030
3131
3232# Create an Azure AI Client from a connection string, copied from your AI Studio project.
3333# At the moment, it should be in the format "<HostName>;<AzureSubscriptionId>;<ResourceGroup>;<HubName>"
3434# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
35-
35+ # connection string should be copied from the project in AI Studio
3636project_client = AIProjectClient .from_connection_string (
3737 credential = DefaultAzureCredential (),
3838 conn_str = os .environ ["PROJECT_CONNECTION_STRING" ],
3939)
4040
41- bing_connection = project_client .connections .get (
42- connection_name = os .environ ["CONNECTION_NAME" ]
43- )
41+ bing_connection = project_client .connections .get (connection_name = os .environ ["CONNECTION_NAME" ])
4442conn_id = bing_connection .id
4543
4644print (conn_id )
5553 name = "my-assistant" ,
5654 instructions = "You are a helpful assistant" ,
5755 tools = bing .definitions ,
58- headers = {"x-ms-enable-preview" : "true" }
56+ headers = {"x-ms-enable-preview" : "true" },
5957 )
6058 print (f"Created agent, ID: { agent .id } " )
6159
You can’t perform that action at this time.
0 commit comments