Skip to content

Commit fa333e6

Browse files
committed
Merge branch 'main' into release-aug-2025-search
2 parents 1af3e39 + b2bb629 commit fa333e6

40 files changed

+635
-1262
lines changed

articles/ai-foundry/concepts/ai-red-teaming-agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure AI Foundry
44
description: This article provides conceptual overview of the AI Red Teaming Agent.
55
ms.service: azure-ai-foundry
66
ms.topic: how-to
7-
ms.date: 04/04/2025
7+
ms.date: 08/29/2025
88
ms.reviewer: minthigpen
99
ms.author: lagayhar
1010
author: lgayhardt

articles/ai-foundry/concepts/safety-evaluations-transparency-note.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: azure-ai-foundry
66
ms.custom:
77
- build-2024
88
ms.topic: article
9-
ms.date: 06/30/2025
9+
ms.date: 08/31/2025
1010
ms.reviewer: mithigpe
1111
ms.author: lagayhar
1212
author: lgayhardt

articles/ai-foundry/how-to/develop/trace-application.md

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ titleSuffix: Azure AI Foundry
44
description: Learn how to trace applications that use OpenAI SDK in Azure AI Foundry
55
author: lgayhardt
66
ms.author: lagayhar
7-
ms.reviewer: amibp
8-
ms.date: 05/19/2025
7+
ms.reviewer: ychen
8+
ms.date: 08/29/2025
99
ms.service: azure-ai-foundry
1010
ms.topic: how-to
1111
---
1212

1313
# Trace AI applications using OpenAI SDK
1414

15-
Tracing provides deep visibility into execution of your application by capturing detailed telemetry at each execution step. Such helps diagnose issues and enhance performance by identifying problems such as inaccurate tool calls, misleading prompts, high latency, low-quality evaluation scores, and more.
15+
Tracing provides deep visibility into execution of your application by capturing detailed telemetry at each execution step. This helps diagnose issues and enhance performance by identifying problems such as inaccurate tool calls, misleading prompts, high latency, low-quality evaluation scores, and more.
1616

1717
This article explains how to implement tracing for AI applications using **OpenAI SDK** with OpenTelemetry in Azure AI Foundry.
1818

@@ -24,47 +24,45 @@ You need the following to complete this tutorial:
2424

2525
* An AI application that uses **OpenAI SDK** to make calls to models hosted in Azure AI Foundry.
2626

27-
2827
## Enable tracing in your project
2928

30-
Azure AI Foundry stores traces in Azure Application Insight resources using OpenTelemetry. By default, new Azure AI Foundry resources don't provision these resources. You can connect projects to an existing Azure Application Insights resource or create a new one from within the project. You do such configuration once per each Azure AI Foundry resource.
29+
Azure AI Foundry stores traces in Azure Application Insights resources using OpenTelemetry. By default, new Azure AI Foundry resources don't provision these resources. You can connect projects to an existing Azure Application Insights resource or create a new one from within the project. You do this configuration once per each Azure AI Foundry resource.
3130

3231
The following steps show how to configure your resource:
3332

3433
1. Go to [Azure AI Foundry portal](https://ai.azure.com) and navigate to your project.
3534

36-
2. On the side navigation bar, select **Tracing**.
35+
1. On the side navigation bar, select **Tracing**.
3736

38-
3. If an Azure Application Insights resource isn't associated with your Azure AI Foundry resource, associate one.
37+
1. If an Azure Application Insights resource isn't associated with your Azure AI Foundry resource, associate one. If you already have an Application Insights resource associated, you won't see the enable page below and you can skip this step.
3938

4039
:::image type="content" source="../../media/how-to/develop/trace-application/configure-app-insight.png" alt-text="A screenshot showing how to configure Azure Application Insights to the Azure AI Foundry resource." lightbox="../../media/how-to/develop/trace-application/configure-app-insight.png":::
4140

42-
4. To reuse an existing Azure Application Insights, use the drop-down **Application Insights resource name** to locate the resource and select **Connect**.
41+
1. To reuse an existing Azure Application Insights, use the drop-down **Application Insights resource name** to locate the resource and select **Connect**.
4342

44-
> [!TIP]
45-
> To connect to an existing Azure Application Insights, you need at least contributor access to the Azure AI Foundry resource (or Hub).
43+
> [!TIP]
44+
> To connect to an existing Azure Application Insights, you need at least contributor access to the Azure AI Foundry resource (or Hub).
4645
47-
5. To connect to a new Azure Application Insights resource, select the option **Create new**.
46+
1. To connect to a new Azure Application Insights resource, select the option **Create new**.
4847

49-
1. Use the configuration wizard to configure the new resource's name.
48+
1. Use the configuration wizard to configure the new resource's name.
5049

51-
2. By default, the new resource is created in the same resource group where the Azure AI Foundry resource was created. Use the **Advance settings** option to configure a different resource group or subscription.
50+
1. By default, the new resource is created in the same resource group where the Azure AI Foundry resource was created. Use the **Advance settings** option to configure a different resource group or subscription.
5251

53-
> [!TIP]
54-
> To create a new Azure Application Insight resource, you also need contributor role to the resource group you selected (or the default one).
52+
> [!TIP]
53+
> To create a new Azure Application Insights resource, you also need contributor role to the resource group you selected (or the default one).
5554
56-
3. Select **Create** to create the resource and connect it to the Azure AI Foundry resource.
55+
1. Select **Create** to create the resource and connect it to the Azure AI Foundry resource.
5756

58-
4. Once the connection is configured, you are ready to use tracing in any project within the resource.
57+
1. Once the connection is configured, you're ready to use tracing in any project within the resource.
5958

60-
5. Go to the landing page of your project and copy the project's endpoint URI. You need it later in the tutorial.
59+
1. Go to the landing page of your project and copy the project's endpoint URI. You need it later.
6160

6261
:::image type="content" source="../../media/how-to/projects/fdp-project-overview.png" alt-text="A screenshot showing how to copy the project endpoint URI." lightbox="../../media/how-to/projects/fdp-project-overview.png":::
6362

6463
> [!IMPORTANT]
6564
> Using a project's endpoint requires configuring Microsoft Entra ID in your application. If you don't have Entra ID configured, use the Azure Application Insights connection string as indicated in step 3 of the tutorial.
6665
67-
6866
## Instrument the OpenAI SDK
6967

7068
When developing with the OpenAI SDK, you can instrument your code so traces are sent to Azure AI Foundry. Follow these steps to instrument your code:
@@ -129,15 +127,15 @@ When developing with the OpenAI SDK, you can instrument your code so traces are
129127

130128
:::image type="content" source="../../media/how-to/develop/trace-application/tracing-display-simple.png" alt-text="A screenshot showing how a simple chat completion request is displayed in the trace." lightbox="../../media/how-to/develop/trace-application/tracing-display-simple.png":::
131129

132-
1. It may be useful to capture sections of your code that mixes business logic with models when developing complex applications. OpenTelemetry uses the concept of spans to capture sections you're interested in. To start generating your own spans, get an instance of the current **tracer** object.
130+
1. It might be useful to capture sections of your code that mixes business logic with models when developing complex applications. OpenTelemetry uses the concept of spans to capture sections you're interested in. To start generating your own spans, get an instance of the current **tracer** object.
133131

134132
```python
135133
from opentelemetry import trace
136134

137135
tracer = trace.get_tracer(__name__)
138136
```
139137

140-
1. Then, use decorators in your method to capture specific scenarios in your code that you are interested in. Such decorators generate spans automatically. The following code example instruments a method called `assess_claims_with_context` with iterates over a list of claims and verify if the claim is supported by the context using an LLM. All the calls made in this method are captured within the same span:
138+
1. Then, use decorators in your method to capture specific scenarios in your code that you're interested in. These decorators generate spans automatically. The following code example instruments a method called `assess_claims_with_context` that iterates over a list of claims and verifies if the claim is supported by the context using an LLM. All the calls made in this method are captured within the same span:
141139

142140
```python
143141
def build_prompt_with_context(claim: str, context: str) -> str:
@@ -170,7 +168,7 @@ When developing with the OpenAI SDK, you can instrument your code so traces are
170168

171169
:::image type="content" source="../../media/how-to/develop/trace-application/tracing-display-decorator.png" alt-text="A screenshot showing how a method using a decorator is displayed in the trace." lightbox="../../media/how-to/develop/trace-application/tracing-display-decorator.png":::
172170

173-
1. You may also want to add extra information to the current span. OpenTelemetry uses the concept of **attributes** for that. Use the `trace` object to access them and include extra information. See how the `assess_claims_with_context` method has been modified to include an attribute:
171+
1. You might also want to add extra information to the current span. OpenTelemetry uses the concept of **attributes** for that. Use the `trace` object to access them and include extra information. See how the `assess_claims_with_context` method has been modified to include an attribute:
174172

175173
```python
176174
@tracer.start_as_current_span("assess_claims_with_context")
@@ -188,12 +186,11 @@ When developing with the OpenAI SDK, you can instrument your code so traces are
188186
responses.append(response.choices[0].message.content.strip('., '))
189187

190188
return responses
191-
```
192-
189+
```
193190

194191
## Trace to console
195192

196-
It may be useful to also trace your application and send the traces to the local execution console. Such approach may be beneficial when running unit tests or integration tests in your application using an automated CI/CD pipeline. Traces can be sent to the console and captured by your CI/CD tool to further analysis.
193+
It might be useful to also trace your application and send the traces to the local execution console. This approach might be beneficial when running unit tests or integration tests in your application using an automated CI/CD pipeline. Traces can be sent to the console and captured by your CI/CD tool for further analysis.
197194

198195
Configure tracing as follows:
199196

@@ -271,6 +268,6 @@ Configure tracing as follows:
271268
}
272269
```
273270

274-
## Next steps
271+
## Related content
275272

276273
* [Trace agents using Azure AI Foundry SDK](trace-agents-sdk.md)

articles/ai-foundry/how-to/view-ai-red-teaming-results.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: azure-ai-foundry
66
ms.custom:
77
- references_regions
88
ms.topic: how-to
9-
ms.date: 06/03/2025
9+
ms.date: 08/29/2025
1010
ms.reviewer: minthigpen
1111
ms.author: lagayhar
1212
author: lgayhardt

articles/ai-foundry/openai/concepts/provisioned-throughput.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The Azure AI Foundry provisioned throughput offering is a model deployment type
2121

2222
Provisioned throughput provides:
2323

24-
- **A boarder model choice** on the latest flagship models
24+
- **A broader model choice** on the latest flagship models
2525
- **Flexibility** to switch models and deployments with given provisioned throughput quota
2626
- **Significant discounts** and the ability to boost your reservation utilization with a more flexible reservation choice
2727
- **Predictable performance**, by providing stable max latency and throughput for uniform workloads.
@@ -224,4 +224,4 @@ The following points are some important takeaways from the table:
224224
## Related content
225225

226226
- [Learn about the onboarding steps for provisioned deployments](../how-to/provisioned-throughput-onboarding.md)
227-
- [Provisioned Throughput Units (PTU) getting started guide](../how-to//provisioned-get-started.md)
227+
- [Provisioned Throughput Units (PTU) getting started guide](../how-to//provisioned-get-started.md)

articles/ai-foundry/openai/how-to/chatgpt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ ms.author: mbullwin #delegenz
77
ms.service: azure-ai-openai
88
ms.custom: build-2023, build-2023-dataai, devx-track-python
99
ms.topic: how-to
10-
ms.date: 07/02/2025
10+
ms.date: 09/01/2025
1111
manager: nitinme
1212
keywords: ChatGPT
1313
---
1414

1515
# Work with chat completions models
1616

17-
GPT-3.5-Turbo, GPT-4, and GPT-4o series models are language models that are optimized for conversational interfaces. The models behave differently than the older GPT-3 models. Previous models were text-in and text-out, which means they accepted a prompt string and returned a completion to append to the prompt. However, the latest models are conversation-in and message-out. The models expect input formatted in a specific chat-like transcript format. They return a completion that represents a model-written message in the chat. This format was designed specifically for multi-turn conversations, but it can also work well for nonchat scenarios.
17+
Chat models are language models that are optimized for conversational interfaces. The models behave differently than the older GPT-3 models. Previous models were text-in and text-out, which means they accepted a prompt string and returned a completion to append to the prompt. However, the latest models are conversation-in and message-out. The models expect input formatted in a specific chat-like transcript format. They return a completion that represents a model-written message in the chat. This format was designed specifically for multi-turn conversations, but it can also work well for nonchat scenarios.
1818

1919
This article walks you through getting started with chat completions models. To get the best results, use the techniques described here. Don't try to interact with the models the same way you did with the older model series because the models are often verbose and provide less useful responses.
2020

articles/ai-foundry/openai/how-to/embeddings.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,57 @@ ReadOnlyMemory<float> vector = embedding.ToFloats();
7070
Console.WriteLine($"Embeddings: [{string.Join(", ", vector.ToArray())}]");
7171
```
7272

73+
# [Go](#tab/go)
74+
75+
```go
76+
package main
77+
78+
import (
79+
"context"
80+
"fmt"
81+
"os"
82+
83+
"github.com/openai/openai-go/v2"
84+
"github.com/openai/openai-go/v2/option"
85+
)
86+
87+
func main() {
88+
// Get API key from environment variable
89+
apiKey := os.Getenv("AZURE_OPENAI_API_KEY")
90+
if apiKey == "" {
91+
panic("AZURE_OPENAI_API_KEY environment variable is not set")
92+
}
93+
94+
// Create a client with Azure OpenAI endpoint and API key
95+
client := openai.NewClient(
96+
option.WithBaseURL("https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/"),
97+
option.WithAPIKey(apiKey),
98+
)
99+
100+
ctx := context.Background()
101+
text := "The attention mechanism revolutionized natural language processing"
102+
103+
// Make an embedding request
104+
embedding, err := client.Embeddings.New(ctx, openai.EmbeddingNewParams{
105+
Input: openai.EmbeddingNewParamsInputUnion{OfString: openai.String(text)},
106+
Model: "text-embedding-3-large", // Use your deployed model name on Azure
107+
})
108+
if err != nil {
109+
panic(err.Error())
110+
}
111+
112+
// Print embedding information
113+
fmt.Printf("Model: %s\n", embedding.Model)
114+
fmt.Printf("Number of embeddings: %d\n", len(embedding.Data))
115+
fmt.Printf("Embedding dimensions: %d\n", len(embedding.Data[0].Embedding))
116+
fmt.Printf("Usage - Prompt tokens: %d, Total tokens: %d\n", embedding.Usage.PromptTokens, embedding.Usage.TotalTokens)
117+
118+
// Print first few values of the embedding vector
119+
fmt.Printf("First 10 embedding values: %v\n", embedding.Data[0].Embedding[:10])
120+
}
121+
```
122+
123+
73124
# [PowerShell](#tab/PowerShell)
74125

75126
```powershell-interactive

articles/ai-foundry/openai/includes/chat-completion.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: mrbullwinkle #dereklegenzoff
66
ms.author: mbullwin #delegenz
77
ms.service: azure-ai-openai
88
ms.topic: include
9-
ms.date: 08/29/2024
9+
ms.date: 09/01/2025
1010
manager: nitinme
1111
keywords: ChatGPT
1212

@@ -19,12 +19,11 @@ The following code snippet shows the most basic way to interact with models that
1919

2020
```python
2121
import os
22-
from openai import AzureOpenAI
22+
from openai import OpenAI
2323

24-
client = AzureOpenAI(
24+
client = OpenAI(
2525
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
26-
api_version = "2024-10-21",
27-
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
26+
base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/"
2827
)
2928

3029
response = client.chat.completions.create(
@@ -238,12 +237,11 @@ Every time a new question is asked, a running transcript of the conversation so
238237

239238
```python
240239
import os
241-
from openai import AzureOpenAI
240+
from openai import OpenAI
242241

243-
client = AzureOpenAI(
242+
client = OpenAI(
244243
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
245-
api_version = "2024-10-21",
246-
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT") # Your Azure OpenAI resource's endpoint value.
244+
base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/"
247245
)
248246

249247
conversation=[{"role": "system", "content": "You are a helpful assistant."}]
@@ -279,12 +277,11 @@ The code uses tiktoken `0.5.1`. If you have an older version, run `pip install t
279277
```python
280278
import tiktoken
281279
import os
282-
from openai import AzureOpenAI
280+
from openai import OpenAI
283281

284-
client = AzureOpenAI(
282+
client = OpenAI(
285283
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
286-
api_version = "2024-10-21",
287-
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT") # Your Azure OpenAI resource's endpoint value.
284+
base_url="https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/"
288285
)
289286

290287
system_message = {"role": "system", "content": "You are a helpful assistant."}

articles/ai-foundry/openai/includes/embeddings-powershell.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,17 @@ Create and assign persistent environment variables for your key and endpoint.
3535
setx AZURE_OPENAI_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE"
3636
```
3737

38-
```CMD
39-
setx AZURE_OPENAI_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE"
40-
```
41-
4238
# [PowerShell](#tab/powershell)
4339

4440
```powershell-interactive
4541
$Env:AZURE_OPENAI_API_KEY = '<YOUR_KEY_VALUE>'
46-
$Env:AZURE_OPENAI_ENDPOINT = '<YOUR_ENDPOINT>'
4742
$Env:AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT = '<YOUR_DEPLOYMENT_NAME>'
4843
```
4944

5045
# [Bash](#tab/bash)
5146

5247
```Bash
5348
echo export AZURE_OPENAI_API_KEY="<YOUR_KEY_VALUE>" >> /etc/environment
54-
echo export AZURE_OPENAI_ENDPOINT="<YOUR_ENDPOINT>" >> /etc/environment
5549
echo export AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT="<YOUR_DEPLOYMENT_NAME>" >> /etc/environment
5650
source /etc/environment
5751
```
@@ -193,16 +187,15 @@ the token count is more than the prompt limit for the model.
193187
# Azure OpenAI metadata variables
194188
$openai = @{
195189
api_key = $Env:AZURE_OPENAI_API_KEY
196-
api_base = $Env:AZURE_OPENAI_ENDPOINT # should look like 'https://<YOUR_RESOURCE_NAME>.openai.azure.com/'
197-
api_version = '2024-02-01' # may change in the future
190+
api_base = 'https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/'
198191
name = $Env:AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT # custom name you chose for your deployment
199192
}
200193
201194
$headers = [ordered]@{
202195
'api-key' = $openai.api_key
203196
}
204197
205-
$url = "$($openai.api_base)/openai/deployments/$($openai.name)/embeddings?api-version=$($openai.api_version)"
198+
$url = "$($openai.api_base)/embeddings"
206199
207200
$Datatable | ForEach-Object {
208201
$doc = $_

0 commit comments

Comments
 (0)