You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/openai/how-to/json-mode.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,9 @@ JSON mode allows you to set the models response format to return a valid JSON ob
20
20
> [!NOTE]
21
21
> While JSON mode is still supported, when possible we recommend using [structured outputs](./structured-outputs.md). Like JSON mode structured outputs generates valid JSON, but with the added benefit that you can constrain the model to use a specific JSON schema.
22
22
23
+
>[!NOTE]
24
+
> Currently Structured outputs is not supported on [bring your own data](../concepts/use-your-data.md) scenario.
25
+
23
26
## JSON mode support
24
27
25
28
JSON mode is only currently supported with the following models:
Copy file name to clipboardExpand all lines: articles/ai-services/openai/how-to/structured-outputs.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,9 @@ recommendations: false
16
16
17
17
Structured outputs make a model follow a [JSON Schema](https://json-schema.org/overview/what-is-jsonschema) definition that you provide as part of your inference API call. This is in contrast to the older [JSON mode](./json-mode.md) feature, which guaranteed valid JSON would be generated, but was unable to ensure strict adherence to the supplied schema. Structured outputs is recommended for function calling, extracting structured data, and building complex multi-step workflows.
18
18
19
+
>[!NOTE]
20
+
> Currently Structured outputs is not supported on [bring your own data](../concepts/use-your-data.md) scenario.
21
+
19
22
## Supported models
20
23
21
24
Currently only `gpt-4o` version: `2024-08-06` supports structured outputs.
- An Azure OpenAI resource created in a supported region (see [Region availability](/azure/ai-services/openai/concepts/models#model-summary-table-and-region-availability)). For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
26
+
27
+
28
+
#### [JavaScript](#tab/javascript)
29
+
20
30
- An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services?azure-portal=true)
21
31
-[LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
22
32
- An Azure OpenAI resource created in a supported region (see [Region availability](/azure/ai-services/openai/concepts/models#model-summary-table-and-region-availability)). For more information, see [Create a resource and deploy a model with Azure OpenAI](../how-to/create-resource.md).
23
33
34
+
---
24
35
25
36
## Setup
26
37
@@ -39,10 +50,10 @@ npm init
39
50
40
51
## Install the client library
41
52
42
-
Install the Azure OpenAI client library for JavaScript with npm:
53
+
Install the client libraries with:
43
54
44
55
```console
45
-
npm install @azure/openai
56
+
npm install openai @azure/identity
46
57
```
47
58
48
59
Your app's _package.json_ file will be updated with the dependencies.
@@ -51,43 +62,123 @@ Your app's _package.json_ file will be updated with the dependencies.
51
62
52
63
Create a new file named _ImageGeneration.js_ and open it in your preferred code editor. Copy the following code into the _ImageGeneration.js_ file:
0 commit comments