feat(agent): 增强 Agent 配置,新增结构化字段与聊天功能支持

This commit is contained in:
hugo committed 2026-07-07 11:10:32 +08:00
1 parent ac4262cd75
commit c8ce77199e
183 files changed
+11690 -2300

No files matched your search

@@ -1,18 +1,23 @@
"""
services/shipping_notice/agent_resolver.py
用途:定位发货通知聊天 Agent 的模型记录与名称常量。
依赖:app.models.Agent。
逻辑:由 dify_inputs、聊天入口或 Agent 相关编排调用本文件,确保发货通知流程绑定到正确的 Agent。
用途:定位发货通知聊天 Agent 的模型记录。
依赖:app.models.Agent、agent_registry.resolver(agent_code 列)。
逻辑:由 dify_executor、聊天入口或 Agent 相关编排调用本文件,确保发货通知流程绑定到正确的 Agent。
"""
from __future__ import annotations
from app.models import Agent
# 历史种子/展示用常量;运行时识别须使用 agent_code=shipping_notice。
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()
"""按 agent_code=shipping_notice 查找当前启用的发货通知聊天 Agent 记录。"""
return (
Agent.query.filter_by(agent_code='shipping_notice', is_active=True)
.order_by(Agent.id.asc())
.first()
)