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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "sentienceapi"
version = "0.90.19"
version = "0.91.0"
description = "Python SDK for Sentience AI Agent Browser Automation"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
2 changes: 1 addition & 1 deletion sentience/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
)
from .wait import wait_for

__version__ = "0.90.19"
__version__ = "0.91.0"

__all__ = [
# Core SDK
Expand Down
18 changes: 18 additions & 0 deletions sentience/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,24 @@ def __init__(
# Step counter for tracing
self._step_count = 0

def _compute_hash(self, text: str) -> str:
"""Compute SHA256 hash of text."""
return hashlib.sha256(text.encode("utf-8")).hexdigest()

def _get_element_bbox(self, element_id: int | None, snap: Snapshot) -> dict[str, float] | None:
"""Get bounding box for an element from snapshot."""
if element_id is None:
return None
for el in snap.elements:
if el.id == element_id:
return {
"x": el.bbox.x,
"y": el.bbox.y,
"width": el.bbox.width,
"height": el.bbox.height,
}
return None

async def act( # noqa: C901
self,
goal: str,
Expand Down