承接 sbh/ai-integration-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

sbh/ai-integration-bundle

Composer 安装命令:

composer require sbh/ai-integration-bundle

包简介

A Symfony bundle to integrate AI models (ChatGPT, DeepSeek, Gemini...) with a unified interface.

README 文档

README

License PHP Version

A powerful Symfony bundle that provides unified access to multiple AI providers (ChatGPT, Gemini, DeepSeek) with a simple, consistent interface.

✨ Features

  • Multi-provider support: Switch between ChatGPT, Gemini, DeepSeek and more
  • Simple configuration: YAML-based setup with environment variables
  • Extensible architecture: Easily add new AI providers
  • Smart defaults: Pre-configured with recommended models for each provider
  • Production-ready: Built on Symfony's HttpClient for reliability
  • Caching support: Optional caching of API responses

📦 Installation

Requirements

  • PHP 8.1 or higher
  • Symfony 5.4+ or 6.0+

1. Install with Composer

composer require sbh/ai-integration-bundle

⚙️ Configuration

config/packages/ai_integration.yaml

ai_integration:
    default_provider: chatgpt
    providers:
        chatgpt:
            api_key: '%env(CHATGPT_API_KEY)%'
            model: 'gpt-4o'
        gemini:
            api_key: '%env(GEMINI_API_KEY)%'
            model: 'gemini-1.5-pro'
        deepseek:
            api_key: '%env(DEEPSEEK_API_KEY)%'
            model: 'deepseek-chat'

Add to your API keys in .env

CHATGPT_API_KEY=sk-xxxx
GEMINI_API_KEY=xxxx
DEEPSEEK_API_KEY=xxxx

🛠 Usage

Inject the AIClientFactory into your service or controller.

use Sbh\AiIntegrationBundle\Service\AIClientFactory;

public function __construct(private AIClientFactory $factory) {}

public function askAI(): void
{
    $client = $this->factory->getClient('gemini'); // or chatgpt, deepseek...
    $answer = $client->chat('What is Symfony?');
    dump($answer);
}

Or via a route:

#[Route('/ask/{provider}', name: 'ask_ai')]
public function ask(AIClientFactory $factory, string $provider = 'chatgpt'): JsonResponse
{
    $client = $factory->getClient($provider);
    $answer = $client->chat('Explain Symfony Bundles');
    return $this->json(['provider' => $provider, 'answer' => $answer]);
}

➕ Adding a New AI Provider

  • Create a new Client class in src/Service implementing AIClientInterface.
namespace Sbh\AiIntegrationBundle\Service;

use Symfony\Contracts\HttpClient\HttpClientInterface;

class ClaudeClient implements AIClientInterface
{
    public function __construct(
        private string $apiKey,
        private ?string $model,
        private HttpClientInterface $httpClient
    ) {}

    public function chat(string $prompt, array $options = []): string
    {
        // Call the Claude API here
    }
}
  • Add its configuration in ai_integration.yaml:
providers:
    claude:
        api_key: '%env(CLAUDE_API_KEY)%'
        model: 'claude-3-opus'
 Update the AIClientFactory to add a case 'claude' in the match() statement.

📜 Requirements

  • PHP >=8.1

  • Symfony ^6.0 || ^7.0

  • symfony/http-client

🗺 Roadmap

  • ✅ Add support for service tags & auto-discovery (no factory changes for new tools).

  • ✅ Streaming support for long responses.

  • ✅ Embeddings & vector search integration (pgvector, Pinecone).

👤 Author

  • Said Ben Hmed
  • MIT License.

sbh/ai-integration-bundle 适用场景与选型建议

sbh/ai-integration-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 07 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 sbh/ai-integration-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 sbh/ai-integration-bundle 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-17