naif/ai-validation
Composer 安装命令:
composer require naif/ai-validation
包简介
AI Validator for Laravel: Uses ChatGPT (GPT-3.5-turbo) to easily check and filter user inputs.
README 文档
README
AI Validator for Laravel: Uses ChatGPT (GPT-3.5-turbo) to easily check and filter user inputs.
Requirements
- PHP 7.2 or higher
- Laravel 6.0 or higher
- Open AI API Key
Installation
You can install the package into a Laravel app via composer:
composer require naif/ai-validation
Publish config file
php artisan vendor:publish --provider="Naif\AIValidation\AIValidationServiceProvider"
OpenAI API Key
Create your API Key from https://platform.openai.com/api-keys
Add API Key in .env file
CHATGPT_API_KEY=
Usage
Field validation rule
use Naif\AIValidation\Rules\AIValidation;
$request->validate([
'field_name' => [AIValidation::make('ads')],
]);
Supported Validation Types
- Spam: Identifies unsolicited, bulk, or irrelevant messages.
- Nonsense: Flags text that is illogical or meaningless.
- Botcheck: Detects text likely generated by automated bots.
- Emoji Overuse: Catches excessive use of emojis in text.
- Promotional: Highlights promotional or advertising content.
- Ads: Identifies content that is explicitly advertising.
- Swearing: Flags use of profanity or offensive language.
- Hate Speech: Detects speech that promotes hate or discrimination.
- Political Bias: Identifies politically biased or partisan content.
- Adult Content: Flags explicit or sexually suggestive content.
- Secure: Checks for content with potential security risks.
- Phishing: Identifies attempts to acquire sensitive information.
- Personal Info: Detects the presence of private personal data.
Support:
Bug Tracker:
https://github.com/naifalshaye/ai-validation/issues/new
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-22