Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

How to use JSON mode with OpenAI #1553

Closed
khiconit opened this issue Dec 7, 2024 · 2 comments
Closed

How to use JSON mode with OpenAI #1553

khiconit opened this issue Dec 7, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@khiconit
Copy link

khiconit commented Dec 7, 2024

Open AI and Ollama now support output format. Please support it soon

Documentation: https://platform.openai.com/docs/guides/structured-outputs?context=without_parse#json-mode

@khiconit khiconit added the bug Something isn't working label Dec 7, 2024
@marcusschiesser
Copy link
Collaborator

JSON mode is already supported via:

const llm = new OpenAI({
    model: "gpt-4o",
    additionalChatOptions: { response_format: { type: "json_object" } },
  });

but we should generally support structured output

@marcusschiesser marcusschiesser changed the title Please support Structured Outputs for Ollama and OpenAI Support Structured Outputs Jan 3, 2025
@marcusschiesser marcusschiesser added enhancement New feature or request and removed bug Something isn't working labels Jan 3, 2025
@marcusschiesser
Copy link
Collaborator

just saw we have an issue for structured output already: #1249 - converting this to a discussion

@marcusschiesser marcusschiesser changed the title Support Structured Outputs How to use JSON mode with OpenAI Jan 3, 2025
@run-llama run-llama locked and limited conversation to collaborators Jan 3, 2025
@marcusschiesser marcusschiesser converted this issue into discussion #1586 Jan 3, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants