Skip to content

Commit 6d441d4

Browse files
Merge pull request #6548 from MicrosoftDocs/main
Auto Publish – main to live - 2025-08-13 05:03 UTC
2 parents ebf24ba + 239708f commit 6d441d4

File tree

10 files changed

+103
-84
lines changed

10 files changed

+103
-84
lines changed

articles/ai-foundry/agents/how-to/tools/browser-automation-samples.md

Lines changed: 78 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ Use this article to find step-by-step instructions and code samples for using th
2828
* The following packages:
2929

3030
```console
31-
pip install --pre azure-ai-projects
32-
pip install azure-ai-agents==1.2.0b1
31+
pip install --pre azure-ai-agents>=1.2.0b2
32+
pip install azure-ai-projects
3333
pip install azure-identity
3434
```
3535
* The **contributor** role assigned to your AI Foundry project from within your Playwright workplace.
36-
* Your playwright connection ID. You can find it in the Azure AI Foundry portal by selecting **Management center** from the left navigation menu. Then select **Connected resources**. The URI should start with `wss://` instead of `https://` if presented.
36+
* Your Playwright connection ID. You can find it in the Azure AI Foundry portal by selecting **Management center** from the left navigation menu. Then select **Connected resources**. The URI should start with `wss://` instead of `https://` if presented.
3737
3838
<!--
3939
:::image type="content" source="../../media/tools/deep-research/bing-resource-name.png" alt-text="A screenshot showing the Playwright connection. " lightbox="../../media/tools/deep-research/bing-resource-name.png":::
4040
-->
41-
Save this name to an environment variable named `PLAYWRIGHT_CONNECTION_NAME`.
41+
Save this name to an environment variable named `AZURE_PLAYWRIGHT_CONNECTION_NAME`.
4242

4343
* [!INCLUDE [model-name-portal](../../includes/model-name-portal.md)]
4444

@@ -48,87 +48,105 @@ Use this article to find step-by-step instructions and code samples for using th
4848

4949
```python
5050
import os
51-
from azure.identity import DefaultAzureCredential
52-
from azure.ai.agents import AgentsClient
53-
from azure.ai.agents.models import MessageRole
5451
from azure.ai.projects import AIProjectClient
52+
from azure.ai.agents.models import (
53+
MessageRole,
54+
RunStepToolCallDetails,
55+
BrowserAutomationTool,
56+
RunStepBrowserAutomationToolCall,
57+
)
58+
from azure.identity import DefaultAzureCredential
5559

56-
project_endpoint = os.environ["PROJECT_ENDPOINT"] # Ensure the PROJECT_ENDPOINT environment variable is set
60+
project_client = AIProjectClient(endpoint=os.environ["PROJECT_ENDPOINT"], credential=DefaultAzureCredential())
5761

58-
project_client = AIProjectClient(
59-
endpoint=project_endpoint,
60-
credential=DefaultAzureCredential()
61-
)
62+
connection_id = os.environ["AZURE_PLAYWRIGHT_CONNECTION_ID"]
6263

63-
playwright_connection = project_client.connections.get(
64-
name=os.environ["PLAYWRIGHT_CONNECTION_NAME"]
65-
)
66-
print(playwright_connection.id)
64+
# Initialize Browser Automation tool and add the connection id
65+
browser_automation = BrowserAutomationTool(connection_id=connection_id)
6766

6867
with project_client:
69-
agent = project_client.agents.create_agent(
70-
model=os.environ["MODEL_DEPLOYMENT_NAME"],
71-
name="my-agent",
72-
instructions="use the tool to respond",
73-
tools=[{
74-
"type": "browser_automation",
75-
"browser_automation": {
76-
"connection": {
77-
"id": playwright_connection.id,
78-
}
79-
}
80-
}],
68+
69+
agents_client = project_client.agents
70+
71+
# Create a new Agent that has the Browser Automation tool attached.
72+
# Note: To add Browser Automation tool to an existing Agent with an `agent_id`, do the following:
73+
# agent = agents_client.update_agent(agent_id, tools=browser_automation.definitions)
74+
agent = agents_client.create_agent(
75+
model=os.environ["MODEL_DEPLOYMENT_NAME"],
76+
name="my-agent",
77+
instructions="""
78+
You are an Agent helping with browser automation tasks.
79+
You can answer questions, provide information, and assist with various tasks
80+
related to web browsing using the Browser Automation tool available to you.
81+
""",
82+
tools=browser_automation.definitions,
8183
)
8284

85+
8386
print(f"Created agent, ID: {agent.id}")
8487

85-
thread = project_client.agents.threads.create()
86-
print(f"Created thread and run, ID: {thread.id}")
88+
# Create thread for communication
89+
thread = agents_client.threads.create()
90+
print(f"Created thread, ID: {thread.id}")
8791

8892
# Create message to thread
89-
message = project_client.agents.messages.create(
90-
thread_id=thread.id,
91-
role="user",
92-
content="something you want the tool to perform")
93-
print(f"Created message: {message['id']}")
94-
95-
# Create and process an Agent run in thread with tools
96-
run = project_client.agents.runs.create_and_process(
97-
thread_id=thread.id,
98-
agent_id=agent.id,
99-
)
100-
print(f"Run created, ID: {run.id}")
93+
message = agents_client.messages.create(
94+
thread_id=thread.id,
95+
role=MessageRole.USER,
96+
content="""
97+
Your goal is to report the percent of Microsoft year-to-date stock price change.
98+
To do that, go to the website finance.yahoo.com.
99+
At the top of the page, you will find a search bar.
100+
Enter the value 'MSFT', to get information about the Microsoft stock price.
101+
At the top of the resulting page you will see a default chart of Microsoft stock price.
102+
Click on 'YTD' at the top of that chart, and report the percent value that shows up just below it.
103+
""",
104+
)
105+
print(f"Created message, ID: {message.id}")
106+
107+
# Create and process agent run in thread with tools
108+
print(f"Waiting for Agent run to complete. Please wait...")
109+
run = agents_client.runs.create_and_process(thread_id=thread.id, agent_id=agent.id)
101110
print(f"Run finished with status: {run.status}")
102111

103112
if run.status == "failed":
104113
print(f"Run failed: {run.last_error}")
105114

106-
run_steps = project_client.agents.run_steps.list(thread_id=thread.id, run_id=run.id)
115+
# Fetch run steps to get the details of the agent run
116+
run_steps = agents_client.run_steps.list(thread_id=thread.id, run_id=run.id)
107117
for step in run_steps:
108-
print(step)
109-
print(f"Step {step['id']} status: {step['status']}")
118+
print(f"Step {step.id} status: {step.status}")
110119

111-
# Check if there are tool calls in the step details
112-
step_details = step.get("step_details", {})
113-
tool_calls = step_details.get("tool_calls", [])
114-
115-
if tool_calls:
120+
if isinstance(step.step_details, RunStepToolCallDetails):
116121
print(" Tool calls:")
122+
tool_calls = step.step_details.tool_calls
123+
117124
for call in tool_calls:
118-
print(f" Tool Call ID: {call.get('id')}")
119-
print(f" Type: {call.get('type')}")
125+
print(f" Tool call ID: {call.id}")
126+
print(f" Tool call type: {call.type}")
127+
128+
if isinstance(call, RunStepBrowserAutomationToolCall):
129+
print(f" Browser automation input: {call.browser_automation.input}")
130+
print(f" Browser automation output: {call.browser_automation.output}")
131+
132+
print(" Steps:")
133+
for tool_step in call.browser_automation.steps:
134+
print(f" Last step result: {tool_step.last_step_result}")
135+
print(f" Current state: {tool_step.current_state}")
136+
print(f" Next step: {tool_step.next_step}")
137+
print() # add an extra newline between tool steps
138+
139+
print() # add an extra newline between tool calls
120140

121-
function_details = call.get("function", {})
122-
if function_details:
123-
print(f" Function name: {function_details.get('name')}")
124-
print() # add an extra newline between steps
141+
print() # add an extra newline between run steps
125142

126-
# Delete the Agent when done
127-
project_client.agents.delete_agent(agent.id)
143+
# Optional: Delete the agent once the run is finished.
144+
# Comment out this line if you plan to reuse the agent later.
145+
agents_client.delete_agent(agent.id)
128146
print("Deleted agent")
129147

130-
# Fetch and log all messages
131-
response_message = project_client.agents.messages.get_last_message_by_role(thread_id=thread.id, role=MessageRole.AGENT)
148+
# Print the Agent's response message with optional citation
149+
response_message = agents_client.messages.get_last_message_by_role(thread_id=thread.id, role=MessageRole.AGENT)
132150
if response_message:
133151
for text_message in response_message.text_messages:
134152
print(f"Agent response: {text_message.text.value}")

articles/ai-foundry/agents/how-to/tools/browser-automation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ An example flow would be:
6363

6464
For more information on getting this value, see the [PlayWright documentation](https://aka.ms/pww/docs/configure-service-endpoint)
6565

66-
1. * **Key**: [Get the Playwright access token](https://aka.ms/pww/docs/generate-access-token)
66+
* **Key**: [Get the Playwright access token](https://aka.ms/pww/docs/generate-access-token)
6767

6868
For more information on creating a connection, see [Create a connection](../../../how-to/connections-add.md?pivots=fdp-project).
6969

70-
1. Create a Browser Automation tool with your connection ID.
70+
1. Configure your client by adding a Browser Automation tool using the Azure Playwright connection ID.
7171

7272
## Transparency note
7373

articles/ai-foundry/openai/audio-completions-quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Walkthrough on how to get started with audio generation using Azure
55
manager: nitinme
66
ms.service: azure-ai-openai
77
ms.topic: how-to
8-
ms.date: 5/23/2025
8+
ms.date: 8/13/2025
99
author: eric-urban
1010
ms.author: eur
1111
ms.custom: references_regions

articles/ai-foundry/openai/includes/whisper-python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.date: 3/19/2024
1212
- An Azure subscription. You can [create one for free](https://azure.microsoft.com/free/cognitive-services?azure-portal=true).
1313
- An Azure OpenAI resource with a speech to text model deployed in a [supported region](../concepts/models.md?tabs=standard-audio#standard-deployment-regional-models-by-endpoint). For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
1414
- [Python 3.8 or later](https://www.python.org)
15-
- The following Python library: os
15+
- The `os` Python library.
1616

1717
## Set up
1818

articles/ai-foundry/openai/text-to-speech-quickstart.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
22
title: 'Text to speech with Azure OpenAI in Azure AI Foundry Models'
33
titleSuffix: Azure OpenAI
4-
description: Use the Azure OpenAI for text to speech with OpenAI voices.
4+
description: Use Azure OpenAI for text to speech with OpenAI voices.
55
manager: nitinme
66
ms.service: azure-ai-openai
77
ms.topic: quickstart
8-
ms.date: 5/23/2025
8+
ms.date: 8/13/2025
99
ms.reviewer: eur
1010
ms.author: eur
1111
author: eric-urban
1212
recommendations: false
1313
zone_pivot_groups: programming-languages-rest-js-cs
1414
---
1515

16-
# Quickstart: Text to speech with the Azure OpenAI in Azure AI Foundry Models
16+
# Quickstart: Text to speech with Azure OpenAI in Azure AI Foundry Models
1717

18-
In this quickstart, you use the Azure OpenAI for text to speech with OpenAI voices.
18+
In this quickstart, you use Azure OpenAI for text to speech with OpenAI voices.
1919

2020
The available voices are: `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`. For more information, see [Azure OpenAI reference documentation for text to speech](./reference.md#text-to-speech-preview).
2121

articles/ai-foundry/openai/whisper-quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ manager: nitinme
66
ms.service: azure-ai-openai
77
ms.custom: devx-track-python
88
ms.topic: quickstart
9-
ms.date: 5/23/2025
9+
ms.date: 8/13/2025
1010
ms.reviewer: eur
1111
ms.author: eur
1212
author: eric-urban

articles/ai-services/speech-service/custom-speech-overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: eric-urban
66
manager: nitinme
77
ms.service: azure-ai-speech
88
ms.topic: overview
9-
ms.date: 2/25/2025
9+
ms.date: 8/13/2025
1010
ms.author: eur
1111
ms.custom: references_regions
1212
---
@@ -29,7 +29,7 @@ With custom speech, you can upload your own data, test and train a custom model,
2929

3030
Here's more information about the sequence of steps shown in the previous diagram:
3131

32-
1. [Create a project](how-to-custom-speech-create-project.md) and choose a model. Use a <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesAIFoundry" title="Create an AI Foundry resource for Speech" target="_blank">Speech resource</a> that you create in the Azure portal. If you train a custom model with audio data, select a service resource in a region with dedicated hardware for training audio data. For more information, see footnotes in the [regions](regions.md#regions) table.
32+
1. [Create a project](how-to-custom-speech-create-project.md) and choose a model. If you train a custom model with audio data, select a service resource in a region with dedicated hardware for training audio data. For more information, see footnotes in the [regions](regions.md#regions) table.
3333

3434
1. [Upload test data](./how-to-custom-speech-upload-data.md). Upload test data to evaluate the speech to text offering for your applications, tools, and products.
3535

articles/ai-services/speech-service/how-to-configure-azure-ad-auth.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@ author: eric-urban
66
manager: nitinme
77
ms.service: azure-ai-speech
88
ms.topic: how-to
9-
ms.date: 2/7/2025
9+
ms.date: 8/13/2025
1010
ms.author: eur
1111
zone_pivot_groups: programming-languages-set-two
1212
ms.custom: devx-track-azurepowershell, devx-track-extended-java, devx-track-python, devx-track-azurecli
1313
---
1414

1515
# Microsoft Entra authentication with the Speech SDK
1616

17-
When using the Speech SDK to access the Speech service, there are three authentication methods available: service keys, a key-based token, and Microsoft Entra ID. This article describes how to configure an AI Foundry resource for Speech and create a Speech SDK configuration object to use Microsoft Entra ID for authentication.
17+
When using the Speech SDK to access the Speech service, there are three authentication methods available: service keys, a key-based token, and Microsoft Entra ID. This article describes how to configure an AI Foundry resource and create a Speech SDK configuration object to use Microsoft Entra ID for authentication.
1818

1919
This article shows how to use Microsoft Entra authentication with the Speech SDK. You learn how to:
2020

2121
> [!div class="checklist"]
2222
>
23-
> - Create an AI Foundry resource for Speech
23+
> - Create an AI Foundry resource
2424
> - Configure the Speech resource for Microsoft Entra authentication
2525
> - Get a Microsoft Entra access token
2626
> - Create the appropriate SDK configuration object.
2727
2828
To learn more about Microsoft Entra access tokens, including token lifetime, visit [Access tokens in the Microsoft identity platform](/azure/active-directory/develop/access-tokens).
2929

30-
## Create an AI Foundry resource for Speech
31-
To create an AI Foundry resource for Speech in the [Azure portal](https://portal.azure.com), see [this quickstart](~/articles/ai-services/multi-service-resource.md?pivots=azportal).
30+
## Create an AI Foundry resource
31+
To create an AI Foundry resource in the [Azure portal](https://portal.azure.com), see [this quickstart](~/articles/ai-services/multi-service-resource.md?pivots=azportal).
3232

3333
<a name='configure-the-speech-resource-for-azure-ad-authentication'></a>
3434

@@ -128,7 +128,7 @@ You need your Speech resource ID to make SDK calls using Microsoft Entra authent
128128
To get the resource ID in the Azure portal:
129129

130130
1. Go to the [Azure portal](https://portal.azure.com/) and sign in to your Azure account.
131-
1. Select an AI Foundry resource for Speech.
131+
1. Select an AI Foundry resource.
132132
1. In the **Resource Management** group on the left pane, select **Properties**.
133133
1. Copy the **Resource ID**
134134

articles/ai-services/speech-service/openai-voices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: eric-urban
66
ms.author: eur
77
manager: nitinme
88
ms.reviewer: eur
9-
ms.date: 2/22/2025
9+
ms.date: 8/13/2025
1010
ms.service: azure-ai-speech
1111
ms.topic: overview
1212
ms.custom:

articles/ai-services/translator/document-translation/how-to-guides/create-use-glossaries.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ A glossary is a list of terms with definitions that you create for the Document
1919

2020
* **Specify translations for ambiguous words**. Choose a specific translation for poly&#8203;semantic words.
2121

22-
* **Explicitly identify the source and target languages for each glossary term**. Also include any relevant localization requirements.
23-
24-
* **Conduct regular reviews of the glossary to verify term accuracy and relevance**. Consistently update entries as necessary.
25-
26-
* **Provide precise and comprehensive definitions for each term**. Pay particular attention to technical or specialized vocabulary.
2722

2823
## Create, upload, and use a glossary file
2924

@@ -65,7 +60,13 @@ By default, Azure AI Translator service API is **case-sensitive**, meaning that
6560

6661
### Ensure accuracy
6762

68-
Translation glossaries play an essential role in ensuring consistent and accurate terminology in multilingual localization projects. Applying a glossary during translation ensures that specific terms are translated according to the defined source and target language pair. Thus, it's important to define your glossary carefully and update it regularly to maintain precision and consistency.
63+
Translation glossaries play an essential role in ensuring consistent and accurate terminology in multilingual localization projects. Applying a glossary during translation ensures that specific terms are translated according to the defined source and target language pair. Thus, it's important to define your glossary carefully and update it regularly to maintain precision and consistency. Here are a few more tips:
64+
65+
* **Explicitly identify the source and target languages for each glossary term**. Also include any relevant localization requirements.
66+
67+
* **Conduct regular reviews of the glossary to verify term accuracy and relevance**. Consistently update entries as necessary.
68+
69+
* **Provide precise and comprehensive definitions for each term**. Pay particular attention to technical or specialized vocabulary.
6970

7071
## Next steps
7172

0 commit comments

Comments
 (0)