Response has valid json but it's nested in broken json

I can make the output more reliable for you with better technique.

Using a system message to dictate the type of output can be stronger, but I will instead use an unconventional message format, consistent with what you describe.

system:

You are ChatGPT

user:

(recent post of mine)

user:

// Instruction
Read the prior message written by an English learner. Give constructive criticism about the language use and communication quality. Your response must be broken into four parts, where you generate only a specific type of valid JSON that must be formatted for an API backend recipient.

// Output format is JSON only, no markdown permitted (no ```)
{
“intro”: “string”,
“correction1”: “string”,
“explanation1”: “string”,
“summary”: “string”
}


assistant response:

{
“intro”: “The message provides a comprehensive overview of the token usage and billing process related to OpenAI’s assistants and APIs. However, there are some opportunities for improving clarity and language use.”,
“correction1”: “The sentence structure and vocabulary are generally advanced, but some sentences are overly complex, making them difficult to follow. Simplifying complex sentences and using clearer terms could improve understanding.”,
“explanation1”: “While the writer shows a good command of English, the use of technical jargon and long, complex sentences might confuse readers who are not familiar with the topic. It’s important to consider the audience and use language that is accessible to both experts and non-experts alike. Clarity should be a priority in technical communication to ensure that the message is effectively conveyed.”,
“summary”: “The writer has a strong grasp of the subject matter but should aim to present the information more succinctly and accessibly. This involves breaking down complex ideas into simpler statements, avoiding unnecessary jargon, and ensuring that sentences are not too lengthy. Doing so will make the content more digestible for a broader audience.”
}

If you are getting bad responses 20% of the time, you can make the output more reliable and consistent by reducing top_p from its default of 1.00 to 0.80 (or lower).

I pressed the button a dozen times and only got JSON.

The AI had no consistent opinion of my writing, though.

gpt-3.5-turbo-1106 complained about my own text’s complaints about clarity of OpenAI nomenclature, but also produces JSON.

Dumb bot

{
“intro”: “The prior message written by the English learner contains some areas that could be improved in terms of language use and communication quality.”,
“correction1”: “The usage of terms like ‘GPT’ and ‘Assistant’ is confusing in the message. It would be clearer to use consistent terminology throughout and avoid conflating different terms.”,
“explanation1”: “In the message, ‘context’ is used to refer to multiple things, which adds to the confusion. It would be helpful to provide clear definitions for each term to avoid ambiguity.”,
“summary”: “Overall, the message could benefit from better clarity and organization. Using consistent terminology and providing clear explanations would enhance the communication quality.”
}

1 Like