Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sentience/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ def act( # noqa: C901
)
else:
snap_opts.screenshot = False
# Apply show_overlay from AgentConfig
snap_opts.show_overlay = self.config.show_overlay

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

# Call snapshot with options object (matches TypeScript API)
snap = await snapshot_async(self.browser, snap_opts)
Expand Down
3 changes: 3 additions & 0 deletions sentience/agent_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ class AgentConfig:
capture_screenshots: bool = True
screenshot_format: str = "jpeg" # "png" or "jpeg"
screenshot_quality: int = 80 # 1-100 (for JPEG only)

# Visual overlay options
show_overlay: bool = False # Show green bbox overlay in browser