narada 0.1.29__tar.gz → 0.1.31__tar.gz
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.
- {narada-0.1.29 → narada-0.1.31}/PKG-INFO +2 -2
- {narada-0.1.29 → narada-0.1.31}/pyproject.toml +2 -2
- {narada-0.1.29 → narada-0.1.31}/src/narada/window.py +48 -0
- {narada-0.1.29 → narada-0.1.31}/.gitignore +0 -0
- {narada-0.1.29 → narada-0.1.31}/README.md +0 -0
- {narada-0.1.29 → narada-0.1.31}/src/narada/__init__.py +0 -0
- {narada-0.1.29 → narada-0.1.31}/src/narada/client.py +0 -0
- {narada-0.1.29 → narada-0.1.31}/src/narada/config.py +0 -0
- {narada-0.1.29 → narada-0.1.31}/src/narada/py.typed +0 -0
- {narada-0.1.29 → narada-0.1.31}/src/narada/utils.py +0 -0
- {narada-0.1.29 → narada-0.1.31}/src/narada/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: narada
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.31
|
|
4
4
|
Summary: Python client SDK for Narada
|
|
5
5
|
Project-URL: Homepage, https://github.com/NaradaAI/narada-python-sdk/narada
|
|
6
6
|
Project-URL: Repository, https://github.com/NaradaAI/narada-python-sdk
|
|
@@ -9,7 +9,7 @@ Author-email: Narada <support@narada.ai>
|
|
|
9
9
|
License-Expression: Apache-2.0
|
|
10
10
|
Requires-Python: >=3.12
|
|
11
11
|
Requires-Dist: aiohttp>=3.12.13
|
|
12
|
-
Requires-Dist: narada-core==0.0.
|
|
12
|
+
Requires-Dist: narada-core==0.0.9
|
|
13
13
|
Requires-Dist: playwright>=1.53.0
|
|
14
14
|
Requires-Dist: rich>=14.0.0
|
|
15
15
|
Requires-Dist: semver>=3.0.4
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "narada"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.31"
|
|
4
4
|
description = "Python client SDK for Narada"
|
|
5
5
|
license = "Apache-2.0"
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
authors = [{ name = "Narada", email = "support@narada.ai" }]
|
|
8
8
|
requires-python = ">=3.12"
|
|
9
9
|
dependencies = [
|
|
10
|
-
"narada-core==0.0.
|
|
10
|
+
"narada-core==0.0.9",
|
|
11
11
|
"aiohttp>=3.12.13",
|
|
12
12
|
"playwright>=1.53.0",
|
|
13
13
|
"rich>=14.0.0",
|
|
@@ -8,6 +8,7 @@ from typing import IO, Any, Optional, TypeVar, overload
|
|
|
8
8
|
|
|
9
9
|
import aiohttp
|
|
10
10
|
from narada_core.actions.models import (
|
|
11
|
+
ActionTraceItem,
|
|
11
12
|
AgenticSelectorAction,
|
|
12
13
|
AgenticSelectorRequest,
|
|
13
14
|
AgenticSelectorResponse,
|
|
@@ -25,6 +26,12 @@ from narada_core.actions.models import (
|
|
|
25
26
|
ReadGoogleSheetResponse,
|
|
26
27
|
WriteGoogleSheetRequest,
|
|
27
28
|
RecordedClick,
|
|
29
|
+
GetFullHtmlRequest,
|
|
30
|
+
GetFullHtmlResponse,
|
|
31
|
+
GetSimplifiedHtmlRequest,
|
|
32
|
+
GetSimplifiedHtmlResponse,
|
|
33
|
+
GetScreenshotRequest,
|
|
34
|
+
GetScreenshotResponse,
|
|
28
35
|
)
|
|
29
36
|
from narada_core.errors import (
|
|
30
37
|
NaradaAgentTimeoutError_INTERNAL_DO_NOT_USE,
|
|
@@ -125,6 +132,7 @@ class BaseBrowserWindow(ABC):
|
|
|
125
132
|
variables: dict[str, str] | None = None,
|
|
126
133
|
callback_url: str | None = None,
|
|
127
134
|
callback_secret: str | None = None,
|
|
135
|
+
callback_headers: dict[str, Any] | None = None,
|
|
128
136
|
timeout: int = 1000,
|
|
129
137
|
) -> Response[None]: ...
|
|
130
138
|
|
|
@@ -146,6 +154,7 @@ class BaseBrowserWindow(ABC):
|
|
|
146
154
|
variables: dict[str, str] | None = None,
|
|
147
155
|
callback_url: str | None = None,
|
|
148
156
|
callback_secret: str | None = None,
|
|
157
|
+
callback_headers: dict[str, Any] | None = None,
|
|
149
158
|
timeout: int = 1000,
|
|
150
159
|
) -> Response[_StructuredOutput]: ...
|
|
151
160
|
|
|
@@ -166,6 +175,7 @@ class BaseBrowserWindow(ABC):
|
|
|
166
175
|
variables: dict[str, str] | None = None,
|
|
167
176
|
callback_url: str | None = None,
|
|
168
177
|
callback_secret: str | None = None,
|
|
178
|
+
callback_headers: dict[str, Any] | None = None,
|
|
169
179
|
timeout: int = 1000,
|
|
170
180
|
) -> Response:
|
|
171
181
|
"""Low-level API for invoking an agent in the Narada extension side panel chat.
|
|
@@ -209,6 +219,8 @@ class BaseBrowserWindow(ABC):
|
|
|
209
219
|
body["callbackUrl"] = callback_url
|
|
210
220
|
if callback_secret is not None:
|
|
211
221
|
body["callbackSecret"] = callback_secret
|
|
222
|
+
if callback_headers is not None:
|
|
223
|
+
body["callbackHeaders"] = callback_headers
|
|
212
224
|
|
|
213
225
|
try:
|
|
214
226
|
async with aiohttp.ClientSession() as session:
|
|
@@ -313,12 +325,20 @@ class BaseBrowserWindow(ABC):
|
|
|
313
325
|
response_content = remote_dispatch_response["response"]
|
|
314
326
|
assert response_content is not None
|
|
315
327
|
|
|
328
|
+
action_trace_raw = response_content.get("actionTrace")
|
|
329
|
+
action_trace = (
|
|
330
|
+
[ActionTraceItem.model_validate(item) for item in action_trace_raw]
|
|
331
|
+
if action_trace_raw is not None
|
|
332
|
+
else None
|
|
333
|
+
)
|
|
334
|
+
|
|
316
335
|
return AgentResponse(
|
|
317
336
|
request_id=remote_dispatch_response["requestId"],
|
|
318
337
|
status=remote_dispatch_response["status"],
|
|
319
338
|
text=response_content["text"],
|
|
320
339
|
structured_output=response_content.get("structuredOutput"),
|
|
321
340
|
usage=AgentUsage.model_validate(remote_dispatch_response["usage"]),
|
|
341
|
+
action_trace=action_trace,
|
|
322
342
|
)
|
|
323
343
|
|
|
324
344
|
async def agentic_selector(
|
|
@@ -423,6 +443,34 @@ class BaseBrowserWindow(ABC):
|
|
|
423
443
|
timeout=timeout,
|
|
424
444
|
)
|
|
425
445
|
|
|
446
|
+
async def get_full_html(self, *, timeout: int | None = None) -> GetFullHtmlResponse:
|
|
447
|
+
"""Gets the full HTML content of the current page."""
|
|
448
|
+
return await self._run_extension_action(
|
|
449
|
+
GetFullHtmlRequest(),
|
|
450
|
+
GetFullHtmlResponse,
|
|
451
|
+
timeout=timeout,
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
async def get_simplified_html(
|
|
455
|
+
self, *, timeout: int | None = None
|
|
456
|
+
) -> GetSimplifiedHtmlResponse:
|
|
457
|
+
"""Gets the simplified HTML content of the current page."""
|
|
458
|
+
return await self._run_extension_action(
|
|
459
|
+
GetSimplifiedHtmlRequest(),
|
|
460
|
+
GetSimplifiedHtmlResponse,
|
|
461
|
+
timeout=timeout,
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
async def get_screenshot(
|
|
465
|
+
self, *, timeout: int | None = None
|
|
466
|
+
) -> GetScreenshotResponse:
|
|
467
|
+
"""Takes a screenshot of the current browser window."""
|
|
468
|
+
return await self._run_extension_action(
|
|
469
|
+
GetScreenshotRequest(),
|
|
470
|
+
GetScreenshotResponse,
|
|
471
|
+
timeout=timeout,
|
|
472
|
+
)
|
|
473
|
+
|
|
426
474
|
@overload
|
|
427
475
|
async def _run_extension_action(
|
|
428
476
|
self,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|