From bac2dbd1a79ba7727237014168f6022857f7df6e Mon Sep 17 00:00:00 2001 From: rcholic Date: Thu, 1 Jan 2026 22:33:38 -0800 Subject: [PATCH] fix missing method --- pyproject.toml | 2 +- sentience/__init__.py | 2 +- sentience/agent.py | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 49c6de8..e8a14f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/sentience/__init__.py b/sentience/__init__.py index 506607d..ab5e062 100644 --- a/sentience/__init__.py +++ b/sentience/__init__.py @@ -70,7 +70,7 @@ ) from .wait import wait_for -__version__ = "0.90.19" +__version__ = "0.91.0" __all__ = [ # Core SDK diff --git a/sentience/agent.py b/sentience/agent.py index 15ec940..b507514 100644 --- a/sentience/agent.py +++ b/sentience/agent.py @@ -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,