refactor: unify core pipeline logging with cs_agent logger
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
from core.post_ops import record_deal_success
|
||||
from core.order_helpers import parse_order_info
|
||||
|
||||
logger = logging.getLogger("cs_agent")
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from core.pydantic_ai_agent import AgentResponse, ConversationState, CustomerMessage, CustomerServiceAgent
|
||||
|
||||
@@ -53,9 +56,9 @@ async def handle_order_notification(
|
||||
)
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"[Agent] 触发作图失败: {e}")
|
||||
logger.exception("[Agent] 触发作图失败: %s", e)
|
||||
elif not customer_text:
|
||||
print(f"[Agent] 订单通知静默({pay_status or order_status}),跳过回复")
|
||||
logger.info("[Agent] 订单通知静默(%s),跳过回复", pay_status or order_status)
|
||||
return AgentResponse(reply="", should_reply=False, need_transfer=False)
|
||||
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user