sentienceapi 0.90.12__py3-none-any.whl → 0.90.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sentienceapi might be problematic. Click here for more details.
- sentience/__init__.py +1 -1
- sentience/_extension_loader.py +40 -0
- sentience/agent.py +2 -17
- sentience/async_api.py +1160 -0
- sentience/browser.py +110 -24
- sentience/cloud_tracing.py +1 -3
- sentience/conversational_agent.py +3 -3
- sentience/extension/release.json +1 -1
- sentience/llm_provider.py +206 -0
- sentience/models.py +7 -1
- sentience/snapshot.py +18 -26
- sentience/wait.py +2 -2
- {sentienceapi-0.90.12.dist-info → sentienceapi-0.90.16.dist-info}/METADATA +60 -22
- {sentienceapi-0.90.12.dist-info → sentienceapi-0.90.16.dist-info}/RECORD +20 -16
- sentienceapi-0.90.16.dist-info/licenses/LICENSE +24 -0
- sentienceapi-0.90.16.dist-info/licenses/LICENSE-APACHE +201 -0
- sentienceapi-0.90.16.dist-info/licenses/LICENSE-MIT +21 -0
- sentienceapi-0.90.12.dist-info/licenses/LICENSE.md +0 -43
- {sentienceapi-0.90.12.dist-info → sentienceapi-0.90.16.dist-info}/WHEEL +0 -0
- {sentienceapi-0.90.12.dist-info → sentienceapi-0.90.16.dist-info}/entry_points.txt +0 -0
- {sentienceapi-0.90.12.dist-info → sentienceapi-0.90.16.dist-info}/top_level.txt +0 -0
sentience/__init__.py
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Shared extension loading logic for sync and async implementations
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def find_extension_path() -> Path:
|
|
9
|
+
"""
|
|
10
|
+
Find Sentience extension directory (shared logic for sync and async).
|
|
11
|
+
|
|
12
|
+
Checks multiple locations:
|
|
13
|
+
1. sentience/extension/ (installed package)
|
|
14
|
+
2. ../sentience-chrome (development/monorepo)
|
|
15
|
+
|
|
16
|
+
Returns:
|
|
17
|
+
Path to extension directory
|
|
18
|
+
|
|
19
|
+
Raises:
|
|
20
|
+
FileNotFoundError: If extension not found in any location
|
|
21
|
+
"""
|
|
22
|
+
# 1. Try relative to this file (installed package structure)
|
|
23
|
+
# sentience/_extension_loader.py -> sentience/extension/
|
|
24
|
+
package_ext_path = Path(__file__).parent / "extension"
|
|
25
|
+
|
|
26
|
+
# 2. Try development root (if running from source repo)
|
|
27
|
+
# sentience/_extension_loader.py -> ../sentience-chrome
|
|
28
|
+
dev_ext_path = Path(__file__).parent.parent.parent / "sentience-chrome"
|
|
29
|
+
|
|
30
|
+
if package_ext_path.exists() and (package_ext_path / "manifest.json").exists():
|
|
31
|
+
return package_ext_path
|
|
32
|
+
elif dev_ext_path.exists() and (dev_ext_path / "manifest.json").exists():
|
|
33
|
+
return dev_ext_path
|
|
34
|
+
else:
|
|
35
|
+
raise FileNotFoundError(
|
|
36
|
+
f"Extension not found. Checked:\n"
|
|
37
|
+
f"1. {package_ext_path}\n"
|
|
38
|
+
f"2. {dev_ext_path}\n"
|
|
39
|
+
"Make sure the extension is built and 'sentience/extension' directory exists."
|
|
40
|
+
)
|
sentience/agent.py
CHANGED
|
@@ -149,23 +149,8 @@ class SentienceAgent(BaseAgent):
|
|
|
149
149
|
if snap_opts.goal is None:
|
|
150
150
|
snap_opts.goal = goal
|
|
151
151
|
|
|
152
|
-
#
|
|
153
|
-
|
|
154
|
-
if isinstance(snap_opts.screenshot, ScreenshotConfig):
|
|
155
|
-
screenshot_param = {
|
|
156
|
-
"format": snap_opts.screenshot.format,
|
|
157
|
-
"quality": snap_opts.screenshot.quality,
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
# Call snapshot with converted parameters
|
|
161
|
-
snap = snapshot(
|
|
162
|
-
self.browser,
|
|
163
|
-
screenshot=screenshot_param,
|
|
164
|
-
limit=snap_opts.limit,
|
|
165
|
-
filter=snap_opts.filter.model_dump() if snap_opts.filter else None,
|
|
166
|
-
use_api=snap_opts.use_api,
|
|
167
|
-
goal=snap_opts.goal, # Pass goal to snapshot
|
|
168
|
-
)
|
|
152
|
+
# Call snapshot with options object (matches TypeScript API)
|
|
153
|
+
snap = snapshot(self.browser, snap_opts)
|
|
169
154
|
|
|
170
155
|
if snap.status != "success":
|
|
171
156
|
raise RuntimeError(f"Snapshot failed: {snap.error}")
|