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

Use JSON mode when -f json is specified in a magic command #438

Open
JasonWeill opened this issue Nov 6, 2023 · 0 comments
Open

Use JSON mode when -f json is specified in a magic command #438

JasonWeill opened this issue Nov 6, 2023 · 0 comments
Labels
enhancement New feature or request @jupyter-ai/magics

Comments

@JasonWeill
Copy link
Collaborator

Problem

Some generative language models do not generate valid JSON when asked to do so; this JSON fails when a user tries to parse it.

Proposed Solution

For models that support it (see below), use JSON mode when a user specifies -f json for a magic command.

Additional context

As of November 6, 2023, OpenAI's gpt-4-vision-preview and gpt-3.5-turbo models support JSON mode. Clients must include the string "JSON" in their system message, and clients using these models must set response_format to { type: "json_object" }, to enable this mode.

See #435 for another issue related to generative models that fail to output valid JSON.

See #437 for using JSON mode with the /generate command.

@JasonWeill JasonWeill added enhancement New feature or request @jupyter-ai/magics labels Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request @jupyter-ai/magics
Projects
None yet
Development

No branches or pull requests

1 participant