feat(n7web): sync N7 scene cards and optimize runtime
This commit is contained in:
@@ -2225,8 +2225,24 @@ class AssistantCapabilityCatalog:
|
||||
operations = _safe_mode_operations(
|
||||
[item for item in requests if isinstance(item, Mapping)]
|
||||
)
|
||||
callable_mode = bool(operation_ids) and all(
|
||||
capability_id in callable_capabilities for capability_id in operation_ids
|
||||
n7_transfer_operation_ids = [
|
||||
capability_id
|
||||
for capability_id in operation_ids
|
||||
if capability_id not in callable_capabilities
|
||||
]
|
||||
command_flow = raw.get("command_flow")
|
||||
command_plans = (
|
||||
command_flow.get("plans")
|
||||
if isinstance(command_flow, Mapping)
|
||||
else None
|
||||
)
|
||||
n7_transfer_ready = (
|
||||
raw.get("source_topic") == "from_n7/scenes"
|
||||
and isinstance(command_plans, Mapping)
|
||||
and bool(command_plans)
|
||||
)
|
||||
callable_mode = bool(operation_ids) and (
|
||||
not n7_transfer_operation_ids or n7_transfer_ready
|
||||
)
|
||||
modes.append(
|
||||
{
|
||||
@@ -2240,6 +2256,9 @@ class AssistantCapabilityCatalog:
|
||||
"operation_ids": operation_ids,
|
||||
"operations": operations,
|
||||
"assistant_callable": callable_mode,
|
||||
"n7_transfer_operation_ids": (
|
||||
n7_transfer_operation_ids if n7_transfer_ready else []
|
||||
),
|
||||
"all_operations_have_native_binding": bool(operation_ids)
|
||||
and all(
|
||||
capability_id in native_capabilities for capability_id in operation_ids
|
||||
|
||||
Reference in New Issue
Block a user