Skip to content

Commit cbcdab8

Browse files
authored
Merge pull request #4007 from MicrosoftDocs/main
4/9/2025 AM Publish
2 parents f1e6779 + ec7fe80 commit cbcdab8

File tree

83 files changed

+2394
-1177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2394
-1177
lines changed

articles/ai-foundry/concepts/models-featured.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ For more examples of how to use Phi-3 family models, see the following examples:
240240

241241
Mistral AI offers two categories of models, namely:
242242

243-
- _Premium models_: These include Mistral Large, Mistral Small, and Ministral 3B models, and are available as serverless APIs with pay-as-you-go token-based billing.
243+
- _Premium models_: These include Mistral Large, Mistral Small, Mistral-OCR-2503, and Ministral 3B models, and are available as serverless APIs with pay-as-you-go token-based billing.
244244
- _Open models_: These include Mistral-small-2503, Codestral, and Mistral Nemo (that are available as serverless APIs with pay-as-you-go token-based billing), and [Mixtral-8x7B-Instruct-v01, Mixtral-8x7B-v01, Mistral-7B-Instruct-v01, and Mistral-7B-v01](../how-to/deploy-models-mistral-open.md)(that are available to download and run on self-hosted managed endpoints).
245245

246246

@@ -252,6 +252,7 @@ Mistral AI offers two categories of models, namely:
252252
| [Mistral-Large-2411](https://ai.azure.com/explore/models/Mistral-Large-2411/version/2/registry/azureml-mistral) | [chat-completion](../model-inference/how-to/use-chat-completions.md?context=/azure/ai-foundry/context/context) | - **Input:** text (128,000 tokens) <br /> - **Output:** text (4,096 tokens) <br /> - **Tool calling:** Yes <br /> - **Response formats:** Text, JSON |
253253
| [Mistral-large-2407](https://ai.azure.com/explore/models/Mistral-large-2407/version/1/registry/azureml-mistral) <br /> (deprecated) | [chat-completion](../model-inference/how-to/use-chat-completions.md?context=/azure/ai-foundry/context/context) | - **Input:** text (131,072 tokens) <br /> - **Output:** text (4,096 tokens) <br /> - **Tool calling:** Yes <br /> - **Response formats:** Text, JSON |
254254
| [Mistral-large](https://ai.azure.com/explore/models/Mistral-large/version/1/registry/azureml-mistral) <br /> (deprecated) | [chat-completion](../model-inference/how-to/use-chat-completions.md?context=/azure/ai-foundry/context/context) | - **Input:** text (32,768 tokens) <br /> - **Output:** text (4,096 tokens) <br /> - **Tool calling:** Yes <br /> - **Response formats:** Text, JSON |
255+
| [Mistral-OCR-2503](https://aka.ms/aistudio/landing/mistral-ocr-2503) | image to text | - **Input:** image or PDF pages (1,000 pages, max 50MB PDF file) <br> - **Output:** text <br /> - **Tool calling:** No <br /> - **Response formats:** Text, JSON, Markdown |
255256
| [Mistral-small-2503](https://aka.ms/aistudio/landing/mistral-small-2503) | [chat-completion (with images)](../model-inference/how-to/use-chat-multi-modal.md?context=/azure/ai-foundry/context/context) | - **Input:** text and images (131,072 tokens), <br> image-based tokens are 16px x 16px <br> blocks of the original images <br /> - **Output:** text (4,096 tokens) <br /> - **Tool calling:** Yes <br /> - **Response formats:** Text, JSON |
256257
| [Mistral-small](https://ai.azure.com/explore/models/Mistral-small/version/1/registry/azureml-mistral) | [chat-completion](../model-inference/how-to/use-chat-completions.md?context=/azure/ai-foundry/context/context) | - **Input:** text (32,768 tokens) <br /> - **Output:** text (4,096 tokens) <br /> - **Tool calling:** Yes <br /> - **Response formats:** Text, JSON |
257258

articles/ai-foundry/includes/region-availability-maas.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Phi-3-Medium-4K-Instruct <br> Phi-3-Medium-128K-Instruct | Not applicable | E
8888
| Model | Offer Availability Region | Hub/Project Region for Deployment | Hub/Project Region for Fine tuning |
8989
|---------|---------|---------|---------|
9090
Codestral-2501 | [Microsoft Managed Countries/Regions](/partner-center/marketplace/tax-details-marketplace#microsoft-managed-countriesregions) <br> Brazil <br> Hong Kong SAR <br> Israel | East US <br> East US 2 <br> North Central US <br> South Central US <br> Sweden Central <br> West US <br> West US 3 | Not available |
91+
Mistral OCR 25.03 | [Microsoft Managed Countries/Regions](/partner-center/marketplace/tax-details-marketplace#microsoft-managed-countriesregions) <br> Brazil <br> Hong Kong SAR <br> Israel | East US <br> East US 2 <br> North Central US <br> South Central US <br> Sweden Central <br> West US <br> West US 3 | Not available |
9192
Mistral Nemo | [Microsoft Managed Countries/Regions](/partner-center/marketplace/tax-details-marketplace#microsoft-managed-countriesregions) <br> Brazil <br> Hong Kong SAR <br> Israel | East US <br> East US 2 <br> North Central US <br> South Central US <br> Sweden Central <br> West US <br> West US 3 | East US 2 <br> East US <br> North Central US <br> South Central US <br> West US <br> West US 3 |
9293
Mistral Small 25.03 <br> Mistral Small | [Microsoft Managed Countries/Regions](/partner-center/marketplace/tax-details-marketplace#microsoft-managed-countriesregions) <br> Brazil <br> Hong Kong SAR <br> Israel | East US <br> East US 2 <br> North Central US <br> South Central US <br> Sweden Central <br> West US <br> West US 3 | Not available |
9394
Ministral-3B | [Microsoft Managed Countries/Regions](/partner-center/marketplace/tax-details-marketplace#microsoft-managed-countriesregions) <br> Brazil <br> Hong Kong SAR<br> Israel | East US <br> East US 2 <br> North Central US <br> South Central US <br> Sweden Central <br> West US <br> West US 3 | East US 2 <br> East US <br> North Central US <br> South Central US <br> West US <br> West US 3 |

articles/ai-services/agents/how-to/tools/bing-grounding.md

Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,13 @@ using Azure.Core;
136136
using Azure.Core.TestFramework;
137137
using NUnit.Framework;
138138

139-
var connectionString = TestEnvironment.AzureAICONNECTIONSTRING;
139+
var connectionString = System.Environment.GetEnvironmentVariable("PROJECT_CONNECTION_STRING");
140+
var modelDeploymentName = System.Environment.GetEnvironmentVariable("MODEL_DEPLOYMENT_NAME");
141+
var bingConnectionName = System.Environment.GetEnvironmentVariable("BING_CONNECTION_NAME");
140142

141-
var clientOptions = new AIProjectClientOptions();
142-
143-
// Adding the custom headers policy
144-
clientOptions.AddPolicy(new CustomHeadersPolicy(), HttpPipelinePosition.PerCall);
145-
var projectClient = new AIProjectClient(connectionString, new DefaultAzureCredential(), clientOptions);
143+
var projectClient = new AIProjectClient(connectionString, new DefaultAzureCredential());
146144

145+
AgentsClient agentClient = projectClient.GetAgentsClient();
147146
```
148147

149148
# [JavaScript](#tab/javascript)
@@ -202,23 +201,20 @@ with project_client:
202201
# [C#](#tab/csharp)
203202

204203
```csharp
205-
GetConnectionResponse bingConnection = await projectClient.GetConnectionsClient().GetConnectionAsync(TestEnvironment.BINGCONNECTIONNAME);
204+
ConnectionResponse bingConnection = projectClient.GetConnectionsClient().GetConnection(bingConnectionName);
206205
var connectionId = bingConnection.Id;
207206

208-
AgentsClient agentClient = projectClient.GetAgentsClient();
209-
210-
ToolConnectionList connectionList = new ToolConnectionList
207+
ToolConnectionList connectionList = new()
211208
{
212209
ConnectionList = { new ToolConnection(connectionId) }
213210
};
214-
BingGroundingToolDefinition bingGroundingTool = new BingGroundingToolDefinition(connectionList);
215-
216-
Response<Agent> agentResponse = await agentClient.CreateAgentAsync(
217-
model: "gpt-4o",
218-
name: "my-assistant",
219-
instructions: "You are a helpful assistant.",
220-
tools: new List<ToolDefinition> { bingGroundingTool });
221-
Agent agent = agentResponse.Value;
211+
BingGroundingToolDefinition bingGroundingTool = new(connectionList);
212+
213+
Agent agent = agentClient.CreateAgent(
214+
model: modelDeploymentName,
215+
name: "my-assistant",
216+
instructions: "You are a helpful assistant.",
217+
tools: [bingGroundingTool]);
222218
```
223219

224220
# [JavaScript](#tab/javascript)
@@ -285,16 +281,13 @@ print(f"Created message, ID: {message.id}")
285281
# [C#](#tab/csharp)
286282

287283
```csharp
288-
// Create thread for communication
289-
Response<AgentThread> threadResponse = await agentClient.CreateThreadAsync();
290-
AgentThread thread = threadResponse.Value;
284+
AgentThread thread = agentClient.CreateThread();
291285

292286
// Create message to thread
293-
Response<ThreadMessage> messageResponse = await agentClient.CreateMessageAsync(
287+
ThreadMessage message = agentClient.CreateMessage(
294288
thread.Id,
295289
MessageRole.User,
296290
"How does wikipedia explain Euler's Identity?");
297-
ThreadMessage message = messageResponse.Value;
298291
```
299292

300293
# [JavaScript](#tab/javascript)
@@ -312,6 +305,7 @@ await client.agents.createMessage(
312305
```
313306

314307
# [REST API](#tab/rest)
308+
315309
### Create a thread
316310

317311
```console
@@ -367,30 +361,46 @@ print(f"Messages: {messages}")
367361
# [C#](#tab/csharp)
368362

369363
```csharp
370-
// Run the agent
371-
Response<ThreadRun> runResponse = await agentClient.CreateRunAsync(thread, agent);
372364

365+
// Run the agent
366+
ThreadRun run = agentClient.CreateRun(thread, agent);
373367
do
374368
{
375-
await Task.Delay(TimeSpan.FromMilliseconds(500));
376-
runResponse = await agentClient.GetRunAsync(thread.Id, runResponse.Value.Id);
369+
Thread.Sleep(TimeSpan.FromMilliseconds(500));
370+
run = agentClient.GetRun(thread.Id, run.Id);
377371
}
378-
while (runResponse.Value.Status == RunStatus.Queued
379-
|| runResponse.Value.Status == RunStatus.InProgress);
372+
while (run.Status == RunStatus.Queued
373+
|| run.Status == RunStatus.InProgress);
374+
375+
Assert.AreEqual(
376+
RunStatus.Completed,
377+
run.Status,
378+
run.LastError?.Message);
380379

381-
Response<PageableList<ThreadMessage>> afterRunMessagesResponse
382-
= await agentClient.GetMessagesAsync(thread.Id);
383-
IReadOnlyList<ThreadMessage> messages = afterRunMessagesResponse.Value.Data;
380+
PageableList<ThreadMessage> messages = agentClient.GetMessages(
381+
threadId: thread.Id,
382+
order: ListSortOrder.Ascending
383+
);
384384

385-
// Note: messages iterate from newest to oldest, with the messages[0] being the most recent
386385
foreach (ThreadMessage threadMessage in messages)
387386
{
388387
Console.Write($"{threadMessage.CreatedAt:yyyy-MM-dd HH:mm:ss} - {threadMessage.Role,10}: ");
389388
foreach (MessageContent contentItem in threadMessage.ContentItems)
390389
{
391390
if (contentItem is MessageTextContent textItem)
392391
{
393-
Console.Write(textItem.Text);
392+
string response = textItem.Text;
393+
if (textItem.Annotations != null)
394+
{
395+
foreach (MessageTextAnnotation annotation in textItem.Annotations)
396+
{
397+
if (annotation is MessageTextUrlCitationAnnotation urlAnnotation)
398+
{
399+
response = response.Replace(urlAnnotation.Text, $" [{urlAnnotation.UrlCitation.Title}]({urlAnnotation.UrlCitation.Url})");
400+
}
401+
}
402+
}
403+
Console.Write($"Agent response: {response}");
394404
}
395405
else if (contentItem is MessageImageFileContent imageFileItem)
396406
{
@@ -399,6 +409,9 @@ foreach (ThreadMessage threadMessage in messages)
399409
Console.WriteLine();
400410
}
401411
}
412+
413+
agentClient.DeleteThread(threadId: thread.Id);
414+
agentClient.DeleteAgent(agentId: agent.Id);
402415
```
403416

404417
# [JavaScript](#tab/javascript)

articles/ai-services/agents/how-to/tools/fabric.md

Lines changed: 107 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services: cognitive-services
66
manager: nitinme
77
ms.service: azure-ai-agent-service
88
ms.topic: how-to
9-
ms.date: 02/25/2025
9+
ms.date: 04/07/2025
1010
author: aahill
1111
ms.author: aahi
1212
zone_pivot_groups: selection-fabric-data-agent
@@ -25,7 +25,7 @@ You need to first build and publish a Fabric data agent and then connect your Fa
2525

2626
|Azure AI foundry support | Python SDK | C# SDK | JavaScript SDK | REST API |Basic agent setup | Standard agent setup |
2727
|---------|---------|---------|---------|---------|---------|---------|
28-
| ✔️ | ✔️ | - | ✔️ | ✔️ | ✔️ | ✔️ |
28+
| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
2929

3030
## Prerequisites
3131
* You have created and published a Fabric data agent endpoint
@@ -60,14 +60,36 @@ You need to first build and publish a Fabric data agent and then connect your Fa
6060

6161
Create a client object, which will contain the connection string for connecting to your AI project and other resources.
6262

63+
# [C#](#tab/csharp)
64+
65+
```java
66+
var connectionString = System.Environment.GetEnvironmentVariable("PROJECT_CONNECTION_STRING");
67+
var modelDeploymentName = System.Environment.GetEnvironmentVariable("MODEL_DEPLOYMENT_NAME");
68+
var fabricConnectionName = System.Environment.GetEnvironmentVariable("FABRIC_CONNECTION_NAME");
69+
70+
var projectClient = new AIProjectClient(connectionString, new DefaultAzureCredential());
71+
72+
AgentsClient agentClient = projectClient.GetAgentsClient();
73+
```
74+
6375
# [Python](#tab/python)
6476

6577
```python
6678
import os
6779
from azure.ai.projects import AIProjectClient
6880
from azure.identity import DefaultAzureCredential
6981
from azure.ai.projects.models import FabricTool
82+
83+
# Create an Azure AI Client from a connection string, copied from your Azure AI Foundry project.
84+
# At the moment, it should be in the format "<HostName>;<AzureSubscriptionId>;<ResourceGroup>;<ProjectName>"
85+
# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
86+
87+
credential = DefaultAzureCredential()
88+
project_client = AIProjectClient.from_connection_string(
89+
credential=credential, conn_str=os.environ["PROJECT_CONNECTION_STRING"]
90+
)
7091
```
92+
7193
# [JavaScript](#tab/javascript)
7294

7395
```javascript
@@ -96,6 +118,25 @@ Follow the [REST API Quickstart](../../quickstart.md?pivots=rest-api) to set the
96118

97119
To make the Microsoft Fabric 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.
98120

121+
# [C#](#tab/csharp)
122+
123+
```csharp
124+
ConnectionResponse fabricConnection = projectClient.GetConnectionsClient().GetConnection(fabricConnectionName);
125+
var connectionId = fabricConnection.Id;
126+
127+
ToolConnectionList connectionList = new()
128+
{
129+
ConnectionList = { new ToolConnection(connectionId) }
130+
};
131+
MicrosoftFabricToolDefinition fabricTool = new(connectionList);
132+
133+
Agent agent = agentClient.CreateAgent(
134+
model: modelDeploymentName,
135+
name: "my-assistant",
136+
instructions: "You are a helpful assistant.",
137+
tools: [fabricTool]);
138+
139+
```
99140
# [Python](#tab/python)
100141

101142
```python
@@ -166,6 +207,18 @@ curl $AZURE_AI_AGENTS_ENDPOINT/assistants?api-version=2024-12-01-preview \
166207

167208
## Step 3: Create a thread
168209

210+
# [C#](#tab/csharp)
211+
212+
```csharp
213+
AgentThread thread = agentClient.CreateThread();
214+
215+
// Create message to thread
216+
ThreadMessage message = agentClient.CreateMessage(
217+
thread.Id,
218+
MessageRole.User,
219+
"What are the top 3 weather events with highest property damage?");
220+
```
221+
169222
# [Python](#tab/python)
170223

171224
```python
@@ -224,6 +277,58 @@ curl $AZURE_AI_AGENTS_ENDPOINT/threads/thread_abc123/messages?api-version=2024-1
224277

225278
Create a run and observe that the model uses the Fabric data agent tool to provide a response to the user's question.
226279

280+
# [C#](#tab/csharp)
281+
282+
```csharp
283+
// Run the agent
284+
ThreadRun run = agentClient.CreateRun(thread, agent);
285+
do
286+
{
287+
Thread.Sleep(TimeSpan.FromMilliseconds(500));
288+
run = agentClient.GetRun(thread.Id, run.Id);
289+
}
290+
while (run.Status == RunStatus.Queued
291+
|| run.Status == RunStatus.InProgress);
292+
293+
Assert.AreEqual(
294+
RunStatus.Completed,
295+
run.Status,
296+
run.LastError?.Message);
297+
298+
PageableList<ThreadMessage> messages = agentClient.GetMessages(
299+
threadId: thread.Id,
300+
order: ListSortOrder.Ascending
301+
);
302+
303+
foreach (ThreadMessage threadMessage in messages)
304+
{
305+
Console.Write($"{threadMessage.CreatedAt:yyyy-MM-dd HH:mm:ss} - {threadMessage.Role,10}: ");
306+
foreach (MessageContent contentItem in threadMessage.ContentItems)
307+
{
308+
if (contentItem is MessageTextContent textItem)
309+
{
310+
string response = textItem.Text;
311+
if (textItem.Annotations != null)
312+
{
313+
foreach (MessageTextAnnotation annotation in textItem.Annotations)
314+
{
315+
if (annotation is MessageTextUrlCitationAnnotation urlAnnotation)
316+
{
317+
response = response.Replace(urlAnnotation.Text, $" [{urlAnnotation.UrlCitation.Title}]({urlAnnotation.UrlCitation.Url})");
318+
}
319+
}
320+
}
321+
Console.Write($"Agent response: {response}");
322+
}
323+
else if (contentItem is MessageImageFileContent imageFileItem)
324+
{
325+
Console.Write($"<image from ID: {imageFileItem.FileId}");
326+
}
327+
Console.WriteLine();
328+
}
329+
}
330+
```
331+
227332
# [Python](#tab/python)
228333

229334
```python

articles/ai-services/content-safety/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ To use the Content Safety APIs, you must create your Azure AI Content Safety res
175175
| West US | ||| ||||||
176176
| West US 2 | | || ||||||
177177
| West US 3 | | || ||||||
178+
| Germany West Central | | | | |||| ||
179+
| Italy North | | | | |||| ||
178180
| FairFax - USGovArizona| | || | ||| ||
179181
| FairFax - USGovVirginia| | || | ||| ||
180182

0 commit comments

Comments
 (0)