From f2df61f167a38ecb1d13b1f4e5f412cbdd20206a Mon Sep 17 00:00:00 2001 From: Linda Li <139801625+lindazqli@users.noreply.github.com> Date: Fri, 11 Apr 2025 11:25:38 -0700 Subject: [PATCH] Update bing-python.py --- scenarios/Agents/samples/bing-search/bing-python.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scenarios/Agents/samples/bing-search/bing-python.py b/scenarios/Agents/samples/bing-search/bing-python.py index feb803c2..60cf9d3e 100644 --- a/scenarios/Agents/samples/bing-search/bing-python.py +++ b/scenarios/Agents/samples/bing-search/bing-python.py @@ -23,7 +23,7 @@ BING_CONNECTION_NAME - the name of the connection of Grounding with Bing Search """ - +# import os from azure.ai.projects import AIProjectClient from azure.identity import DefaultAzureCredential @@ -38,7 +38,9 @@ credential=DefaultAzureCredential(), conn_str=os.environ["PROJECT_CONNECTION_STRING"], ) +# +# bing_connection = project_client.connections.get(connection_name=os.environ["CONNECTION_NAME"]) conn_id = bing_connection.id @@ -57,7 +59,9 @@ headers={"x-ms-enable-preview": "true"}, ) print(f"Created agent, ID: {agent.id}") +# +# # Create thread for communication thread = project_client.agents.create_thread() print(f"Created thread, ID: {thread.id}") @@ -69,7 +73,9 @@ content="How is the weather in Seattle today?", ) print(f"Created message, ID: {message.id}") +# +# # Create and process agent run in thread with tools run = project_client.agents.create_and_process_run(thread_id=thread.id, agent_id=agent.id) print(f"Run finished with status: {run.status}") @@ -84,3 +90,4 @@ # Fetch and log all messages messages = project_client.agents.list_messages(thread_id=thread.id) print(f"Messages: {messages}") +#