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

View File

@@ -611,26 +611,10 @@ class CustomerServiceWorkflow:
)
return "\n".join(lines)
# ========== 全局实例 ==========
workflow = CustomerServiceWorkflow()
# ========== 客户需求变更 ==========
async def add_customer_requirement(self, task_id: str, customer_id: str,
requirement: str, changed_by: str = 'customer') -> bool:
"""
客户添加/修改需求细节
Args:
task_id: 任务 ID
customer_id: 客户 ID
requirement: 需求内容(如:"需要去掉背景""要分层文件"
changed_by: 修改者customer/staff
Returns:
bool: 是否成功
"""
# 检查任务是否存在
task = self.get_task(task_id)
if not task:
@@ -981,3 +965,7 @@ workflow = CustomerServiceWorkflow()
except Exception as e:
logger.error(f"派单失败:{e}")
return False
# ========== 全局实例 ==========
workflow = CustomerServiceWorkflow()