Skip to content

Commit d663697

Browse files
authored
Merge pull request #96 from SentienceAPI/overlay
overlay
2 parents 990fb26 + bebb67c commit d663697

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

sentience/agent.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ def act( # noqa: C901
165165
)
166166
else:
167167
snap_opts.screenshot = False
168+
# Apply show_overlay from AgentConfig
169+
snap_opts.show_overlay = self.config.show_overlay
168170

169171
# Call snapshot with options object (matches TypeScript API)
170172
snap = snapshot(self.browser, snap_opts)
@@ -845,6 +847,9 @@ async def act( # noqa: C901
845847
)
846848
else:
847849
snap_opts.screenshot = False
850+
# Apply show_overlay from AgentConfig
851+
# Note: User can override by explicitly passing show_overlay in snapshot_options
852+
snap_opts.show_overlay = self.config.show_overlay
848853

849854
# Call snapshot with options object (matches TypeScript API)
850855
snap = await snapshot_async(self.browser, snap_opts)

sentience/agent_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ class AgentConfig:
4141
capture_screenshots: bool = True
4242
screenshot_format: str = "jpeg" # "png" or "jpeg"
4343
screenshot_quality: int = 80 # 1-100 (for JPEG only)
44+
45+
# Visual overlay options
46+
show_overlay: bool = False # Show green bbox overlay in browser

0 commit comments

Comments
 (0)