feat: add seat-scoped static and dynamic assistant modes

This commit is contained in:
vee
2026-09-12 14:56:30 +08:00
parent d09b5967f8
commit d8dad22ec0
60 changed files with 5847 additions and 149 deletions
+10 -7
View File
@@ -8,7 +8,6 @@ from collections.abc import Mapping
from copy import deepcopy
from typing import Any
CLAUSE_SEPARATOR = re.compile(r"[,,;;。!?!?\n]+")
NEGATED_OPERATION = re.compile(
r"(?:不要|别|不想|无需|不必|禁止)"
@@ -414,13 +413,17 @@ def apply_language_safety_guards(
]
result["confidence"] = min(float(result.get("confidence", 0)), 0.8)
explicit_seat_scopes = (
resolve_scene_seat_scopes(
if scene_composition:
# Reuse exactly the selection already applied to the model schema and
# trusted seed. A second, older scope parser must not reject aliases
# such as 前排两座 or widen 副驾驶席 to both seats after validation.
from cognitive_agent.application.mode_creation_seat_policy import creation_seat_scopes
explicit_seat_scopes = (None if scene_scope_utterance == "" else creation_seat_scopes(
utterance if scene_scope_utterance is None else scene_scope_utterance
)
if scene_composition
else resolve_explicit_seat_scopes(utterance)
)
))
else:
explicit_seat_scopes = resolve_explicit_seat_scopes(utterance)
if scene_composition and not any(
isinstance(item, dict)
and (