19 lines
607 B
Python
19 lines
607 B
Python
"""
|
|
services/shipping_notice/agent_resolver.py
|
|
|
|
用途:定位发货通知聊天 Agent 的模型记录与名称常量。
|
|
依赖:app.models.Agent。
|
|
逻辑:由 dify_inputs、聊天入口或 Agent 相关编排调用本文件,确保发货通知流程绑定到正确的 Agent。
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from app.models import Agent
|
|
|
|
CHAT_AGENT_NAME = "货代发货通知 Agent"
|
|
|
|
|
|
def resolve_chat_agent() -> Agent | None:
|
|
"""按 CHAT_AGENT_NAME 查找当前启用的发货通知聊天 Agent 记录。"""
|
|
return Agent.query.filter_by(name=CHAT_AGENT_NAME, is_active=True).first()
|