2k11cs12/openai-laravel
Composer 安装命令:
composer require 2k11cs12/openai-laravel
包简介
Streamline OpenAI integration in Laravel for text generation.
README 文档
README
Laravel OpenAI Integration simplifies the integration of OpenAI's powerful language models into your Laravel application. This package provides a convenient way to interact with OpenAI for natural language processing and text generation tasks.
Features
- Easy configuration of OpenAI API credentials.
- Simplified methods for generating text using OpenAI models.
- Customizable options for text generation.
- Seamless integration with your Laravel project.
Installation
You can install this package via Composer. Run the following command in your Laravel project:
composer require Mangrio/laravel-openai
Configuration
OPENAI_API_KEY=your-api-key-here
OPENAI_API=https://api.openai.com/v1/chat/completions
OPENAI_MODEL=gpt-3.5-turbo
Usage
// Import the OpenAI facade at the top of your file
use Mangrio\OpenAiLaravel\Facades\OpenAiLaravel;
$response = OpenAiLaravel::generate('Prompt')
->key('your-api-key')
->temperature(1.0)
->maxTokens(1000)
->topP(0.8)
->model('custom-model')
->frequencyPenalty(0.5)
->presencePenalty(0.3)
->execute();
Additional Options
Contributing
License
2k11cs12/openai-laravel 适用场景与选型建议
2k11cs12/openai-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 09 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「integration」 「ai」 「openai」 「ChatGpt」 「mangrio」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 2k11cs12/openai-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 2k11cs12/openai-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 2k11cs12/openai-laravel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
PHP 8.0+ OpenAI API client with fully typed/documented requests+responses models, guzzle and symfony/http-client support and async/parallel requests.
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
Estimate AI API costs before making expensive calls
A powerful package that seamlessly integrates OpenAI's advanced AI capabilities into your Laravel applications. This package offers quick setup and intuitive configuration to leverage AI models for chat, embeddings, and more.
Laravel integration for blade-to-react
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-14