Skip to content

Commit 4387a21

Browse files
committed
package updates
1 parent d124b62 commit 4387a21

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

articles/ai-services/openai/includes/structured-outputs-dotnet.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
## Getting started
22

3+
Add the following packages to your project to work with Azure OpenAI:
4+
5+
**[Azure.AI.OpenAI](https://www.nuget.org/packages/Azure.AI.OpenAI/)**: Provides an Azure OpenAI client with Azure specific functionality that builds on top of the standard [OpenAI](https://www.nuget.org/packages/OpenAI/) library dependency.
6+
**[Azure.Identity](https://www.nuget.org/packages/Azure.Identity)**: Provides Microsoft Entra ID token authentication support across the Azure SDK libraries.
7+
**[Newtonsoft.Json.Schema](https://www.nuget.org/packages/Newtonsoft.Json.Schema)**: Provides helpful utilities for working with JSON schemas.
8+
9+
```dotnetcli
10+
dotnet add package Azure.AI.OpenAI --prerelease
11+
dotnet add package Azure.Identity
12+
dotnet add package Newtonsoft.Json.Schema
13+
```
14+
315
# [Microsoft Entra ID](#tab/dotnet-entra-id)
416

17+
If you are new to using Microsoft Entra ID for authentication see [How to configure Azure OpenAI Service with Microsoft Entra ID authentication](../how-to/managed-identity.md).
18+
519
```csharp
620
using Azure.AI.OpenAI;
721
using Azure.Identity;
@@ -184,8 +198,7 @@ var chat = new List<ChatMessage>()
184198

185199
// Create a JSON schema for the CalendarEvent structured response
186200
JSchemaGenerator generator = new JSchemaGenerator();
187-
var schema = generator.Generate(typeof(CalendarEvent));
188-
string jsonSchema = schema.ToString();
201+
var jsonSchema = generator.Generate(typeof(CalendarEvent)).ToString();
189202

190203
// Get a chat completion from the AI model
191204
var completion = chatClient.CompleteChat(
@@ -273,8 +286,7 @@ var chat = new List<ChatMessage>()
273286

274287
// Create a JSON schema for the CalendarEvent structured response
275288
JSchemaGenerator generator = new JSchemaGenerator();
276-
var schema = generator.Generate(typeof(CalendarEvent));
277-
string jsonSchema = schema.ToString();
289+
var jsonSchema = generator.Generate(typeof(CalendarEvent)).ToString();
278290

279291
// Get a chat completion from the AI model
280292
var completion = chatClient.CompleteChat(

articles/ai-services/openai/includes/structured-outputs-python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ You can use [`Pydantic`](https://docs.pydantic.dev/latest/) to define object sch
88
pip install openai pydantic --upgrade
99
```
1010

11-
If you are new to using Microsoft Entra ID for authentication see [How to configure Azure OpenAI Service with Microsoft Entra ID authentication](./managed-identity.md).
11+
If you are new to using Microsoft Entra ID for authentication see [How to configure Azure OpenAI Service with Microsoft Entra ID authentication](../how-to/managed-identity.md).
1212

1313
```python
1414
from pydantic import BaseModel

0 commit comments

Comments
 (0)