Please Note: This is a very early concept project. At this stage it is very limited.
The goal of this project is to create open source versions of AI tools for use in PHP applications. At this stage it can predict files that you either give it, or when using the make:xxx command namespace.
You can install the package via composer:
composer require ClaraLeigh/gpt-helper-for-laravel
The package will automatically register itself.
You can publish the config file with:
php artisan vendor:publish --provider="GptHelperForLaravel\GptServiceProvider" --tag="config"
This will create a gpt-helper.php config file in your config directory. You can set your ChatGPT API key, model, GPT settings, and Domain-Driven Design starting directory in the configuration file.
You can publish the language files with:
php artisan vendor:publish --provider="GptHelperForLaravel\GptServiceProvider" --tag="lang"
This will create a resources/lang/vendor/gpt-helper directory, where you can store your language files.
php artisan gpt:predict
{source : The file we wish to predict}
{--prompt= : Add additonal text to give GPT context}
{--files= : A comma separated list of classnames/files to use as context}
{--summarizedFiles= : Same as files, but use a summary of instead to reduce the query}
For example, in your custom command:
php artisan make:model Books --prompt="This is a books model, with authors, genre's, publication dates and a relevant library"
This will create a Books model in your app directory, and the contents of the file will be modified using ChatGPT.
The following templates are available:
- Model
- Controller
- ... more coming soon
The following GPT settings are available:
- model
- max_tokens
- temperature
- n
- stop
composer test
I am considering changing this license, open a issue if you have any suggestions.
The MIT License (MIT). Please see License File for more information.