amrlotfy/laravel-ai-smart-reply
Composer 安装命令:
composer require amrlotfy/laravel-ai-smart-reply
包简介
Smart, multilingual AI-powered reply generator for any CRM / ERP / Support system built with Laravel. Supports OpenAI and OpenRouter, with Arabic and English responses.
README 文档
README
by Amr Lotfy
Smart, multilingual AI-powered reply generator for any CRM / ERP / Support system built with Laravel.
Supports OpenAI and OpenRouter, with Arabic and English responses.
⚙️ Features
- 🧩 Provider-based architecture (OpenAI, OpenRouter)
- 🌍 Language support: Arabic / English / Both
- 💬 Customizable AI prompt templates
- ⚡ Plug & play: Works with any CRM, ERP, or Ticket System
- 🪶 Lightweight & extendable — easy to add new providers
📦 Installation
You can install the package via Composer:
composer require amrlotfy/laravel-ai-smart-reply
If Laravel does not auto-discover the provider, you can manually register it in
config/app.php:
'providers' => [ AmrLotfy\AiSmartReply\AiSmartReplyServiceProvider::class, ],
Then publish the configuration file:
php artisan vendor:publish --provider="AmrLotfy\AiSmartReply\AiSmartReplyServiceProvider" --tag=config
⚙️ Configuration
Set your environment variables in .env:
AI_SMART_REPLY_PROVIDER=openai
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4o-mini
OPENROUTER_API_KEY=sk-...
OPENROUTER_MODEL=gpt-4-turbo
AI_SMART_REPLY_LANG=both
🧠 Usage Example
use AmrLotfy\AiSmartReply\Services\AiReply; // English $reply = AiReply::generate( message: 'Customer: My payment failed', context: 'CRM Ticket #552', lang: 'en' ); echo $reply; // Arabic $reply = AiReply::generate( message: 'العميل قال إن الدفع فشل', context: 'تذكرة رقم 552', lang: 'ar' ); echo $reply;
🧩 Configuration File Overview
config/ai-smart-reply.php:
return [ 'default' => 'openai', // or openrouter 'language' => 'both', // en | ar | both 'providers' => [ 'openai' => [...], 'openrouter' => [...], ], 'templates' => [ 'default' => [ 'en' => "You are a helpful support assistant. Context: {context}. Message: {message}", 'ar' => "أنت مساعد دعم فني. السياق: {context}. الرسالة: {message}", ], ], ];
🧱 Extend It
To add another provider, just create a class implementing:
AmrLotfy\AiSmartReply\Providers\AiProviderInterface
and register it in config/ai-smart-reply.php.
🧪 Coming Soon (v1.1)
- 🧠 Reply caching
- 🔁 Retry & Rate Limit handling
- 💬 Streaming responses
- 🧪 Unit Tests
- ⚙️ Queue support
🧑💻 Author
Amr Lotfy
- 📧 amrlotfy07@gmail.com
- 🧰 Laravel Developer | AI Automation Expert | Instructor
📄 License
MIT License © 2025 Amr Lotfy
amrlotfy/laravel-ai-smart-reply 适用场景与选型建议
amrlotfy/laravel-ai-smart-reply 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 9, 最近一次更新时间为 2025 年 10 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「crm」 「support」 「laravel」 「automation」 「ai」 「chatbot」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 amrlotfy/laravel-ai-smart-reply 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 amrlotfy/laravel-ai-smart-reply 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 amrlotfy/laravel-ai-smart-reply 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PHP client for the Salesforce SOAP API
Command-line utility for Vtiger CRM.
a simple toolkit for social networks
Library for Kommo (AmoCRM)
ARCANEDEV Support Helpers
Laravel Package for capsule CRM integration
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-18