feat: improve mode and peripheral orchestration
This commit is contained in:
@@ -724,6 +724,50 @@ class Can1SemanticWhitelistTests(unittest.TestCase):
|
||||
self.assertEqual(preview["unresolved_clauses"], [])
|
||||
self.assertEqual(self._debug_commands(preview), [])
|
||||
|
||||
def test_driver_ventilation_numeric_gear_followup_uses_occupant_scale(self) -> None:
|
||||
cases = (
|
||||
(
|
||||
"打开主驾座椅通风,挡位调到3档",
|
||||
"seat driver vent high",
|
||||
1,
|
||||
),
|
||||
(
|
||||
"打开主驾座椅通风,挡位调到1档",
|
||||
"seat driver vent low",
|
||||
2,
|
||||
),
|
||||
)
|
||||
for index, (utterance, command, internal_level) in enumerate(cases):
|
||||
with self.subTest(utterance=utterance):
|
||||
result = self.service.process(
|
||||
utterance,
|
||||
provider="local",
|
||||
conversation_id=f"conv-driver-vent-gear-{index}",
|
||||
execution_mode="dry_run",
|
||||
)
|
||||
self.assertEqual(result["status"], "succeeded")
|
||||
self.assertEqual(self._debug_commands(result), [command])
|
||||
operation = result["function_configs"]["native_seat"]["spec"][
|
||||
"operations"
|
||||
][0]
|
||||
self.assertEqual(operation["parameters"]["level"], internal_level)
|
||||
|
||||
middle = self.service.process(
|
||||
"打开主驾座椅通风,挡位调到2档",
|
||||
provider="local",
|
||||
conversation_id="conv-driver-vent-gear-middle",
|
||||
execution_mode="dry_run",
|
||||
)
|
||||
self.assertEqual(middle["status"], "needs_confirmation")
|
||||
self.assertEqual(self._debug_commands(middle), [])
|
||||
self.assertIn(
|
||||
"driver_seat_thermal_middle_level_unsupported",
|
||||
{
|
||||
item.get("reason")
|
||||
for item in middle["intent_ir"]["spec"]["ambiguities"]
|
||||
},
|
||||
)
|
||||
|
||||
def test_vehicle_position_aliases_stay_scoped_to_the_device_domain(self) -> None:
|
||||
cases = (
|
||||
("打开左前车窗", ["window front-left open"]),
|
||||
|
||||
Reference in New Issue
Block a user