alnutile/laravel-chatgpt
Composer 安装命令:
composer require alnutile/laravel-chatgpt
包简介
Some base client work to talk to the api
README 文档
README
Going to build some basic Driver like clients to talk to different AI service but like with Laravel Storage it will treat them all the same.
- ChatGPT for text
- Jasper when ChatGPT is down :(
- Dall-2
- OpenAI Moderator
- Midjourney - when it gets an api
Installation
You can install the package via composer:
composer require alnutile/laravel-chatgpt
You can then set your .env:
AI_CLIENT=sk-key
AI_MOCK=false
If you set AI_MOCK to true it will just return some fixture data so if you are working in your UI for example it will just show that data.
Usage
Here is an example of
- Call Moderation to see if the text is ok
- TextClientFacade to do a text search with adding a prefix to the request
- SearchResults Event to just let the system know and react to it like make a local copy of the data
- ModerationFailed Event so you can react to that
$moderationOk = ModerationClientFacade::checkOk(request()->search); if ($moderationOk == false) { ModerationFailed::dispatch(request()); } else { $results = TextClientFacade::addPrefix('can you give me tl;dr terms of service for')->text($search); SearchResults::dispatch($results); }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
alnutile/laravel-chatgpt 适用场景与选型建议
alnutile/laravel-chatgpt 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.66k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2023 年 02 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「alnutile」 「laravel-chatgpt」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 alnutile/laravel-chatgpt 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 alnutile/laravel-chatgpt 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 alnutile/laravel-chatgpt 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Help with saving and getting JSON files for testing APIs
Help with some basic CRUD and UI using Inertia, Tailwind
Laravel chatgpt package, includes models listing and retrieving, completions prediction, chat completion from conversation, edits, images creation, image edit, image variations, audio translation and transcription.
Gherkin to Dusk
Alfabank REST API integration
统计信息
- 总下载量: 3.66k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-02