Is it possible to enable JSON Mode in the playground?

Is it yet possible to enable JSON Mode in the playground? I don’t see an option for it. I wonder if my UI just hasn’t updated yet, if I’m overlooking a setting, or if they just haven’t enabled that feature in the playground yet.

I see where someone posted a link to a site called Promtotype, saying it supports it. I’m trying to stick to OpenAI’s stuff if possible.

6 Likes

I don’t see any valid reason that playground should support this feature

You can pass it through the API, like this

    const response = await client.chat.completions.create({
        model: "gpt-3.5-turbo-1106",
        messages: messages,
        response_format: { "type": "json_object" }
    });

Also you should instruct the model to output in json

    const messages = [
        {
            role: "system",
            content:
                "please output every response in json",
        }
...

I see how to pass the response_format to the API, thank you.

As far as the need for Playground to support this feature, my understanding is that Playground is a way to test API calls to ensure you are getting the required responses, and to revise your system messages and parameters without having to modify code on your end for testing.

If my understanding is correct, then it seems like all parameters that can be passed in the request would be useful parameters to be able to set in Playground for testing, including response_format. Am I misunderstanding something?

7 Likes

+1, this would be really useful!

6 Likes

+2 same for me, could be helpull to try prompts

1 Like

Curious to know if OpenAI team plans to ship this feature in the Playground itself?

1 Like

Fire bro, signing up now.

1 Like

I’ve been testing. json_format is producing a different output than playground. The message and system are identical. I need support for json_format on playground to debug.

I added a post to the feedback section for the API, so hopefully it gets noticed…

2 Likes