Miragon / miranum-copilot

This repository is used for a project conducted at the university of applied Sciences Augsburg, to research how AI can benefit process automation.
MIT License
4 stars 0 forks source link

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

Open peterhnm opened 1 year ago

peterhnm commented 1 year ago

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"]
    }
  4. 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 ```