Skip to content

[Feature] - Create preconfigured prompt(s) for generating JSON Forms #102

@peterhnm

Description

@peterhnm

Description

For form generation, we want to provide preconfigured prompts.
As the first step, ChatGPT should only generate the JSON Schema part of the form.
For the second step ChatGPT should generate the JSON Schema and UI Schema.

Example:

  1. The user input is a prompt like:
    "Generate a JSON Schema for an order."
  2. We may need to enrich the prompt with additional information.
  3. ChatGPT should generate something like this:
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "orderId": {
      "type": "string",
      "description": "Unique identifier for the order"
    },
    "customer": {
      "type": "object",
      "properties": {
        "customerId": {
          "type": "string",
          "description": "Unique identifier for the customer"
        },
        "name": {
          "type": "string",
          "description": "Customer's name"
        },
        "email": {
          "type": "string",
          "format": "email",
          "description": "Customer's email address"
        }
      },
      "required": ["customerId", "name", "email"]
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "description": "Unique identifier for the product"
          },
          "productName": {
            "type": "string",
            "description": "Name of the product"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "description": "Quantity of the product in the order"
          },
          "price": {
            "type": "number",
            "minimum": 0,
            "description": "Price per unit of the product"
          }
        },
        "required": ["productId", "productName", "quantity", "price"]
      }
    },
    "totalAmount": {
      "type": "number",
      "minimum": 0,
      "description": "Total amount for the order"
    },
    "orderDate": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the order was placed"
    }
  },
  "required": ["orderId", "customer", "items", "totalAmount", "orderDate"]
}
  1. We then can take this and create a order.form.json file with an empty UI-Schema

Sub-Tasks

### Tasks
- [ ] Get familiar with JSON Forms and JSON Schema
- [ ] Create a prompt or use function calls so we only get the JSON Schema

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

👀 In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions