Skip to content

Commit 8a513d4

Browse files
authored
Merge pull request #100 from SentienceAPI/missing_method
fix missing method
2 parents ddd2bbc + bac2dbd commit 8a513d4

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "sentienceapi"
7-
version = "0.90.19"
7+
version = "0.91.0"
88
description = "Python SDK for Sentience AI Agent Browser Automation"
99
readme = "README.md"
1010
requires-python = ">=3.11"

sentience/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
)
7171
from .wait import wait_for
7272

73-
__version__ = "0.90.19"
73+
__version__ = "0.91.0"
7474

7575
__all__ = [
7676
# Core SDK

sentience/agent.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,24 @@ def __init__(
881881
# Step counter for tracing
882882
self._step_count = 0
883883

884+
def _compute_hash(self, text: str) -> str:
885+
"""Compute SHA256 hash of text."""
886+
return hashlib.sha256(text.encode("utf-8")).hexdigest()
887+
888+
def _get_element_bbox(self, element_id: int | None, snap: Snapshot) -> dict[str, float] | None:
889+
"""Get bounding box for an element from snapshot."""
890+
if element_id is None:
891+
return None
892+
for el in snap.elements:
893+
if el.id == element_id:
894+
return {
895+
"x": el.bbox.x,
896+
"y": el.bbox.y,
897+
"width": el.bbox.width,
898+
"height": el.bbox.height,
899+
}
900+
return None
901+
884902
async def act( # noqa: C901
885903
self,
886904
goal: str,

0 commit comments

Comments
 (0)