Skip to content

Commit 9346e58

Browse files
committed
update
1 parent 1a8c489 commit 9346e58

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

articles/ai-services/openai/how-to/structured-outputs.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ recommendations: false
1414

1515
# Structured outputs
1616

17-
Structured outputs makes a model to follow a [JSON Schema](https://json-schema.org/overview/what-is-jsonschema) definition that you provide as part of your chat completions 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.
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 chat completions 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.
1818

1919
## Supported models
2020

@@ -28,7 +28,7 @@ Support for JSON mode was first added in API version [`2024-08-01-preview`](http
2828

2929
# [Python (Microsoft Entra ID)](#tab/python-secure)
3030

31-
You can use [Pydantic](https://docs.pydantic.dev/latest/) to define object schemas in Python. Depending on what version of the [OpenAI](https://pypi.org/project/openai/) and [Pydantic libraries](https://pypi.org/project/pydantic/) you are running you may need to upgrade to a newer version. These examples were tested against `openai 1.42.0` and `pydantic 2.8.2`.
31+
You can use [`Pydantic`](https://docs.pydantic.dev/latest/) to define object schemas in Python. Depending on what version of the [OpenAI](https://pypi.org/project/openai/) and [`Pydantic` libraries](https://pypi.org/project/pydantic/) you're running you may need to upgrade to a newer version. These examples were tested against `openai 1.42.0` and `pydantic 2.8.2`.
3232

3333
```cmd
3434
pip install openai pydantic --upgrade
@@ -115,7 +115,7 @@ name='Science Fair' date='Friday' participants=['Alice', 'Bob']
115115

116116
# [Python (key-based auth)](#tab/python)
117117

118-
You can use [Pydantic](https://docs.pydantic.dev/latest/) to define object schemas in Python. Depending on what version of the [OpenAI](https://pypi.org/project/openai/) and [Pydantic libraries](https://pypi.org/project/pydantic/) you are running you may need to upgrade to a newer version. These examples were tested against `openai 1.42.0` and `pydantic 2.8.2`.
118+
You can use [`Pydantic`](https://docs.pydantic.dev/latest/) to define object schemas in Python. Depending on what version of the [OpenAI](https://pypi.org/project/openai/) and [`Pydantic` libraries](https://pypi.org/project/pydantic/) you're running you may need to upgrade to a newer version. These examples were tested against `openai 1.42.0` and `pydantic 2.8.2`.
119119

120120
```cmd
121121
pip install openai pydantic --upgrade
@@ -444,7 +444,7 @@ curl -X POST https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOU
444444

445445
## Supported schemas and limitations
446446

447-
Azure OpenAI structured outputs supports the same subset of the [JSON Schema](https://json-schema.org/docs) as OpenAI.
447+
Azure OpenAI structured outputs support the same subset of the [JSON Schema](https://json-schema.org/docs) as OpenAI.
448448

449449
### Supported types
450450

@@ -487,7 +487,7 @@ All fields or function parameters must be included as required. In the example b
487487
}
488488
```
489489

490-
If needed, it is possible to emulate an optional parameter by using a union type with `null`. In this example this is achieved with the line `"type": ["string", "null"],`.
490+
If needed, it's possible to emulate an optional parameter by using a union type with `null`. In this example, this is achieved with the line `"type": ["string", "null"],`.
491491

492492
```json
493493
{
@@ -517,11 +517,11 @@ If needed, it is possible to emulate an optional parameter by using a union type
517517

518518
### Nesting depth
519519

520-
A schema may have up to 100 object properties total, with up to 5 levels of nesting
520+
A schema may have up to 100 object properties total, with up to five levels of nesting
521521

522522
### additionalProperties: false must always be set in objects
523523

524-
This controls if an object can have additional key value pairs that were not defined in the JSON Schema. In order to use structured outputs you must set this value to false.
524+
This property controls if an object can have additional key value pairs that weren't defined in the JSON Schema. In order to use structured outputs, you must set this value to false.
525525

526526
### Key ordering
527527

0 commit comments

Comments
 (0)