feat(shipping-notice): 添加识别定义和规则集管理功能,支持客户和站点的可配置识别规则
This commit is contained in:
1 parent
88408490d7
commit
34d489a2d1
167 files changed
+10365
-7978
No files matched your search
@@ -3,7 +3,7 @@ services/shipping_notice/extract.py
|
||||
|
||||
用途:抽取发货通知中的单头字段与订单行,并在收尾阶段补充文档级字段和告警。
|
||||
依赖:po_number、reservation_id、notice_lines 中的标准化与回填工具。
|
||||
逻辑:由 task_workflow.parse_notice 调用;优先 Dify 传入的 structured,无则走后端启发式规则兜底。
|
||||
逻辑:保留历史启发式文本工具;正式订单抽取已统一由 Dify 调用 get_order_extraction_context / submit_order_extraction。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -60,10 +60,10 @@ def extract_notice_fields(
|
||||
) -> tuple[dict[str, Any], float, list[str]]:
|
||||
"""
|
||||
抽取发货通知单头与订单行,并计算置信度与 warnings。
|
||||
【AI 触发时机】:由 parse_notice Tool 调用;Dify 画布/Agent 应先用 LLM 产出 structured 再传入,勿依赖本函数做 LLM 抽取。
|
||||
【AI 触发时机】:仅限内部文本预处理或迁移诊断;正式 Dify 画布不得调用本函数。
|
||||
|
||||
解析优先级:
|
||||
1. structured:Dify LLM/画布已抽取并传入 parse_notice
|
||||
1. structured:调用方已完成结构化抽取并传入
|
||||
2. 后端启发式规则(_heuristic_extract,仅作 Dify 无法实现时的兜底)
|
||||
|
||||
Args:
|
||||
|
||||
Reference in new issue
Block a user