feat(shipping-notice): 增强发货通知候选管理功能,支持候选选择、重复检测与业务摘要修订
This commit is contained in:
1 parent
70f684b94a
commit
b595e157e9
83 files changed
+5857
-200
No files matched your search
@@ -2,13 +2,50 @@
|
||||
services/shipping_notice/tools.py
|
||||
|
||||
用途:发货通知 Agent Tool 统一门面(API 唯一业务入口,无编排实现)。
|
||||
依赖:task_workflow、inventory_workflow、inventory_rpa_workflow、fulfillment_workflow。
|
||||
依赖:task_workflow、inventory_workflow、inventory_rpa_workflow、fulfillment_workflow;order_extraction 延迟导入以避免建批循环依赖。
|
||||
逻辑:shipping_notice_tools / workspace_shipping_notice 仅 import 本模块公开符号。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.services.shipping_notice import fulfillment_workflow, inventory_rpa_workflow, inventory_workflow, task_workflow
|
||||
from app.services.shipping_notice import (
|
||||
fulfillment_workflow,
|
||||
inventory_rpa_workflow,
|
||||
inventory_workflow,
|
||||
task_workflow,
|
||||
)
|
||||
|
||||
|
||||
def get_order_extraction_context(payload: dict):
|
||||
"""
|
||||
返回点击发送后的完整订单抽取上下文。
|
||||
【AI 触发时机】:仅在 Dify 订单抽取固定分支的 LLM 节点之前调用。
|
||||
|
||||
核心逻辑:延迟导入实现,避免 batch_from_intakes 与 Tool 门面形成模块初始化环。
|
||||
Args:
|
||||
payload: 必须包含完整 agent_runtime_context。
|
||||
Returns:
|
||||
邮件/附件文本、输入快照与抽取契约。
|
||||
"""
|
||||
from app.services.shipping_notice.order_extraction import get_order_extraction_context as _get
|
||||
|
||||
return _get(payload)
|
||||
|
||||
|
||||
def submit_order_extraction(payload: dict):
|
||||
"""
|
||||
提交 LLM 完整订单结果并执行自动建单。
|
||||
【AI 触发时机】:订单抽取 LLM 与 JSON 标准化节点成功后调用。
|
||||
|
||||
核心逻辑:延迟导入实现,保留 Tool 门面为唯一 API 业务入口且不引入建批循环依赖。
|
||||
Args:
|
||||
payload: 完整运行态上下文、输入快照、契约版本与 orders[]。
|
||||
Returns:
|
||||
自动建单、打开已有任务和待处理订单摘要。
|
||||
"""
|
||||
from app.services.shipping_notice.order_extraction import submit_order_extraction as _submit
|
||||
|
||||
return _submit(payload)
|
||||
|
||||
# 任务 / 批次 / 解析 / 决策
|
||||
create_batch = task_workflow.create_batch
|
||||
|
||||
Reference in new issue
Block a user