Skip to content

Commit b8737e6

Browse files
author
SentienceDEV
committed
fix tests
1 parent 5413107 commit b8737e6

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# Sentience Python SDK
1+
# Predicate Python SDK
22

33
> **A verification & control layer for AI agents that operate browsers**
44
5-
Sentience is built for **AI agent developers** who already use Playwright / CDP / browser-use / LangGraph and care about **flakiness, cost, determinism, evals, and debugging**.
5+
Predicate is built for **AI agent developers** who already use Playwright / CDP / browser-use / LangGraph and care about **flakiness, cost, determinism, evals, and debugging**.
66

77
Often described as *Jest for Browser AI Agents* - but applied to end-to-end agent runs (not unit tests).
88

99
The core loop is:
1010

1111
> **Agent → Snapshot → Action → Verification → Artifact**
1212
13-
## What Sentience is
13+
## What Predicate is
1414

1515
- A **verification-first runtime** (`AgentRuntime`) for browser agents
1616
- Treats the browser as an adapter (Playwright / CDP / browser-use); **`AgentRuntime` is the product**
@@ -19,7 +19,7 @@ The core loop is:
1919
- Enables **local LLM small models (3B-7B)** for browser automation (privacy, compliance, and cost control)
2020
- Keeps vision models **optional** (use as a fallback when DOM/snapshot structure falls short, e.g. `<canvas>`)
2121

22-
## What Sentience is not
22+
## What Predicate is not
2323

2424
- Not a browser driver
2525
- Not a Playwright replacement
@@ -34,7 +34,7 @@ playwright install chromium
3434

3535
## Conceptual example (why this exists)
3636

37-
In Sentience, agents don’t “hope” an action worked.
37+
In Predicate, agents don’t “hope” an action worked.
3838

3939
- **Every step is gated by verifiable UI assertions**
4040
- If progress can’t be proven, the run **fails with evidence** (trace + artifacts)
@@ -80,9 +80,9 @@ if __name__ == "__main__":
8080

8181
## SentienceDebugger: attach to your existing agent framework (sidecar mode)
8282

83-
If you already have an agent loop (LangGraph, browser-use, custom planner/executor), you can keep it and attach Sentience as a **verifier + trace layer**.
83+
If you already have an agent loop (LangGraph, browser-use, custom planner/executor), you can keep it and attach Predicate as a **verifier + trace layer**.
8484

85-
Key idea: your agent still decides and executes actions — Sentience **snapshots and verifies outcomes**.
85+
Key idea: your agent still decides and executes actions — Predicate **snapshots and verifies outcomes**.
8686

8787
```python
8888
from predicate import SentienceDebugger, create_tracer
@@ -108,7 +108,7 @@ async def run_existing_agent(page) -> None:
108108

109109
## SDK-driven full loop (snapshots + actions)
110110

111-
If you want Sentience to drive the loop end-to-end, you can use the SDK primitives directly: take a snapshot, select elements, act, then verify.
111+
If you want Predicate to drive the loop end-to-end, you can use the SDK primitives directly: take a snapshot, select elements, act, then verify.
112112

113113
```python
114114
from predicate import SentienceBrowser, snapshot, find, click, type_text, wait_for
@@ -168,7 +168,7 @@ def login_example() -> None:
168168

169169
## ToolRegistry (LLM-callable tools)
170170

171-
Sentience can expose a **typed tool surface** for agents (with tool-call tracing).
171+
Predicate can expose a **typed tool surface** for agents (with tool-call tracing).
172172

173173
```python
174174
from predicate.tools import ToolRegistry, register_default_tools
@@ -215,16 +215,16 @@ runtime.assert_(download_completed("report.csv"), label="download_ok", required=
215215
- **Manual driver CLI** (inspect clickables, click/type/press quickly):
216216

217217
```bash
218-
sentience driver --url https://example.com
218+
predicate driver --url https://example.com
219219
```
220220

221-
- **Verification + artifacts + debugging with time-travel traces (Sentience Studio demo)**:
221+
- **Verification + artifacts + debugging with time-travel traces (Predicate Studio demo)**:
222222

223223
<video src="https://github.com/user-attachments/assets/7ffde43b-1074-4d70-bb83-2eb8d0469307" controls muted playsinline></video>
224224

225225
If the video tag doesn’t render in your GitHub README view, use this link: [`sentience-studio-demo.mp4`](https://github.com/user-attachments/assets/7ffde43b-1074-4d70-bb83-2eb8d0469307)
226226

227-
- **Sentience SDK Documentation**: https://www.sentienceapi.com/docs
227+
- **Predicate SDK Documentation**: https://predicatelabs.dev/docs
228228

229229
## Integrations (examples)
230230

predicate/actions.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,12 @@ def search(
830830
url_before = browser.page.url
831831
url = _build_search_url(query, engine)
832832
browser.goto(url)
833-
browser.page.wait_for_load_state("networkidle")
833+
# Some public search engines keep long-lived connections open. Treat network-idle
834+
# as best-effort so search() remains reliable in CI and constrained networks.
835+
try:
836+
browser.page.wait_for_load_state("networkidle", timeout=5000)
837+
except Exception:
838+
pass
834839

835840
duration_ms = int((time.time() - start_time) * 1000)
836841
url_after = browser.page.url
@@ -1068,6 +1073,7 @@ def click_rect(
10681073
center_x = x + w / 2
10691074
center_y = y + h / 2
10701075
cursor_meta: dict | None = None
1076+
error_msg = ""
10711077

10721078
# Show highlight before clicking (if enabled)
10731079
if highlight:
@@ -1906,7 +1912,12 @@ async def search_async(
19061912
url_before = browser.page.url
19071913
url = _build_search_url(query, engine)
19081914
await browser.goto(url)
1909-
await browser.page.wait_for_load_state("networkidle")
1915+
# Some public search engines keep long-lived connections open. Treat network-idle
1916+
# as best-effort so search_async() remains reliable in CI and constrained networks.
1917+
try:
1918+
await browser.page.wait_for_load_state("networkidle", timeout=5000)
1919+
except Exception:
1920+
pass
19101921

19111922
duration_ms = int((time.time() - start_time) * 1000)
19121923
url_after = browser.page.url
@@ -2123,6 +2134,7 @@ async def click_rect_async(
21232134
center_x = x + w / 2
21242135
center_y = y + h / 2
21252136
cursor_meta: dict | None = None
2137+
error_msg = ""
21262138

21272139
# Show highlight before clicking
21282140
if highlight:

0 commit comments

Comments
 (0)