Files
tw/README.md
jimi c39840fe15 feat: 添加 AI Agent 对话测试工具 + 代码优化
主要变更:

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

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

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

Made-with: Cursor
2026-02-28 16:19:35 +08:00

83 lines
2.0 KiB
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
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.
# AI 客服系统 - 天网协作版
**版本**: v1.0 | **服务器**: 1.12.50.92
---
## 功能概览
| 功能 | 说明 |
|------|------|
| 天网协作 | 接收天网任务,支持指定客户回复触发 |
| 三种工作流 | 找图 / 处理图片 / 转人工派单 |
| 图片任务数据库 | 任务持久化,支持后续增加需求 |
| 图绘派单系统 | 自动派单给在线设计师 |
| 文字检测加价 | 自动识别文字数量并加价 |
| 风险评估 | 自动识别敏感内容,拒绝不良订单 |
| 作图失败转人工 | 失败自动转接人工客服 |
---
## 快速开始
```bash
cd /root/ai_customer_service/ai_cs
pip3 install -r requirements.txt
# 天网协作版(仅 HTTP API
python3 run.py --api-only
# 完整版HTTP API + WebSocket + AI Agent
python3 run.py --tianwang
# AI 客服(仅 WebSocket默认
python3 run.py
```
### 后台运行
```bash
nohup python3 run.py --api-only > /tmp/tianwang.log 2>&1 &
```
### 验证
```bash
curl http://localhost:6060/api/health
```
---
## API 地址
| 服务 | 地址 |
|------|------|
| AI 客服 API | `http://127.0.0.1:6060` |
| 派单系统 | `http://1.12.50.92:8005` |
| 图绘平台 | `http://1.12.50.92:8002` |
---
## 文档
| 文档 | 内容 |
|------|------|
| **项目功能汇总.md** | 全部功能详细说明(工作流、报价、风险、派单、数据库等) |
| **部署文档.md** | 部署、API 接口、天网集成、多进程、故障排查 |
---
## 项目结构
```
├── api/ # HTTP API 服务器
├── core/ # 核心逻辑Agent、工作流、WebSocket
├── config/ # 配置文件
├── db/ # 数据库模块
├── image/ # 图片处理模块
├── services/ # 外部服务集成
├── utils/ # 工具模块
├── skills/ # Agent 技能定义
└── run.py # 统一入口(--api-only / --tianwang / 默认 WebSocket
```