feat: 添加 AI Agent 对话测试工具 + 代码优化

主要变更:

- 新增 tests/test_ai_chat.py: AI Agent 对话测试工具

- 优化 core/pydantic_ai_agent.py 和 db/chat_log_db.py

- 清理归档文件,更新文档

Made-with: Cursor
This commit is contained in:
2026-02-28 16:19:35 +08:00
parent a6c42d505a
commit c39840fe15
49 changed files with 2453 additions and 8556 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,91 +0,0 @@
{
"_注释": "本文件是 customers.json 的字段说明,不参与程序运行,仅供人工查阅。",
"字段说明": {
"customer_id": "客户ID平台用户名/ID",
"name": "真实姓名",
"nickname": "昵称",
"email": "邮箱",
"phone": "手机号",
"wechat": "微信号",
"address": "收货地址",
"platform": "来源平台(淘宝/拼多多/微信等)",
"platform_id": "平台内部ID",
"budget": "预算描述(客户自述)",
"budget_range_min": "预算下限(元)",
"budget_range_max": "预算上限(元)",
"requirements": "历史需求列表",
"preference_services": "偏好服务类型列表",
"total_orders": "累计下单次数",
"total_spent": "累计消费金额(元)",
"avg_order_value": "平均客单价(元)",
"purchase_frequency": "购买频次描述",
"last_order_date": "最后下单日期",
"first_order_date": "首次下单日期",
"order_ids": "订单号列表",
"pending_orders": "待处理订单数",
"completed_orders": "已完成订单数",
"refund_count": "退款次数",
"personality": "性格标签列表(如:急躁/爽快/纠结)",
"communication_prefer": "沟通偏好",
"response_speed": "回复速度描述",
"patience_level": "耐心程度",
"customer_level": "客户等级A/B/C/D",
"vip": "是否VIP",
"vip_level": "VIP等级0=无)",
"vip_custom_price": "VIP专属报价0=无专属价)",
"last_price": "上次报价金额(元)",
"last_price_time": "上次报价时间",
"last_quote_no_convert": "上次报价后未成交,下次可适当降低",
"lowest_price_accepted":"历史接受过的最低价(元)",
"discount_given_count": "累计让价次数",
"price_sensitivity": "价格敏感度(高/中/低,自动计算)",
"decision_speed": "决策速度(快/慢,自动标记)",
"good_reviews": "好评次数",
"bad_reviews": "差评次数",
"dispute_count": "纠纷次数",
"follow_up_by": "跟进负责人",
"follow_up_date": "跟进日期",
"next_follow_date": "下次跟进日期",
"source": "客户来源渠道",
"coupon_used": "使用过的优惠券",
"notes": "备注列表(含自动报价记录)",
"tags": "自定义标签列表",
"created_at": "建档时间",
"last_contact": "最后联系时间",
"last_update": "最后更新时间",
"last_image_url": "最后发来的图片URL",
"last_image_time": "最后发图时间",
"processing_status": "当前作图状态pending/processing/done等",
"processing_image_url": "当前处理中的图片URL",
"expected_done_at": "预计完成时间",
"preferred_format": "偏好文件格式jpg/png/psd等",
"preferred_size": "偏好尺寸/分辨率描述",
"total_images_sent": "历史发图总数",
"complexity_history": "历史图片复杂度列表normal/complex/hard",
"image_type_history": "历史图片类型列表(印花/logo/人物等)",
"bulk_potential": "批量潜力(有/无/未知)",
"churn_risk": "流失风险(高/中/低,自动计算)",
"upsell_opportunity": "加购机会标签分层PSD/批量打包)",
"revision_count": "累计改稿次数",
"revision_orders": "有改稿的订单数",
"total_completed_orders":"已完成出图的订单数",
"blacklist": "是否黑名单",
"blacklist_reason": "拉黑原因",
"last_email_status": "最后邮件发送状态sent/failed",
"last_conversation_summary": "上次对话AI摘要15字以内",
"last_conversation_time": "上次对话时间"
}
}