Files
assistant/docs/RETURN_FAQ_TEST.md
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

3.8 KiB

退货相关 FAQ 测试报告

API 测试结果

1. Strapi API 直接调用测试

curl -X POST http://strapi_mcp:8001/tools/query_faq \
  -H 'Content-Type: application/json' \
  -d '{"category":"return","locale":"en","limit":5}'

结果: 成功返回 4 个退货相关 FAQ

2. 返回的 FAQ 列表

  1. Q: I received my order but one of the items is defective or incorrect. What should I do?

    • A: 如果收到有缺陷或错误的商品,需要通过账户提交退货申请...
    • 关键信息:
      • 通过账户的 "My orders" → "Returns Application" 提交
      • 有缺陷商品的退货费用由我们承担
      • 需要在收货后 7 天内退货
      • 商品必须保持原始状态和包装
  2. Q: How do I notify you of a complaint about my order?

    • A: 进入账户的 "My orders",选择不满意的订单,点击 "Returns Application"...
    • 关键信息:
      • 填写退货原因和产品数量
      • 有缺陷商品需要附上照片
      • 3 个工作日内会收到邮件回复
      • 退货需在批准后 7 天内完成
  3. Q: I received my order but one of the items is missing. What should I do?

    • A: 通过 "Returns Application",选择 "Not received" 作为退货原因...
  4. Q: What are the return costs?

    • A: 有缺陷/错误的商品:我们承担退货费用
    • 其他原因退货:费用自理

🎯 配置信息

FAQ 分类配置 (config.yaml)

faq_categories:
  return:
    endpoint: faq-return
    description: 退货相关
    keywords:
      - return
      - refund
      - complaint
      - defective

API 端点

  • Strapi API: https://cms.yehwang.com/api/faq-return?populate=deep&locale=en
  • MCP Tool: http://strapi_mcp:8001/tools/query_faq

支持的语言

  • en (英语)
  • nl (荷兰语)
  • de (德语)
  • es (西班牙语)
  • fr (法语)
  • it (意大利语)
  • tr (土耳其语)

📋 测试方式

方式 1: 通过测试页面

访问: http://localhost:8080/test_return.html

点击快速问题按钮:

  • "商品有缺陷"
  • "如何退货"
  • "退货政策"

方式 2: 通过 Chatwoot 测试页面

访问: http://localhost:8080/test-chat.html

Token: 39PNCMvbMk3NvB7uaDNucc6o

测试问题:

  • "I want to return a defective item"
  • "What is your return policy?"
  • "How do I get a refund?"

方式 3: 直接 API 调用

# 获取退货 FAQ
docker exec ai_agent curl -s -X POST http://strapi_mcp:8001/tools/query_faq \
  -H 'Content-Type: application/json' \
  -d '{"category":"return","locale":"en","limit":5}'

# 搜索退货相关内容
docker exec ai_agent curl -s -X POST http://strapi_mcp:8001/tools/search_knowledge_base \
  -H 'Content-Type: application/json' \
  -d '{"query":"return","locale":"en","limit":5}'

⚠️ 已知问题

  1. Agent 集成问题: 之前的日志显示有循环导入错误

    • 状态: 待修复
    • 影响: 无法通过 Chatwoot 获取 AI 回答
  2. MCP 工具调用: 历史日志显示 500 错误

    • 状态: 已修复(配置文件加载成功)
    • 最近调用: 200 OK

📊 测试结果总结

测试项 状态 说明
Strapi API 连接 成功 可正常获取数据
FAQ 数据解析 成功 正确解析 title/content
配置文件加载 成功 YAML 配置正常工作
MCP HTTP 接口 成功 返回正确的 JSON 格式
Agent 工具调用 ⚠️ 待测试 循环导入问题需修复
端到端对话 ⚠️ 待测试 依赖 Agent 修复

🎉 结论

退货 FAQ 的底层配置和 API 都工作正常:

  • Strapi CMS 数据可访问
  • MCP HTTP 接口正常响应
  • 配置文件化管理生效
  • ⚠️ Agent 集成需要修复循环导入问题

建议:先修复 Agent 的循环导入问题,然后进行完整的端到端测试。