feat:优化意图识别
This commit is contained in:
@@ -109,9 +109,9 @@ class PlannerNode(BaseNode):
|
||||
# 如果新增组件没有指定类型,无法选择对应物料,立即报错
|
||||
if component.disposition == "add" and component.component_type is None:
|
||||
raise ValueError(f"新增规划组件未指定物料类型: {component.plan_id}")
|
||||
# 新增或修改组件时,只要明确指定了类型,就必须在目录中存在
|
||||
# 新增、修改或更换组件时,只要明确指定了类型,就必须在目录中存在
|
||||
if (
|
||||
component.disposition in ("add", "modify")
|
||||
component.disposition in ("add", "modify", "replace")
|
||||
and component.component_type is not None
|
||||
and component.component_type not in supported_types
|
||||
):
|
||||
@@ -145,7 +145,7 @@ class PlannerNode(BaseNode):
|
||||
changed_ids = {
|
||||
component.target_id
|
||||
for component in plan.components
|
||||
if component.disposition in ("modify", "remove")
|
||||
if component.disposition in ("modify", "remove", "replace")
|
||||
}
|
||||
# 如果实际修改或删除的目标不在允许范围内,则拒绝扩大修改范围
|
||||
if outside := changed_ids - set(scope.target_ids):
|
||||
|
||||
Reference in New Issue
Block a user