A Laravel package to review content and images using ChatGPT API
gamalkh299/gpt-content-reviewer is a Laravel package for a laravel package to review content and images using chatgpt api.
It currently has 1 GitHub stars and 32 downloads on Packagist (latest version 1.0.0).
Install it with composer require gamalkh299/gpt-content-reviewer.
Discover more Laravel packages by gamalkh299
or browse all Laravel packages to compare alternatives.
Last updated
This package allows you to review the content of a model using ChatGPT Moderation API.
You can install the package via composer:
composer require gamalkh299/gpt-content-reviewer
You can publish and run the migrations with:
php artisan vendor:publish --tag="gpt-content-reviewer"
php artisan migrate
This is the contents of the published config file:
return [
'key' => env('CHAT_GPT_API_KEY'),
'queue' => env('GPT_QUEUE', 'gpt-content-reviewer'),
];
.env file.CHAT_GPT_API_KEY=your-api-key
Then add the following trait to the model you want to review its content.
use gamalkh\GptContentReviewer\Traits\Reviewable;
Don't forget to implement the getReviewableColumns abstract function to specify the columns you want to review and handleReviewResult abstract function to handle the review result.
public function getReviewableColumns(): array
{
// return the columns you want to review
return ['content'];
}
public function handleReviewResult($result)
{
// handle the review result
}
before you use it you need to run the following command to create the review table.
php artisan queue:work --queue=gpt-content-reviewer
you can use the package to create a review for a model and it will be added to the queue to be reviewed.
$model = Model::find(1);
$gptContentReviewer = new gamalkh\GptContentReviewer();
$gptContentReviewer->createReview($model);
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.