feat(shipping-notice): 添加订单抽取功能,支持异步运行和管理,优化相关数据模型和处理逻辑
This commit is contained in:
1 parent
34d489a2d1
commit
ce26d6d0c4
144 files changed
+12241
-4233
No files matched your search
@@ -35,6 +35,7 @@ MIGRATED_EXTRA_REGISTRY_KEYS = frozenset({
|
||||
'runtime_provider',
|
||||
'conversation_mode',
|
||||
'dify_app_type',
|
||||
'exposure_mode',
|
||||
'iframe_url',
|
||||
'category',
|
||||
'sub_category',
|
||||
@@ -150,6 +151,7 @@ def validate_agent_payload(
|
||||
valid_runtime_providers = get_platform_enum_set('runtime_providers')
|
||||
valid_conversation_modes = get_platform_enum_set('conversation_modes')
|
||||
valid_dify_app_types = get_platform_enum_set('dify_app_types')
|
||||
valid_exposure_modes = get_platform_enum_set('exposure_modes')
|
||||
valid_suggested_styles = get_platform_enum_set('suggested_questions_styles')
|
||||
dify_required_providers = get_dify_required_providers()
|
||||
|
||||
@@ -175,6 +177,12 @@ def validate_agent_payload(
|
||||
if dify_app_type not in valid_dify_app_types:
|
||||
dify_app_type = 'chatflow'
|
||||
|
||||
exposure_mode = _strip(data.get('exposure_mode')) or (
|
||||
getattr(agent, 'exposure_mode', None) if agent else 'workspace'
|
||||
) or 'workspace'
|
||||
if exposure_mode not in valid_exposure_modes:
|
||||
raise ValidationError(f'无效的 exposure_mode: {exposure_mode}')
|
||||
|
||||
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 必填')
|
||||
@@ -260,6 +268,7 @@ def validate_agent_payload(
|
||||
'runtime_provider': runtime_provider,
|
||||
'conversation_mode': conversation_mode,
|
||||
'dify_app_type': dify_app_type,
|
||||
'exposure_mode': exposure_mode,
|
||||
'iframe_url': iframe_url or None,
|
||||
'category': _strip(data.get('category')) or None,
|
||||
'sub_category': _strip(data.get('sub_category')) or None,
|
||||
@@ -285,7 +294,7 @@ def apply_agent_payload(agent: Agent, normalized: dict[str, Any]) -> None:
|
||||
"""
|
||||
column_fields = (
|
||||
'name', 'description', 'icon_url', 'is_active', 'is_aggregate', 'dify_app_id', 'api_base_url', 'type',
|
||||
'agent_code', 'runtime_provider', 'conversation_mode', 'dify_app_type', 'iframe_url',
|
||||
'agent_code', 'runtime_provider', 'conversation_mode', 'dify_app_type', 'exposure_mode', 'iframe_url',
|
||||
'category', 'sub_category', 'sort_order', 'welcome_message', 'suggested_questions_style',
|
||||
'suggested_questions', 'capabilities', 'file_upload_policy', 'bound_schedule_task_id',
|
||||
'handler_config',
|
||||
|
||||
Reference in new issue
Block a user