Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update use-structured-outputs.mdx #4375

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Update use-structured-outputs.mdx #4375

wants to merge 2 commits into from

Conversation

fpagny
Copy link
Contributor

@fpagny fpagny commented Feb 7, 2025

Updating structured output documentation to identify JSON Mode as a Legacy method that is not recommended anymore.

Updating structured output documentation to identify JSON Mode as a Legacy method that is not recommended anymore.
pages/generative-apis/how-to/use-structured-outputs.mdx Outdated Show resolved Hide resolved
pages/generative-apis/how-to/use-structured-outputs.mdx Outdated Show resolved Hide resolved
pages/generative-apis/how-to/use-structured-outputs.mdx Outdated Show resolved Hide resolved

<Message type="warning">
- 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.
- 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.`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 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.`.
- 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.`.

pages/generative-apis/how-to/use-structured-outputs.mdx Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants