Skip to content

4d-depot/4D-Qodly-OpenAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

4D-Qodly-OpenAI

Proof of concept of generating testing data with OpenAI. This project consists in an app made with Qodly Studio. The app purpose is to generate data for dataclasses (tables) defined in the project structure.

Demonstration video

Check out this video and learn how to use the app.

Youtube link

Pre-requisites

How to run the project

  • Open the project in 4D.
  • Run Qodly Studio and then Preview.
  • In the app settings, paste your OpenAI API Key and save.

Features & usage

  • This demo lists your project dataclasses and their attributes: feel free to add or remove dataclasses and attributes, then refresh the dataclasses lists.
  • For each attribute, you can set whether the app will: leave it blank, generate a random value, or query OpenAI API to get a set of data.
  • For each attribute set to be generated by OpenAI API, values are asked by set or 10 by default, but this can be tuned by setting another value for "AI Request set". This might speed up large dataset generation.
  • For each attribute, define an "AI remark" to describe what kind of data you want to get. For example "French firstnames" or "Typical timesheet comment".
  • For each attribute, the "Preview" button will get a list of 5 values from OpenAI, so that you can get an idea of the result before generating records.
  • Many to one relations are automatically set: a random target entity is always selected when needed.
  • When you finished to define all attributes of a DataClass, press "Generate" after setting how many records you want to create.

Known issues and things that could be improved

  • Querying OpenAI can take time: the more tokens are returned by OpenAI API, the longer it is. So don't be surprised if records creation does not start right after pressing the "Generate" button.
  • OpenAI offers a streaming mode. Implementing this, together with HTTPRequest asynchronous callbacks, would allow records generation to start much faster.
  • Error management in this proof of concept is minimal