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:
The user input is a prompt like:
"Generate a JSON Schema for an order."
We may need to enrich the prompt with additional information.
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"]
}
We then can take this and create a order.form.json file with an empty UI-Schema
Sub-Tasks
```[tasklist]
### Tasks
- [ ] Get familiar with JSON Forms and JSON Schema
- [ ] Create a prompt or use function calls so we only get the JSON Schema
```
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:
order.form.json
file with an empty UI-SchemaSub-Tasks
```[tasklist] ### Tasks - [ ] Get familiar with JSON Forms and JSON Schema - [ ] Create a prompt or use function calls so we only get the JSON Schema ```