Skip to content

Commit c11d9e8

Browse files
authored
Merge pull request #150 from SentienceAPI/humanize_local_vision
local vision llm provider
2 parents e0a8d45 + af5729b commit c11d9e8

File tree

6 files changed

+484
-12
lines changed

6 files changed

+484
-12
lines changed

examples/human_cursor_click_demo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@ def main() -> None:
3838

3939
if __name__ == "__main__":
4040
main()
41-

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ sentience = "sentience.cli:main"
4343
browser-use = [
4444
"browser-use>=0.1.40",
4545
]
46+
vision-local = [
47+
"pillow>=10.0.0",
48+
"torch>=2.2.0",
49+
"transformers>=4.46.0",
50+
]
51+
mlx-vlm = [
52+
"pillow>=10.0.0",
53+
"mlx-vlm>=0.1.0",
54+
]
4655
dev = [
4756
"pytest>=7.0.0",
4857
"pytest-asyncio>=0.21.0",

sentience/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
LLMProvider,
5353
LLMResponse,
5454
LocalLLMProvider,
55+
LocalVisionLLMProvider,
56+
MLXVLMProvider,
5557
OpenAIProvider,
5658
)
5759
from .models import ( # Agent Layer Models
@@ -202,6 +204,8 @@
202204
"OpenAIProvider",
203205
"AnthropicProvider",
204206
"LocalLLMProvider",
207+
"LocalVisionLLMProvider",
208+
"MLXVLMProvider",
205209
"SentienceAgent",
206210
"SentienceAgentAsync",
207211
"SentienceVisualAgent",

sentience/cursor_policy.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ def _ease_in_out(t: float) -> float:
4444
return t * t * (3 - 2 * t)
4545

4646

47-
def _bezier(p0: tuple[float, float], p1: tuple[float, float], p2: tuple[float, float], p3: tuple[float, float], t: float) -> tuple[float, float]:
47+
def _bezier(
48+
p0: tuple[float, float],
49+
p1: tuple[float, float],
50+
p2: tuple[float, float],
51+
p3: tuple[float, float],
52+
t: float,
53+
) -> tuple[float, float]:
4854
u = 1.0 - t
4955
tt = t * t
5056
uu = u * u
@@ -87,7 +93,9 @@ def build_human_cursor_path(
8793

8894
# Defaults based on distance (bounded)
8995
steps = int(policy.steps if policy.steps is not None else _clamp(10 + dist / 25.0, 12, 40))
90-
duration_ms = int(policy.duration_ms if policy.duration_ms is not None else _clamp(120 + dist * 0.9, 120, 700))
96+
duration_ms = int(
97+
policy.duration_ms if policy.duration_ms is not None else _clamp(120 + dist * 0.9, 120, 700)
98+
)
9199

92100
# Control points: offset roughly perpendicular to travel direction
93101
if dist < 1e-6:
@@ -132,4 +140,3 @@ def build_human_cursor_path(
132140
# Keep path bounded for trace size
133141
"path": pts[:64],
134142
}
135-

0 commit comments

Comments
 (0)