llm-agents/openai-client
Composer 安装命令:
composer require llm-agents/openai-client
包简介
OpenAI API client for LLM Agents
README 文档
README
This package is your go-to solution for integrating OpenAI's powerful API into your LLM Agents projects.
What's in the box?
- Easy setup with Spiral framework
- Smooth integration with OpenAI's API
- Built to work hand-in-hand with LLM Agents
Installation 🛠️
- Run this command to add the package to your project:
composer require llm-agents/openai-client
- That's it! You're ready to roll.
Setting it up in Spiral
To get the OpenAI client up and running in your Spiral app, you need to register the bootloader.
Here's how:
-
Open up your
app/src/Application/Kernel.phpfile. -
In your
Kernelclass add theLLM\Agents\OpenAI\Client\Integration\Spiral\OpenAIClientBootloaderbootloader:
class Kernel extends \Spiral\Framework\Kernel { public function defineBootloaders(): array { return [ // ... other bootloaders ... \LLM\Agents\OpenAI\Client\Integration\Spiral\OpenAIClientBootloader::class, ]; } }
The package uses your OpenAI API key and organization (if you have one) to authenticate.
Set these up in your .env file:
OPENAI_KEY=your_api_key_here
Setting it up in Laravel
If you're using the Laravel framework, you'll need to install the openai-php/laravel package register the Service
provider.
Here's how:
- Install the
openai-php/laravelpackage:
composer require openai-php/laravel
- Next, execute the install command:
php artisan openai:install
- Finally, add your OpenAI API key to your
.envfile:
OPENAI_API_KEY=sk-...
OPENAI_ORGANIZATION=org-...
- And register the
LLM\Agents\OpenAI\Client\Integration\Laravel\OpenAIClientServiceProvider
And that's it! The service provider will take care of registering the LLMInterface for you.
Contributing
We're always happy to get help making this package even better! Here's how you can chip in:
- Fork the repo
- Make your changes
- Create a new Pull Request
Please make sure your code follows PSR-12 coding standards and include tests for any new features.
License
This project is licensed under the MIT License - see the LICENSE file for details.
That's all, folks! If you run into any issues or have questions, feel free to open an issue on GitHub.
llm-agents/openai-client 适用场景与选型建议
llm-agents/openai-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 300 次下载、GitHub Stars 达 4, 最近一次更新时间为 2024 年 08 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 llm-agents/openai-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 llm-agents/openai-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 300
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 12
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-27