askerakbar/gpt-trix-editor
Composer 安装命令:
composer require askerakbar/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 - Call ChatGPT API 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
You can also set the GPT model in the .env
TRIX_GPT_MODEL=YOUR_MODEL
- 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.
askerakbar/gpt-trix-editor 适用场景与选型建议
askerakbar/gpt-trix-editor 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 8.09k 次下载、GitHub Stars 达 45, 最近一次更新时间为 2023 年 04 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「filament」 「GPT-3」 「gpt-trix-editor」 「filament-field-for-gpt-3」 「filament-3-grammar-check」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 askerakbar/gpt-trix-editor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 askerakbar/gpt-trix-editor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 askerakbar/gpt-trix-editor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP 8.0+ OpenAI API client with fully typed/documented requests+responses models, guzzle and symfony/http-client support and async/parallel requests.
OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API
An OpenAI REST API Client with ChatGPT, GPT-3, Codex, DALL·E.
PHP BPE Text Encoder/Decoder for GPT-2 / GPT-3. Based on coderevolutionplugins/gpt-3-encoder-php
OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API, forked from https://github.com/openai-php/client
A Laravel package for interacting with OpenAI's GPT-3.
统计信息
- 总下载量: 8.09k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 45
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-02


