#Strict Mode JSON Generator Prompt 0.1

6 messages ยท Page 1 of 1 (latest)

granite flare
#

See attached markdown file.

granite flare
#
{
  "type": "object",
  "properties": {
    "score": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "The score should be an integer between 0 and 100."
    },
    "message": {
      "type": "string",
      "not": {
        "anyOf": [
          {
            "pattern": "NPC"
          },
          {
            "pattern": "\\*"
          }
        ]
      },
      "description": "The message is a string that should not contain the substring 'NPC' or any '*' characters."
    }
  },
  "required": ["score", "message"],
  "additionalProperties": false,
  "description": "A JSON object that represents a score and a message."
}

here's an example responseJsonSchema with integrated descriptions, minimum and maximum constraints on a score integer, and a constraint to not mention the term "NPC" or include asterisks.

you can google "json schema dot org draft 07" for details on the standard format to specify json schemas and those plug in directly to validators you can apply to the responses from the AI LLMs.

#

This version of the prompt omits the code blocks from the instructions and from the example responses. That would make it less likely to get the ```json ``` backticks so this one's more suited for API calls since you won't have to deal with the code block stuff.

granite flare
granite flare