Logo

Json Schema Generator

Given user instructions, create a valid JSON 7 schema with rich instructions and details for use in LLM structured data generation.

Information

ID: d586c424-86f2-4365-b91b-a0ed56608e54

Referenced Content: 0

Artifact: Yes

Tags: #public

Payload

{
  "message": "Create a JSON Schema for a product recommendation tool"
}

Response

{
  "message": "The JSON schema created for the product recommendation tool ensures that each product entry has a specific structure and validation rules. The schema enforces that exactly five products are present in the recommendations array, each having required properties such as a link, title, description, price, and a message about the choice rationale. This design helps validate product data effectively in applications.",
  "artifact": {
    "description": "Created a JSON 7 schema for a product recommendation tool with detailed product validation rules.",
    "content": "{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"products\": {\n      \"type\": \"array\",\n      \"minItems\": 5,\n      \"maxItems\": 5,\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"productLink\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"description\": \"A URL link to the product page.\"\n          },\n          \"title\": {\n            \"type\": \"string\",\n            \"description\": \"The title of the product.\"\n          },\n          \"description\": {\n            \"type\": \"string\",\n            \"description\": \"A brief description of the product.\"\n          },\n          \"price\": {\n            \"type\": \"number\",\n            \"description\": \"The price of the product.\"\n          },\n          \"choiceMessage\": {\n            \"type\": \"string\",\n            \"description\": \"A message explaining why this product was chosen.\"\n          }\n        },\n        \"required\": [\"productLink\", \"title\", \"description\", \"price\", \"choiceMessage\"]\n      }\n    }\n  },\n  \"required\": [\"products\"]\n}"
  },
  "conversation": {
    "title": "Product Recommendation Tool JSON Schema",
    "description": "Generated a JSON schema to validate product recommendations with specific rules and types."
  }
}

Prompt Data

Input Schema

Input Type: message

The JSONSchemaGenerator is designed to create a valid JSON 7 schema based on user instructions. It extracts necessary information from provided input data, identifies data types, key properties, and constraints, and returns an accurately formatted JSON schema. The system prioritizes adherence to JSON 7 specifications, ensuring the schema is both syntactically and semantically correct, making it suitable for validation and integration processes.

{
  "name": "Input Schema",
  "strict": true,
  "description": "Message input schema",
  "input_schema": {
    "type": "object",
    "required": [
      "message"
    ],
    "properties": {
      "message": {
        "type": "string",
        "description": "The user provided message"
      }
    },
    "additionalProperties": false
  }
}

Output Schema

Output type: message

The JSONSchemaGenerator is designed to create a valid JSON 7 schema based on user instructions. It extracts necessary information from provided input data, identifies data types, key properties, and constraints, and returns an accurately formatted JSON schema. The system prioritizes adherence to JSON 7 specifications, ensuring the schema is both syntactically and semantically correct, making it suitable for validation and integration processes.

Instructions

Static

You are tasked with generating a JSON 7 schema based on the user's instructions. Focus on extracting and understanding the key requirements, data types, and constraints provided in the input. 
 
Ensure that the output is a correctly formatted JSON 7 schema with all necessary properties, data types, and validation rules, according to the input specifications. Be meticulous in adhering to formatting guidelines and ensure the schema is syntactically and semantically correct. 
 
You must write the schema output to the artifact, and it must be a valid JSONSchema7 definition: {{ artifact }} 

State

{{ conversation.history }}

Dynamic

{{ message }}

Generation

Curl request

curl -X POST "https://api.systemprompt.io/v1/prompt/d586c424-86f2-4365-b91b-a0ed56608e54" \
  -H "api-key: {API-KEY}" \
  -H "Content-Type: application/json" \
  -d '{"message":"Create a JSON Schema for a product recommendation tool"}'

Response

{
  "success": true,
  "data": {
    "static": "You are tasked with generating a JSON 7 schema based on the user's instructions. Focus on extracting and understanding the key requirements, data types, and constraints provided in the input. \n\nEnsure that the output is a correctly formatted JSON 7 schema with all necessary properties, data types, and validation rules, according to the input specifications. Be meticulous in adhering to formatting guidelines and ensure the schema is syntactically and semantically correct. \n\nYou must write the schema output to the artifact, and it must be a valid JSONSchema7 definition:  ",
    "dynamic": "<message>Create a JSON Schema for a product recommendation tool</message>",
    "state": "",
    "output_schema": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Full and detailed chat response from the AI."
        },
        "artifact": {
          "type": "object",
          "description": "The generated artifact in sequential chunks",
          "properties": {
            "description": {
              "type": "string",
              "description": "A human-readable explanation of the changes made to the artifact"
            },
            "content": {
              "type": "string",
              "description": "The complete generated artifact"
            }
          },
          "required": [
            "description",
            "content"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "message",
        "artifact"
      ],
      "additionalProperties": false
    },
    "parsed_tokens": [
      "message"
    ],
    "token_counts": {
      "static": 111,
      "dynamic": 13
    },
    "prompt": {
      "id": "d586c424-86f2-4365-b91b-a0ed56608e54",
      "instruction": {
        "static": "You are tasked with generating a JSON 7 schema based on the user's instructions. Focus on extracting and understanding the key requirements, data types, and constraints provided in the input. \n\nEnsure that the output is a correctly formatted JSON 7 schema with all necessary properties, data types, and validation rules, according to the input specifications. Be meticulous in adhering to formatting guidelines and ensure the schema is syntactically and semantically correct. \n\nYou must write the schema output to the artifact, and it must be a valid JSONSchema7 definition: {{ artifact }} ",
        "dynamic": "{{ message }}",
        "state": "{{ conversation.history }}"
      },
      "input": {
        "name": "JSONSchemaGenerator",
        "description": "The JSONSchemaGenerator is designed to create a valid JSON 7 schema based on user instructions. It extracts necessary information from provided input data, identifies data types, key properties, and constraints, and returns an accurately formatted JSON schema. The system prioritizes adherence to JSON 7 specifications, ensuring the schema is both syntactically and semantically correct, making it suitable for validation and integration processes.",
        "schema": {
          "name": "Input Schema",
          "strict": true,
          "description": "Message input schema",
          "input_schema": {
            "type": "object",
            "required": [
              "message"
            ],
            "properties": {
              "message": {
                "type": "string",
                "description": "The user provided message"
              }
            },
            "additionalProperties": false
          }
        },
        "type": [
          "message",
          "artifact"
        ],
        "reference": []
      },
      "output": {
        "name": "JSONSchemaGenerator",
        "description": "The JSONSchemaGenerator is designed to create a valid JSON 7 schema based on user instructions. It extracts necessary information from provided input data, identifies data types, key properties, and constraints, and returns an accurately formatted JSON schema. The system prioritizes adherence to JSON 7 specifications, ensuring the schema is both syntactically and semantically correct, making it suitable for validation and integration processes.",
        "schema": {
          "name": "Input Schema",
          "strict": true,
          "description": "Sample input schema",
          "input_schema": {
            "type": "object",
            "properties": [],
            "additionalProperties": false
          }
        },
        "type": [
          "message",
          "artifact"
        ],
        "reference": []
      },
      "metadata": {
        "title": "JsonSchemaGenerator",
        "description": "Given user instructions, create a valid JSON 7 schema with rich instructions and details for use in LLM structured data generation.",
        "created": "2024-11-22T10:25:46+01:00",
        "updated": "2024-12-05T12:59:07+01:00",
        "version": 28987,
        "status": "published",
        "tag": [
          "public"
        ]
      },
      "_link": "/v1/prompt/d586c424-86f2-4365-b91b-a0ed56608e54"
    }
  },
  "warnings": []
}

Execution

Curl request

curl -X POST "https://api.systemprompt.io/v1/prompt/d586c424-86f2-4365-b91b-a0ed56608e54/openai" \
  -H "api-key: {API-KEY}" \
  -H "Content-Type: application/json" \
  -d '{"message":"Create a JSON Schema for a product recommendation tool"}'

Response

{
  "data": {
    "message": {
      "id": "38832b30-0cd0-4660-b783-3360e627607d",
      "role": "assistant",
      "model": "gpt-4o-2024-08-06",
      "content": "{\"message\":\"The JSON schema created for the product recommendation tool ensures that each product entry has a specific structure and validation rules. The schema enforces that exactly five products are present in the recommendations array, each having required properties such as a link, title, description, price, and a message about the choice rationale. This design helps validate product data effectively in applications.\",\"artifact\":{\"description\":\"Created a JSON 7 schema for a product recommendation tool with detailed product validation rules.\",\"content\":\"{\\n  \\\"$schema\\\": \\\"http://json-schema.org/draft-07/schema#\\\",\\n  \\\"type\\\": \\\"object\\\",\\n  \\\"properties\\\": {\\n    \\\"products\\\": {\\n      \\\"type\\\": \\\"array\\\",\\n      \\\"minItems\\\": 5,\\n      \\\"maxItems\\\": 5,\\n      \\\"items\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"properties\\\": {\\n          \\\"productLink\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"format\\\": \\\"uri\\\",\\n            \\\"description\\\": \\\"A URL link to the product page.\\\"\\n          },\\n          \\\"title\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"description\\\": \\\"The title of the product.\\\"\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"description\\\": \\\"A brief description of the product.\\\"\\n          },\\n          \\\"price\\\": {\\n            \\\"type\\\": \\\"number\\\",\\n            \\\"description\\\": \\\"The price of the product.\\\"\\n          },\\n          \\\"choiceMessage\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"description\\\": \\\"A message explaining why this product was chosen.\\\"\\n          }\\n        },\\n        \\\"required\\\": [\\\"productLink\\\", \\\"title\\\", \\\"description\\\", \\\"price\\\", \\\"choiceMessage\\\"]\\n      }\\n    }\\n  },\\n  \\\"required\\\": [\\\"products\\\"]\\n}\"},\"conversation\":{\"title\":\"Product Recommendation Tool JSON Schema\",\"description\":\"Generated a JSON schema to validate product recommendations with specific rules and types.\"}}",
      "metadata": {
        "tag": [],
        "title": "Product Recommendation Tool JSON Schema",
        "author": "gpt-4o-2024-08-06",
        "status": "published",
        "created": "2024-11-28T19:56:16+01:00",
        "updated": "2024-11-28T19:56:03+01:00",
        "version": 28950,
        "description": "Generated a JSON schema to validate product recommendations with specific rules and types."
      },
      "reference": []
    },
    "artifact": {
      "content": "{\n  \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"products\": {\n      \"type\": \"array\",\n      \"minItems\": 5,\n      \"maxItems\": 5,\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"productLink\": {\n            \"type\": \"string\",\n            \"format\": \"uri\",\n            \"description\": \"A URL link to the product page.\"\n          },\n          \"title\": {\n            \"type\": \"string\",\n            \"description\": \"The title of the product.\"\n          },\n          \"description\": {\n            \"type\": \"string\",\n            \"description\": \"A brief description of the product.\"\n          },\n          \"price\": {\n            \"type\": \"number\",\n            \"description\": \"The price of the product.\"\n          },\n          \"choiceMessage\": {\n            \"type\": \"string\",\n            \"description\": \"A message explaining why this product was chosen.\"\n          }\n        },\n        \"required\": [\"productLink\", \"title\", \"description\", \"price\", \"choiceMessage\"]\n      }\n    }\n  },\n  \"required\": [\"products\"]\n}",
      "description": "Created a JSON 7 schema for a product recommendation tool with detailed product validation rules."
    },
    "conversation": {
      "id": "fb9b5a09-ce61-42fe-8342-2faac1fbb001",
      "type": "conversation",
      "_link": "/v1/conversation/fb9b5a09-ce61-42fe-8342-2faac1fbb001",
      "message": [
        {
          "id": "430cd900-dc0d-4968-a38c-75b160c3474b",
          "role": "user",
          "model": "gpt-4o-2024-08-06",
          "content": "Create a JSON Schema for a product recommendation tool",
          "metadata": {
            "tag": [],
            "title": "JSON Schema for Product Recommendations",
            "author": "9NbDgfbyE1CICkmq3yjU",
            "status": "published",
            "created": "2024-11-28T19:56:05+01:00",
            "updated": "2024-11-28T19:56:03+01:00",
            "version": 28948,
            "description": "The user is requesting assistance in creating a JSON Schema for a tool that recommends products."
          },
          "reference": [
            {
              "id": "d586c424-86f2-4365-b91b-a0ed56608e54",
              "type": "prompt",
              "_link": "/v1/prompt/d586c424-86f2-4365-b91b-a0ed56608e54"
            }
          ]
        },
        {
          "id": "38832b30-0cd0-4660-b783-3360e627607d",
          "role": "assistant",
          "model": "gpt-4o-2024-08-06",
          "content": "{\"message\":\"The JSON schema created for the product recommendation tool ensures that each product entry has a specific structure and validation rules. The schema enforces that exactly five products are present in the recommendations array, each having required properties such as a link, title, description, price, and a message about the choice rationale. This design helps validate product data effectively in applications.\",\"artifact\":{\"description\":\"Created a JSON 7 schema for a product recommendation tool with detailed product validation rules.\",\"content\":\"{\\n  \\\"$schema\\\": \\\"http://json-schema.org/draft-07/schema#\\\",\\n  \\\"type\\\": \\\"object\\\",\\n  \\\"properties\\\": {\\n    \\\"products\\\": {\\n      \\\"type\\\": \\\"array\\\",\\n      \\\"minItems\\\": 5,\\n      \\\"maxItems\\\": 5,\\n      \\\"items\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"properties\\\": {\\n          \\\"productLink\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"format\\\": \\\"uri\\\",\\n            \\\"description\\\": \\\"A URL link to the product page.\\\"\\n          },\\n          \\\"title\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"description\\\": \\\"The title of the product.\\\"\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"description\\\": \\\"A brief description of the product.\\\"\\n          },\\n          \\\"price\\\": {\\n            \\\"type\\\": \\\"number\\\",\\n            \\\"description\\\": \\\"The price of the product.\\\"\\n          },\\n          \\\"choiceMessage\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"description\\\": \\\"A message explaining why this product was chosen.\\\"\\n          }\\n        },\\n        \\\"required\\\": [\\\"productLink\\\", \\\"title\\\", \\\"description\\\", \\\"price\\\", \\\"choiceMessage\\\"]\\n      }\\n    }\\n  },\\n  \\\"required\\\": [\\\"products\\\"]\\n}\"},\"conversation\":{\"title\":\"Product Recommendation Tool JSON Schema\",\"description\":\"Generated a JSON schema to validate product recommendations with specific rules and types.\"}}",
          "metadata": {
            "tag": [],
            "title": "Product Recommendation Tool JSON Schema",
            "author": "9NbDgfbyE1CICkmq3yjU",
            "status": "published",
            "created": "2024-11-28T19:56:16+01:00",
            "updated": "2024-11-28T19:56:03+01:00",
            "version": 28950,
            "description": "Generated a JSON schema to validate product recommendations with specific rules and types."
          },
          "reference": [
            {
              "id": "7e6fda33-b5f9-4a11-b408-d39fb973f346",
              "type": "artifact",
              "_link": "/v1/artifact/7e6fda33-b5f9-4a11-b408-d39fb973f346"
            },
            {
              "id": "d586c424-86f2-4365-b91b-a0ed56608e54",
              "type": "prompt",
              "_link": "/v1/prompt/d586c424-86f2-4365-b91b-a0ed56608e54"
            }
          ]
        }
      ],
      "metadata": {
        "tag": [
          "ai_generated"
        ],
        "title": "JSON Schema for Product Recommendations",
        "status": "published",
        "created": "2024-11-28T19:56:03+01:00",
        "updated": "2024-11-28T19:56:03+01:00",
        "version": 28947,
        "description": "The user is requesting assistance in creating a JSON Schema for a tool that recommends products."
      }
    },
    "structured_data": []
  },
  "success": true,
  "metadata": {
    "id": "chatcmpl-AYdyIPztkHtUQfrWv3Skj9ahhYIHb",
    "model": "gpt-4o-2024-08-06",
    "usage": {
      "total_tokens": 1025,
      "prompt_tokens": 595,
      "completion_tokens": 430
    },
    "object": "chat.completion",
    "choices": [
      {
        "index": 0,
        "message": {
          "role": "assistant",
          "content": "{\"message\":\"The JSON schema created for the product recommendation tool ensures that each product entry has a specific structure and validation rules. The schema enforces that exactly five products are present in the recommendations array, each having required properties such as a link, title, description, price, and a message about the choice rationale. This design helps validate product data effectively in applications.\",\"artifact\":{\"description\":\"Created a JSON 7 schema for a product recommendation tool with detailed product validation rules.\",\"content\":\"{\\n  \\\"$schema\\\": \\\"http://json-schema.org/draft-07/schema#\\\",\\n  \\\"type\\\": \\\"object\\\",\\n  \\\"properties\\\": {\\n    \\\"products\\\": {\\n      \\\"type\\\": \\\"array\\\",\\n      \\\"minItems\\\": 5,\\n      \\\"maxItems\\\": 5,\\n      \\\"items\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"properties\\\": {\\n          \\\"productLink\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"format\\\": \\\"uri\\\",\\n            \\\"description\\\": \\\"A URL link to the product page.\\\"\\n          },\\n          \\\"title\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"description\\\": \\\"The title of the product.\\\"\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"description\\\": \\\"A brief description of the product.\\\"\\n          },\\n          \\\"price\\\": {\\n            \\\"type\\\": \\\"number\\\",\\n            \\\"description\\\": \\\"The price of the product.\\\"\\n          },\\n          \\\"choiceMessage\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"description\\\": \\\"A message explaining why this product was chosen.\\\"\\n          }\\n        },\\n        \\\"required\\\": [\\\"productLink\\\", \\\"title\\\", \\\"description\\\", \\\"price\\\", \\\"choiceMessage\\\"]\\n      }\\n    }\\n  },\\n  \\\"required\\\": [\\\"products\\\"]\\n}\"},\"conversation\":{\"title\":\"Product Recommendation Tool JSON Schema\",\"description\":\"Generated a JSON schema to validate product recommendations with specific rules and types.\"}}"
        },
        "finish_reason": "stop"
      }
    ],
    "created": 1732820166,
    "system_fingerprint": "fp_7f6be3efb0"
  }
}

Use prompt

You can add this prompt to your dashboard by clicking the button below. (systemprompt.io subscription required).

To create a systemprompt subscripton go to the console

On this page