Files
assistant/scripts/verify-webhook.sh
wangliang e093995368 feat: 增强 Agent 系统和完善项目结构
主要改进:
- Agent 增强: 订单查询、售后支持、客服路由等功能优化
- 新增语言检测和 Token 管理模块
- 改进 Chatwoot webhook 处理和用户标识
- MCP 服务器增强: 订单 MCP 和 Strapi MCP 功能扩展
- 新增商城客户端、知识库、缓存和同步模块
- 添加多语言提示词系统 (YAML)
- 完善项目结构: 整理文档、脚本和测试文件
- 新增调试和测试工具脚本

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-16 16:28:47 +08:00

82 lines
2.5 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 验证 Chatwoot Webhook 配置
echo "======================================"
echo "Chatwoot Webhook 配置验证工具"
echo "======================================"
echo ""
# 检查 Agent 服务
echo "1⃣ 检查 Agent 服务..."
if curl -s http://localhost:8000/health | grep -q "healthy"; then
echo " ✅ Agent 服务运行正常 (http://localhost:8000)"
else
echo " ❌ Agent 服务未运行"
exit 1
fi
echo ""
# 检查 Chatwoot 服务
echo "2⃣ 检查 Chatwoot 服务..."
if curl -s http://localhost:3000 > /dev/null; then
echo " ✅ Chatwoot 服务运行正常 (http://localhost:3000)"
else
echo " ❌ Chatwoot 服务未运行"
exit 1
fi
echo ""
# 检查网络连通性(从 Chatwoot 容器访问 Agent
echo "3⃣ 检查容器间网络连通性..."
if docker exec ai_chatwoot wget -q -O - http://agent:8000/health | grep -q "healthy"; then
echo " ✅ Chatwoot 可以访问 Agent (http://agent:8000)"
else
echo " ❌ Chatwoot 无法访问 Agent"
echo " 请检查两个容器是否在同一 Docker 网络中"
exit 1
fi
echo ""
# 检查环境变量配置
echo "4⃣ 检查环境变量配置..."
if [ -f .env ]; then
if grep -q "CHATWOOT_WEBHOOK_SECRET" .env; then
echo " ✅ CHATWOOT_WEBHOOK_SECRET 已配置"
else
echo " ⚠️ CHATWOOT_WEBHOOK_SECRET 未配置(可选)"
fi
else
echo " ⚠️ .env 文件不存在"
fi
echo ""
# 显示配置摘要
echo "======================================"
echo "📋 配置摘要"
echo "======================================"
echo ""
echo "Agent 服务:"
echo " • 容器名称: ai_agent"
echo " • 内部地址: http://agent:8000"
echo " • Webhook 端点: http://agent:8000/webhooks/chatwoot"
echo " • 外部访问: http://localhost:8000"
echo ""
echo "Chatwoot 服务:"
echo " • 容器名称: ai_chatwoot"
echo " • 内部地址: http://chatwoot:3000"
echo " • 外部访问: http://localhost:3000"
echo ""
echo "📝 在 Chatwoot 界面中配置:"
echo " 1. 访问: http://localhost:3000"
echo " 2. 进入: Settings → Inboxes → 选择 Website 收件箱"
echo " 3. 点击: Configuration 标签"
echo " 4. 设置 Webhook URL 为: http://agent:8000/webhooks/chatwoot"
echo " 5. 点击 Save 保存"
echo ""
echo "⚠️ 注意事项:"
echo " • 不要在 Chatwoot 中启用内置机器人Bot"
echo " • 只配置 Webhook 即可"
echo " • Webhook URL 使用 'agent' 而不是 'localhost'"
echo ""
echo "======================================"