How to force exact Json structure & Have GPT Write Correctly

Hello Make Community,

I’m working on an automated proposal system where you just fill out a few questions within a form and a PandaDoc proposal is automatically generated.

I have 2 problems, the first one being the Json output and the second one being the GPT text output

  1. JSON Output:
    I want GPT to strictly only output the following 3 JSON outputs:
    “title”
    “problemPitch”
    “solutionPitch”
    The problem is that its generating random json outputs as shown here:
    image

  2. GPT Text Output

Here are screenshots of the GPT module in question. I want it to generate the text output how I instructed it in these screenshots.



Instead, its generating the text output very short and sweet, which is not how I trained it.

The full scenario

Thank you

(Note, the error in Json module 9 is just testing and not relevant to the issues above, the issue stems from OpenAI module 3)

Use the Transform Text to Structured Data module instead of the chat completion module.

Screenshot_2024-04-29_100453

For some examples, see how others are using it: Search results for 'openai structured json' - Make Community

3 Likes

The module fix both issues at the same time

Thank you Sam!

1 Like