Javier Montalvo commited on
Commit
70158ca
·
1 Parent(s): 41d97ca

Updated Near to be 16% width

Browse files
README.md CHANGED
@@ -77,7 +77,7 @@ rules:
77
  when:
78
  all:
79
  - present: {label: person, min_count: 1}
80
- - near: {a: person, b: steering wheel, max_gap_percent: 8}
81
  gate:
82
  enabled: true
83
  cooldown: {key: turn-on-pc, minutes: 5}
@@ -97,7 +97,7 @@ rules:
97
  - name: monitor-presence-lights
98
  when:
99
  all:
100
- - near: {a: person, b: monitor, max_gap_percent: 8}
101
  trigger:
102
  on: change
103
  gate:
 
77
  when:
78
  all:
79
  - present: {label: person, min_count: 1}
80
+ - near: {a: person, b: steering wheel, max_gap_percent: 16}
81
  gate:
82
  enabled: true
83
  cooldown: {key: turn-on-pc, minutes: 5}
 
97
  - name: monitor-presence-lights
98
  when:
99
  all:
100
+ - near: {a: person, b: monitor, max_gap_percent: 16}
101
  trigger:
102
  on: change
103
  gate:
frontend/dist/assets/{index-Cs8-YHSt.js → index-o2IMYFSK.js} RENAMED
@@ -53,7 +53,7 @@ Error generating stack: `+a.message+`
53
  when:
54
  all:
55
  - present: {label: person, min_count: 1}
56
- - near: {a: person, b: steering wheel, max_gap_percent: 8}
57
  gate:
58
  enabled: true
59
  cooldown: {key: turn-on-pc, minutes: 5}
 
53
  when:
54
  all:
55
  - present: {label: person, min_count: 1}
56
+ - near: {a: person, b: steering wheel, max_gap_percent: 16}
57
  gate:
58
  enabled: true
59
  cooldown: {key: turn-on-pc, minutes: 5}
frontend/dist/index.html CHANGED
@@ -16,7 +16,7 @@
16
  href="https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap"
17
  rel="stylesheet"
18
  />
19
- <script type="module" crossorigin src="/assets/index-Cs8-YHSt.js"></script>
20
  <link rel="stylesheet" crossorigin href="/assets/index-DpGaJEG3.css">
21
  </head>
22
  <body>
 
16
  href="https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap"
17
  rel="stylesheet"
18
  />
19
+ <script type="module" crossorigin src="/assets/index-o2IMYFSK.js"></script>
20
  <link rel="stylesheet" crossorigin href="/assets/index-DpGaJEG3.css">
21
  </head>
22
  <body>
frontend/src/lib/dashboard.tsx CHANGED
@@ -26,7 +26,7 @@ const DEFAULT_RULES = `rules:
26
  when:
27
  all:
28
  - present: {label: person, min_count: 1}
29
- - near: {a: person, b: steering wheel, max_gap_percent: 8}
30
  gate:
31
  enabled: true
32
  cooldown: {key: turn-on-pc, minutes: 5}
 
26
  when:
27
  all:
28
  - present: {label: person, min_count: 1}
29
+ - near: {a: person, b: steering wheel, max_gap_percent: 16}
30
  gate:
31
  enabled: true
32
  cooldown: {key: turn-on-pc, minutes: 5}
tests/test_llm.py CHANGED
@@ -52,7 +52,7 @@ def test_prompt_teaches_near_relations() -> None:
52
  class_names=["person", "steering wheel"],
53
  )
54
 
55
- assert '"near": {"a": "person", "b": "steering wheel", "max_gap_percent": 8}' in prompt
56
  assert "Do not replace a near relation with two present conditions." in SYSTEM_PROMPT
57
  assert "Use max_gap_percent for near/far box-edge distance." in SYSTEM_PROMPT
58
  assert "Use state gates in gate: enabled, cooldown." in SYSTEM_PROMPT
 
52
  class_names=["person", "steering wheel"],
53
  )
54
 
55
+ assert '"near": {"a": "person", "b": "steering wheel", "max_gap_percent": 16}' in prompt
56
  assert "Do not replace a near relation with two present conditions." in SYSTEM_PROMPT
57
  assert "Use max_gap_percent for near/far box-edge distance." in SYSTEM_PROMPT
58
  assert "Use state gates in gate: enabled, cooldown." in SYSTEM_PROMPT
tiny_trigger/automation.py CHANGED
@@ -39,7 +39,7 @@ class NearCondition(BaseModel):
39
  a: str
40
  b: str
41
  max_gap_percent: float = Field(
42
- default=8.0,
43
  ge=0.0,
44
  validation_alias=AliasChoices("max_gap_percent", "max_distance"),
45
  )
 
39
  a: str
40
  b: str
41
  max_gap_percent: float = Field(
42
+ default=16.0,
43
  ge=0.0,
44
  validation_alias=AliasChoices("max_gap_percent", "max_distance"),
45
  )
tiny_trigger/llm.py CHANGED
@@ -413,7 +413,7 @@ JSON:
413
  "when": {{
414
  "all": [
415
  {{"present": {{"label": "person", "min_count": 1}}}},
416
- {{"near": {{"a": "person", "b": "steering wheel", "max_gap_percent": 8}}}}
417
  ]
418
  }},
419
  "trigger": {{"on": "enter"}},
@@ -432,7 +432,7 @@ JSON:
432
  "when": {{
433
  "all": [
434
  {{"present": {{"label": "package", "min_count": 1}}}},
435
- {{"near": {{"a": "package", "b": "door", "max_gap_percent": 8}}}}
436
  ]
437
  }},
438
  "trigger": {{"on": "while"}},
@@ -468,7 +468,7 @@ JSON:
468
  "name": "monitor-presence-lights",
469
  "when": {{
470
  "all": [
471
- {{"near": {{"a": "person", "b": "monitor", "max_gap_percent": 8}}}}
472
  ]
473
  }},
474
  "trigger": {{"on": "change"}},
 
413
  "when": {{
414
  "all": [
415
  {{"present": {{"label": "person", "min_count": 1}}}},
416
+ {{"near": {{"a": "person", "b": "steering wheel", "max_gap_percent": 16}}}}
417
  ]
418
  }},
419
  "trigger": {{"on": "enter"}},
 
432
  "when": {{
433
  "all": [
434
  {{"present": {{"label": "package", "min_count": 1}}}},
435
+ {{"near": {{"a": "package", "b": "door", "max_gap_percent": 16}}}}
436
  ]
437
  }},
438
  "trigger": {{"on": "while"}},
 
468
  "name": "monitor-presence-lights",
469
  "when": {{
470
  "all": [
471
+ {{"near": {{"a": "person", "b": "monitor", "max_gap_percent": 16}}}}
472
  ]
473
  }},
474
  "trigger": {{"on": "change"}},