feat: 添加图片搜索功能和 Qwen 模型支持

图片搜索功能(以图搜图):
- Chatwoot webhook 检测图片搜索消息 (content_type="search_image")
- 从 content_attributes.url 提取图片 URL
- 调用 Mall API 图片搜索接口 (/mall/api/spu?searchImageUrl=...)
- 支持嵌套和顶层 URL 位置提取
- Product Agent 添加 fast path 直接调用图片搜索工具
- 防止无限循环(使用后清除 context.image_search_url)

Qwen 模型支持:
- 添加 LLM provider 选择(zhipu/qwen)
- 实现 QwenLLMClient 类(基于 DashScope SDK)
- 添加 dashscope>=1.14.0 依赖
- 修复 API key 设置(直接设置 dashscope.api_key)
- 更新 .env.example 和 docker-compose.yml 配置

其他优化:
- 重构 Chatwoot 集成代码(删除冗余)
- 优化 Product Agent prompt
- 增强 Customer Service Agent 多语言支持

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
wangliang
2026-01-27 19:10:06 +08:00
parent 754804219f
commit 965b11316e
12 changed files with 937 additions and 199 deletions

View File

@@ -1,8 +1,22 @@
# B2B Shopping AI Assistant Platform - Environment Variables
# ============ AI Model ============
# LLM Provider: 'zhipu' (default) or 'qwen'
LLM_PROVIDER=zhipu
# ZhipuAI (智谱 AI)
ZHIPU_API_KEY=your_zhipu_api_key
ZHIPU_MODEL=glm-4
ZHIPU_MODEL=glm-4-flash
# Qwen (通义千问) - Alternative provider
QWEN_API_KEY=your_qwen_dashscope_api_key
QWEN_MODEL=qwen-omni-turbo
# Available Qwen models:
# - qwen-omni-turbo (多模态,支持图片/语音)
# - qwen-plus (通用模型)
# - qwen-turbo (高速模型)
# - qwen-long (长文本)
# - qwen-max (最强模型)
# ============ Redis ============
REDIS_HOST=redis