feat(shipping-notice): 增强订单抽取功能,添加进度事件和诊断运行管理,优化数据模型和访问控制
This commit is contained in:
1 parent
ce26d6d0c4
commit
c4095b08da
175 files changed
+13064
-1814
No files matched your search
@@ -183,6 +183,20 @@ def validate_agent_payload(
|
||||
if exposure_mode not in valid_exposure_modes:
|
||||
raise ValidationError(f'无效的 exposure_mode: {exposure_mode}')
|
||||
|
||||
existing_exposure = _strip(getattr(agent, 'exposure_mode', None) if agent else '')
|
||||
if agent is not None and existing_exposure and exposure_mode != existing_exposure:
|
||||
raise ValidationError(
|
||||
'应用与内部执行器不可互相转换',
|
||||
code='AGENT.EXPOSURE_ROLE_IMMUTABLE',
|
||||
)
|
||||
# 新建内部执行器统一使用 Dify Workflow;历史内部记录保留原组合以兼容旧数据。
|
||||
if exposure_mode == 'internal' and agent is None:
|
||||
if runtime_provider != 'dify' or dify_app_type != 'workflow':
|
||||
raise ValidationError(
|
||||
'新建内部执行器必须使用 runtime_provider=dify 与 dify_app_type=workflow',
|
||||
code='AGENT.INTERNAL_EXECUTOR_CONFIG_INVALID',
|
||||
)
|
||||
|
||||
dify_app_id = _strip(data.get('dify_app_id')) or (agent.dify_app_id if agent else '')
|
||||
if runtime_provider in dify_required_providers and not dify_app_id:
|
||||
raise ValidationError('runtime_provider 含 dify 时 dify_app_id 必填')
|
||||
|
||||
Reference in new issue
Block a user