llm-agents/openai-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

llm-agents/openai-client

Composer 安装命令:

composer require llm-agents/openai-client

包简介

OpenAI API client for LLM Agents

README 文档

README

PHP Latest Version on Packagist Total Downloads

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 🛠️

  1. Run this command to add the package to your project:
composer require llm-agents/openai-client
  1. 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:

  1. Open up your app/src/Application/Kernel.php file.

  2. In your Kernel class add the LLM\Agents\OpenAI\Client\Integration\Spiral\OpenAIClientBootloader bootloader:

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:

  1. Install the openai-php/laravel package:
composer require openai-php/laravel
  1. Next, execute the install command:
php artisan openai:install
  1. Finally, add your OpenAI API key to your .env file:
OPENAI_API_KEY=sk-...
OPENAI_ORGANIZATION=org-...
  1. 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:

  1. Fork the repo
  2. Make your changes
  3. 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 我们能提供哪些服务?
定制开发 / 二次开发

基于 llm-agents/openai-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 300
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 12
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-27