Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a sample data generation module. #993

Open
Skaiir opened this issue Jan 16, 2024 · 1 comment
Open

Implement a sample data generation module. #993

Skaiir opened this issue Jan 16, 2024 · 1 comment
Labels
backlog Queued in backlog enhancement New feature or request needs discussion Needs further discussion

Comments

@Skaiir
Copy link
Contributor

Skaiir commented Jan 16, 2024

Is your feature request related to a problem? Please describe.

As I am building a bigger and bigger form, defining the input data manually becomes a pretty tedious task. It would be nice to have a module in place which would allow us to generate some sample data for the input automatically.

This would remain very simple within form-js, but opens up integrations with generative models to generate said data for you and quickly test.

Describe the solution you'd like

The way I see this, we have a module defined at the playground level which would be something like a "sample data generator". This module reads the form tree, and generates an appropriate sample for it. The data itself can just be random numbers and words within the initial implementation.

Or probably even better it would just build up the object tree for you, deep merge it with the existing data and default all the values to empty strings, array and nulls depending on type requirements of the fields.

This also lets us explore into having more type-specific fields, and we could potentially build up on this to provide a typed input data form schema, building it as a utility function so that any other use-cases may hook into it.

Following that, a button would be implemented on the input data window which would call this module, and insert this new sample data into the input. Implementing libraries could extend this module to instead make calls to any generative AI module, which would let them build sensible data which is form context aware.

Describe alternatives you've considered

We could also allow this to be built entirely as an extension outside of the form-js library. In this case, we would need to create extension points here to allow for customization of the input data panel (to add whatever UI interaction we need).

Additional context

The long term UX vision should be kept in mind when thinking about this topic, as I see changes to the input and output panels in the mid-term future.

@Skaiir Skaiir added enhancement New feature or request backlog Queued in backlog needs discussion Needs further discussion labels Jan 16, 2024
@vsgoulart
Copy link
Contributor

Faker might be useful here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Queued in backlog enhancement New feature or request needs discussion Needs further discussion
Projects
None yet
Development

No branches or pull requests

2 participants