PHP Classes

PHP ChatGPT API Seeder: Generate constant seed data using ChatGPT API

Recommend this page to a friend!
  Info   View files Documentation   Screenshots Screenshots   View files View files (21)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2023-07-02 (7 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 112 This week: 1All time: 9,573 This week: 79Up
Version License PHP version Categories
chatgpt-seeder 1.0.0MIT/X Consortium ...5PHP 5, Databases, Artificial intellig...
Description 

Author

This package can generate constant seed data using ChatGPT API.

It can access the ChatGPT API to send requests for data of several types.

The package provides a Laravel Nova panel to let the users pick the type of data they want to retrieve into a given database table, the number of data to recover, and the columns of the table that will be filled with the retrieved data.

Innovation Award
PHP Programming Innovation award nominee
July 2023
Number 2
Many applications need to initialize databases with constant values like, for instance, the names of the countries of people with personal data records stored in the application database.

Usually, developers need to manually feed this data into the application to store the data in the respective database table records.

This package provides a more automated approach to solving this problem. It uses the ChatGPT API to retrieve the necessary data and inserts it in the expected database table records.

Manuel Lemos
Picture of Naif Alshaye
  Performance   Level  
Name: Naif Alshaye <contact>
Classes: 24 packages by
Country: Saudi Arabia Saudi Arabia
Innovation award
Innovation award
Nominee: 9x

Documentation

ChatGPT Seeder

A powerful tool that leverages the capabilities of ChatGPT to automate the generation of realistic and meaningful data for your database seeding need.

Features

  • Easy data seeding
  • Real/fake data options
  • Flexible table selection
  • Customizable record count
  • Detailed column info
  • Selective column insertion
  • Auto select none nullable columns
  • Contextual data description
  • Preview data before insertion
  • Data regeneration for accuracy
  • API rate limit handling using retry count
  • Seamless OpenAI API integration
  • Customizable configuration
  • Display API token usage
  • User-friendly interface
  • Try catch exception, both backend and frontend

Requirements

  • PHP 8.0 or higher
  • Nova 4
  • OpenAI API Key

Installation

You can install the package into a Laravel app that uses Nova 4 via composer:

composer require naif/chatgpt-seeder

Publish the package's configuration file

php artisan vendor:publish --provider="Naif\ChatgptSeeder\ToolServiceProvider" 

Add the below to .env file:

CHATGPT_SEEDER_API_KEY= (OpenAI API Key)
CHATGPT_SEEDER_MAX_TOKENS=1000
CHATGPT_SEEDER_GENERATE_RETRY=3

Usage

Add the tool to NovaServiceProvider.php

  public function tools()
    {
        return [
            new ChatgptSeeder()
        ];
    }

Configuration

ChatGPT Seeder's configuration file, located at config/chatgpt-seeder.php\ Allows you to set and customize:

  • ChatGPT API Key
  • Maximum tokens to be used for each request (higher number yields longer data)
  • Retry count: Refers to the tool's ability to retry the data request when the returned data is not valid. It will continue retrying until it reaches the maximum retry count, ensuring a valid and accurate result while avoiding too many API requests.

Steps

1- Access ChatGPT Seeder Tool from the Laravel Nova dashboard.\ 2- Fill in the required information, such as: - Data type (Real or Fake) - Table Name - Number of Records - Data Required Description - Select any nullable columns.

3- Click the "Generate" button to initiate the data generation process.\ 4- Data Preview will show up displaying the first 8 records.\ 5- Click Proceed to insert data to table, or click on Regenerate again until you are satisfied with the result.

Screenshots

<img src="screenshots/home.png" width="800"> <img src="screenshots/preview.png" width="800">

Support:

naif@naif.io

https://naif.io

Bug Tracker:

https://github.com/naifalshaye/chatgpt-seeder/issues

License

The MIT License (MIT). Please see License File for more information.


Screenshots  
  • screenshots/home.png
  • screenshots/preview.png
  Files folder image Files  
File Role Description
Files folder imageconfig (1 file)
Files folder imagedist (1 file, 3 directories)
Files folder imageresources (3 directories)
Files folder imageroutes (2 files)
Files folder imagesrc (2 files, 1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file nova.mix.js Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file postcss.config.js Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file webpack.mix.js Data Auxiliary data

  Files folder image Files  /  config  
File Role Description
  Accessible without login Plain text file chatgpt-seeder.php Aux. Auxiliary script

  Files folder image Files  /  dist  
File Role Description
Files folder imagecss (1 file)
Files folder imageimages (1 file)
Files folder imagejs (1 file)
  Accessible without login Plain text file mix-manifest.json Data Auxiliary data

  Files folder image Files  /  dist  /  css  
File Role Description
  Accessible without login Plain text file tool.css Data Auxiliary data

  Files folder image Files  /  dist  /  images  
File Role Description
  Accessible without login Image file spinner.gif Icon Icon image

  Files folder image Files  /  dist  /  js  
File Role Description
  Accessible without login Plain text file tool.js Data Auxiliary data

  Files folder image Files  /  resources  
File Role Description
Files folder imageassets (1 directory)
Files folder imagecss (1 file)
Files folder imagejs (1 file, 1 directory)

  Files folder image Files  /  resources  /  assets  
File Role Description
Files folder imageimages (1 file)

  Files folder image Files  /  resources  /  assets  /  images  
File Role Description
  Accessible without login Image file loading-spinner.gif Icon Icon image

  Files folder image Files  /  resources  /  css  
File Role Description
  Accessible without login Plain text file tool.css Data Auxiliary data

  Files folder image Files  /  resources  /  js  
File Role Description
Files folder imagepages (1 file)
  Accessible without login Plain text file tool.js Data Auxiliary data

  Files folder image Files  /  resources  /  js  /  pages  
File Role Description
  Accessible without login Plain text file Tool.vue Data Auxiliary data

  Files folder image Files  /  routes  
File Role Description
  Plain text file api.php Class Class source
  Accessible without login Plain text file inertia.php Aux. Auxiliary script

  Files folder image Files  /  src  
File Role Description
Files folder imageHttp (2 directories)
  Plain text file ChatgptSeeder.php Class Class source
  Plain text file ToolServiceProvider.php Class Class source

  Files folder image Files  /  src  /  Http  
File Role Description
Files folder imageControllers (1 file)
Files folder imageMiddleware (1 file)

  Files folder image Files  /  src  /  Http  /  Controllers  
File Role Description
  Plain text file ChatGPTSeederController.php Class Class source

  Files folder image Files  /  src  /  Http  /  Middleware  
File Role Description
  Plain text file Authorize.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:112
This week:1
All time:9,573
This week:79Up