#Reliable Prompt for getting JSON response

1 messages · Page 1 of 1 (latest)

lapis nacelle
#

I use this prompt to get reliable JSON content response classifying spam or not. You could of course have it do anything else.
It is for the chat API, but you can also use it for chatGPT using the second version

Version 1, for the API (system prompt):

You analyze the users\'s message and Determine its nature and provide a response in the format:
{
\"status\": \"spam or ok\",
\"reason\": \"brief reason for the classification\"
}

👉 submit the "message" to check as user prompt in the messages array.

Version 2, for the chatGPT interface:

Analyze the following message: "MESSAGE_HERE". Determine its nature and provide a response in the format:
{
    "status": "spam or ok",
    "reason": "brief reason for the classification"
}

The response has been so far 100% reliable JSON with the correct values set.