Using new openai abilities to format response as JSON

Hi,

I am trying to use the response_format to format GPT-4 Turbo with JSON format.
It doesn’t look like the Make App has that ability for now - and I have tried to add it as additional parameter
like that:

image

But it return the following error:
image

Any idea how I can fix that?

Thanks,
Omri

1 Like

Hi @omri ,

You should look at this page, have you defined a data structure?

Philippe

2 Likes

Hi, I have exactly the same issue. I’ve tried many different options for json structure, but nothing seems to work.
image
this is the most current one. The JSON string in being pasted into additional parameters:
image

I am getting error stating:
image

Any idea what should I do?

Hi @Kuba_Ratajczyk ,

What’s in the list “Input Type”, it is currently “Any”…

Philippe

2 Likes

@omri I didn’t get the json_mode working with the standard “chat completion” make module (I guess it is not possible right now).
But it works with the OpenAI “Make an API Call” module, because there you can specify request body params:

{
    "model": "gpt-4-1106-preview",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant. Reply in JSON Format."
      },
      {
        "role": "user",
        "content": "Hello!"
      }
    ],
   "response_format": { "type": "json_object" }
}

In addition you need to mention “JSON” also in the (system) prompt. Otherwise the call fails. Specify the desired output format/structure in the system prompt.

Alternatively you can continue using the chat completion module without json mode but specify everything in the system prompt. Also works reliable in most cases. But of course using json_mode is much safer.

Cheers, Stefan

2 Likes

UPDATE!
JSON Mode now also available in “Create Completion” module via dropdown parameter!

1 Like

Heya @stefanmueller.ai thanks a lot for the heads up! :pray:

1 Like