diff --git a/core/pydantic_ai_agent.py b/core/pydantic_ai_agent.py index 7f82fa5..95dd74f 100755 --- a/core/pydantic_ai_agent.py +++ b/core/pydantic_ai_agent.py @@ -2131,7 +2131,7 @@ class CustomerServiceAgent: "need_transfer": True, } - # 查找图片意图:直接自动处理并返回图绘链接 + # 查找图片意图:优先直接自动处理并回图绘链接 intent_text = (message.msg or "") + " " + " ".join(state.pending_requirements[-5:]) workflow_type, _ = self.workflow_router.detect_workflow(intent_text) if workflow_type == "find_image": @@ -2178,12 +2178,16 @@ class CustomerServiceAgent: raise RuntimeError(str(link)) links.append(link) except Exception as e: - print(f"[Agent] 自动处理并上传失败,回退统一报价: {e}") + # 找图分支失败时,不直接报价,先回到“收集需求再做” + print(f"[Agent] 找图自动处理失败,回退需求澄清: {e}") + return { + "reply": "这种可以做类似款。你先说下具体需求:要几张、是否改字、尺寸比例、交付格式(单图/打包链接),我按需求给你直接做。", + "need_transfer": False, + } else: - lines = [f"这批我先给你处理好了,按打包 {bundle_price} 元。"] + lines = [f"找到了,链接如下:"] for i, link in enumerate(links, 1): lines.append(f"链接{i}:{link}") - lines.append("你先看下效果,没问题我就按这个标准继续给你做。") state.last_price = bundle_price try: from db.customer_db import db