leopaulo88/gpt-trix-editor
最新稳定版本:v1.0.0
Composer 安装命令:
composer require leopaulo88/gpt-trix-editor
包简介
GPT Trix Editor package extends the default Trix editor features in the Filament PHP framework.
README 文档
README
The GPT Trix Editor is a form field component for the Filament PHP framework that enhances the Trix editor with OpenAI GPT features.
Features:
New - Run GPT on selected/highlighted text 👇
Installation
You can install the package via composer:
composer require askerakbar/gpt-trix-editor
Quick Start
- Publish the configuration files by running the following commands:
php artisan vendor:publish --provider="OpenAI\Laravel\ServiceProvider" php artisan vendor:publish --tag="gpt-trix-editor-config" php artisan vendor:publish --tag="gpt-trix-editor-translations"
- We're using https://github.com/openai-php/laravel laravel package to call the OpenAI APIs, so you need to set your OpenAI API key in the .env file or in the config/openapi.php file:
OPENAI_API_KEY=YOUR_KEY
- Optionally, you can customize the configuration file at config/gpt-trix-editor.php. This includes adding more prompts to the menu dropdown, setting temperature and max_tokens.
- Clear the configuration cache to make sure your changes take effect:
php artisan config:clear - Done!
Usage
Import the field component:
use AskerAkbar\GptTrixEditor\Components\GptTrixEditor;
You can use the GPT Trix Editor field component like any other field component:
GptTrixEditor::make('content')->columnSpan('full');
By default, the GPT Toolbar Button is enabled in the GP Trix Editor. However, if you want to disable it, you can do so like this:
GptTrixEditor::make('content')->disableToolbarButtons([ 'gptTools', ])->columnSpan('full');
To do
- ✅ Run the GPT actions on selected/highlighted text
Contribute / Report a bug / Security Vulnerabilities
If you would like to contriubte, please feel free to submit pull requests or open issues.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-02-15


