feat(chat): 应用目录只配置成聚合应用
This commit is contained in:
1 parent
5bef77f86c
commit
dab04d4c3e
28 files changed
+797
-138
No files matched your search
@@ -44,6 +44,7 @@ MIGRATED_EXTRA_REGISTRY_KEYS = frozenset({
|
||||
'suggested_questions',
|
||||
'capabilities',
|
||||
'tool_run_progress',
|
||||
'is_aggregate',
|
||||
})
|
||||
|
||||
|
||||
@@ -68,6 +69,13 @@ def _parse_is_active(raw: Any, *, default: bool) -> bool:
|
||||
return coerce_manifest_boolean(raw, context='is_active')
|
||||
|
||||
|
||||
def _parse_is_aggregate(raw: Any, *, default: bool) -> bool:
|
||||
"""Admin is_aggregate 布尔归一化;只有为 true 时才保留目录成员配置。"""
|
||||
if raw is None:
|
||||
return default
|
||||
return coerce_manifest_boolean(raw, context='is_aggregate')
|
||||
|
||||
|
||||
def _parse_bound_schedule_task_id(raw: Any) -> int | None:
|
||||
if raw is None or raw == '':
|
||||
return None
|
||||
@@ -231,12 +239,19 @@ def validate_agent_payload(
|
||||
if 'is_active' in data
|
||||
else is_active_default
|
||||
)
|
||||
is_aggregate_default = bool(getattr(agent, 'is_aggregate', False)) if agent else False
|
||||
is_aggregate = (
|
||||
_parse_is_aggregate(data.get('is_aggregate'), default=is_aggregate_default)
|
||||
if 'is_aggregate' in data
|
||||
else is_aggregate_default
|
||||
)
|
||||
|
||||
return {
|
||||
'name': _strip(data.get('name')),
|
||||
'description': data.get('description'),
|
||||
'icon_url': data.get('icon_url'),
|
||||
'is_active': is_active,
|
||||
'is_aggregate': is_aggregate,
|
||||
'dify_app_id': dify_app_id or None,
|
||||
'dify_api_key': _strip(data.get('dify_api_key')) or None,
|
||||
'api_base_url': _strip(data.get('api_base_url')) or None,
|
||||
@@ -269,7 +284,7 @@ def apply_agent_payload(agent: Agent, normalized: dict[str, Any]) -> None:
|
||||
normalized: validate_agent_payload 的返回值。
|
||||
"""
|
||||
column_fields = (
|
||||
'name', 'description', 'icon_url', 'is_active', 'dify_app_id', 'api_base_url', 'type',
|
||||
'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',
|
||||
'category', 'sub_category', 'sort_order', 'welcome_message', 'suggested_questions_style',
|
||||
'suggested_questions', 'capabilities', 'file_upload_policy', 'bound_schedule_task_id',
|
||||
|
||||
Reference in new issue
Block a user