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: pages/generative-apis/how-to/use-structured-outputs.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,10 +40,10 @@ There are several ways to interact with language models:
40
40
- Type: `{"type": "json_object"}`
41
41
- This mode is non-deterministic and allows the model to output a JSON object without strict validation.
42
42
- Useful for flexible outputs when you expect the model to infer a reasonable structure based on your prompt.
43
-
- JSON mode is older and has been used by developers since early API implementations but lack reliability in response formats.
43
+
- JSON mode is older and has been used by developers since early API implementations, but lacks reliability in response formats.
44
44
45
45
<Messagetype="note">
46
-
- All LLMs on the Scaleway library support **Structured outputs** and **JSON mode**. However, a schemaless **JSON mode** will produce lower quality results and is not recommended.
46
+
- All LLMs in the Scaleway library support **Structured outputs** and **JSON mode**. However, a schemaless **JSON mode** will produce lower quality results and is not recommended.
47
47
</Message>
48
48
49
49
## Code examples
@@ -193,8 +193,8 @@ Output example:
193
193
### Using JSON mode (schemaless, Legacy method)
194
194
195
195
<Messagetype="important">
196
-
- When using the OpenAI SDKs like in the examples above, you are expected to set `additionalProperties` to false, and to specify all your properties as required.
197
-
- JSON mode: It is important to explicitly ask the model to generate a JSON output either in system prompt or user prompt. To prevent infinite generations, model providers most often encourage users to ask the model for short JSON objects. Prompt example: `Only answer in JSON using '{' as the first character.`.
196
+
- When using the OpenAI SDKs as in the examples above, you are expected to set `additionalProperties` to false, and to specify all your properties as required.
197
+
- JSON mode: It is important to explicitly ask the model to generate a JSON output either in the system prompt or user prompt. To prevent infinite generations, model providers most often encourage users to ask the model for short JSON objects. Prompt example: `Only answer in JSON using '{' as the first character.`.
198
198
</Message>
199
199
200
200
In JSON mode, you can prompt the model to output a JSON object without enforcing a strict schema.
0 commit comments