anchorbrowser 0.5.1__py3-none-any.whl → 0.5.2__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.
- anchorbrowser/_version.py +1 -1
- anchorbrowser/lib/agent.py +4 -1
- anchorbrowser/resources/agent.py +12 -4
- anchorbrowser/resources/tools.py +8 -0
- {anchorbrowser-0.5.1.dist-info → anchorbrowser-0.5.2.dist-info}/METADATA +1 -1
- {anchorbrowser-0.5.1.dist-info → anchorbrowser-0.5.2.dist-info}/RECORD +8 -8
- {anchorbrowser-0.5.1.dist-info → anchorbrowser-0.5.2.dist-info}/WHEEL +0 -0
- {anchorbrowser-0.5.1.dist-info → anchorbrowser-0.5.2.dist-info}/licenses/LICENSE +0 -0
anchorbrowser/_version.py
CHANGED
anchorbrowser/lib/agent.py
CHANGED
|
@@ -20,6 +20,7 @@ class AgentTaskParams(TypedDict, total=False):
|
|
|
20
20
|
human_intervention: Optional[bool]
|
|
21
21
|
max_steps: Optional[int]
|
|
22
22
|
secret_values: Optional[Dict[str, Any]]
|
|
23
|
+
directly_open_url: Optional[bool]
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
def create_task_payload(
|
|
@@ -34,6 +35,7 @@ def create_task_payload(
|
|
|
34
35
|
human_intervention: Optional[bool] = None,
|
|
35
36
|
max_steps: Optional[int] = None,
|
|
36
37
|
secret_values: Optional[Dict[str, Any]] = None,
|
|
38
|
+
directly_open_url: Optional[bool] = None,
|
|
37
39
|
) -> str:
|
|
38
40
|
if not prompt or prompt.strip() == "":
|
|
39
41
|
raise ValueError("Prompt cannot be empty")
|
|
@@ -61,7 +63,8 @@ def create_task_payload(
|
|
|
61
63
|
payload["max_steps"] = max_steps
|
|
62
64
|
if secret_values is not None:
|
|
63
65
|
payload["secret_values"] = secret_values
|
|
64
|
-
|
|
66
|
+
if directly_open_url is not None:
|
|
67
|
+
payload["directly_open_url"] = directly_open_url
|
|
65
68
|
return json.dumps(payload)
|
|
66
69
|
|
|
67
70
|
|
anchorbrowser/resources/agent.py
CHANGED
|
@@ -90,6 +90,7 @@ class AgentResource(SyncAPIResource):
|
|
|
90
90
|
human_intervention = None
|
|
91
91
|
max_steps = None
|
|
92
92
|
secret_values = None
|
|
93
|
+
directly_open_url = None
|
|
93
94
|
if task_options:
|
|
94
95
|
output_schema = task_options.get("output_schema")
|
|
95
96
|
url = task_options.get("url")
|
|
@@ -102,7 +103,7 @@ class AgentResource(SyncAPIResource):
|
|
|
102
103
|
human_intervention = task_options.get("human_intervention")
|
|
103
104
|
max_steps = task_options.get("max_steps")
|
|
104
105
|
secret_values = task_options.get("secret_values")
|
|
105
|
-
|
|
106
|
+
directly_open_url = task_options.get("directly_open_url")
|
|
106
107
|
if url:
|
|
107
108
|
browser_setup.page.goto(url)
|
|
108
109
|
on_agent_step = task_options.get("on_agent_step")
|
|
@@ -120,6 +121,7 @@ class AgentResource(SyncAPIResource):
|
|
|
120
121
|
human_intervention=human_intervention,
|
|
121
122
|
max_steps=max_steps,
|
|
122
123
|
secret_values=secret_values,
|
|
124
|
+
directly_open_url=directly_open_url,
|
|
123
125
|
)
|
|
124
126
|
task_result = str(browser_setup.ai.evaluate(task_payload))
|
|
125
127
|
return task_result
|
|
@@ -171,6 +173,7 @@ class AgentResource(SyncAPIResource):
|
|
|
171
173
|
human_intervention = None
|
|
172
174
|
max_steps = None
|
|
173
175
|
secret_values = None
|
|
176
|
+
directly_open_url = None
|
|
174
177
|
if task_options:
|
|
175
178
|
output_schema = task_options.get("output_schema")
|
|
176
179
|
url = task_options.get("url")
|
|
@@ -183,7 +186,7 @@ class AgentResource(SyncAPIResource):
|
|
|
183
186
|
human_intervention = task_options.get("human_intervention")
|
|
184
187
|
max_steps = task_options.get("max_steps")
|
|
185
188
|
secret_values = task_options.get("secret_values")
|
|
186
|
-
|
|
189
|
+
directly_open_url = task_options.get("directly_open_url")
|
|
187
190
|
if url:
|
|
188
191
|
browser_setup.page.goto(url)
|
|
189
192
|
on_agent_step = task_options.get("on_agent_step")
|
|
@@ -201,6 +204,7 @@ class AgentResource(SyncAPIResource):
|
|
|
201
204
|
human_intervention=human_intervention,
|
|
202
205
|
max_steps=max_steps,
|
|
203
206
|
secret_values=secret_values,
|
|
207
|
+
directly_open_url=directly_open_url,
|
|
204
208
|
)
|
|
205
209
|
task_result = str(browser_setup.ai.evaluate(task_payload))
|
|
206
210
|
return BrowserTaskResponse(
|
|
@@ -281,6 +285,7 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
281
285
|
human_intervention = None
|
|
282
286
|
max_steps = None
|
|
283
287
|
secret_values = None
|
|
288
|
+
directly_open_url = None
|
|
284
289
|
if task_options:
|
|
285
290
|
output_schema = task_options.get("output_schema")
|
|
286
291
|
url = task_options.get("url")
|
|
@@ -293,7 +298,7 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
293
298
|
human_intervention = task_options.get("human_intervention")
|
|
294
299
|
max_steps = task_options.get("max_steps")
|
|
295
300
|
secret_values = task_options.get("secret_values")
|
|
296
|
-
|
|
301
|
+
directly_open_url = task_options.get("directly_open_url")
|
|
297
302
|
if url:
|
|
298
303
|
await (await browser_setup.async_page).goto(url)
|
|
299
304
|
on_agent_step = task_options.get("on_agent_step")
|
|
@@ -311,6 +316,7 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
311
316
|
human_intervention=human_intervention,
|
|
312
317
|
max_steps=max_steps,
|
|
313
318
|
secret_values=secret_values,
|
|
319
|
+
directly_open_url=directly_open_url,
|
|
314
320
|
)
|
|
315
321
|
task_result = await (await browser_setup.async_ai).evaluate(task_payload)
|
|
316
322
|
return str(task_result)
|
|
@@ -362,6 +368,7 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
362
368
|
human_intervention = None
|
|
363
369
|
max_steps = None
|
|
364
370
|
secret_values = None
|
|
371
|
+
directly_open_url = None
|
|
365
372
|
if task_options:
|
|
366
373
|
output_schema = task_options.get("output_schema")
|
|
367
374
|
url = task_options.get("url")
|
|
@@ -374,7 +381,7 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
374
381
|
human_intervention = task_options.get("human_intervention")
|
|
375
382
|
max_steps = task_options.get("max_steps")
|
|
376
383
|
secret_values = task_options.get("secret_values")
|
|
377
|
-
|
|
384
|
+
directly_open_url = task_options.get("directly_open_url")
|
|
378
385
|
if url:
|
|
379
386
|
await (await browser_setup.async_page).goto(url)
|
|
380
387
|
on_agent_step = task_options.get("on_agent_step")
|
|
@@ -392,6 +399,7 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
392
399
|
human_intervention=human_intervention,
|
|
393
400
|
max_steps=max_steps,
|
|
394
401
|
secret_values=secret_values,
|
|
402
|
+
directly_open_url=directly_open_url,
|
|
395
403
|
)
|
|
396
404
|
task_result = await (await browser_setup.async_ai).evaluate(task_payload)
|
|
397
405
|
return BrowserTaskResponse(
|
anchorbrowser/resources/tools.py
CHANGED
|
@@ -138,6 +138,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
138
138
|
provider: Literal["openai", "gemini", "groq", "azure", "xai"] | Omit = omit,
|
|
139
139
|
secret_values: Dict[str, str] | Omit = omit,
|
|
140
140
|
url: str | Omit = omit,
|
|
141
|
+
directly_open_url: bool | Omit = omit,
|
|
141
142
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
142
143
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
143
144
|
extra_headers: Headers | None = None,
|
|
@@ -182,6 +183,8 @@ class ToolsResource(SyncAPIResource):
|
|
|
182
183
|
url: The URL of the webpage. If not provided, the tool will use the current page in
|
|
183
184
|
the session.
|
|
184
185
|
|
|
186
|
+
directly_open_url: If true, the tool will directly open the URL in the browser.
|
|
187
|
+
|
|
185
188
|
extra_headers: Send extra headers
|
|
186
189
|
|
|
187
190
|
extra_query: Add additional query parameters to the request
|
|
@@ -205,6 +208,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
205
208
|
"provider": provider,
|
|
206
209
|
"secret_values": secret_values,
|
|
207
210
|
"url": url,
|
|
211
|
+
"directly_open_url": directly_open_url,
|
|
208
212
|
},
|
|
209
213
|
tool_perform_web_task_params.ToolPerformWebTaskParams,
|
|
210
214
|
),
|
|
@@ -411,6 +415,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
411
415
|
provider: Literal["openai", "gemini", "groq", "azure", "xai"] | Omit = omit,
|
|
412
416
|
secret_values: Dict[str, str] | Omit = omit,
|
|
413
417
|
url: str | Omit = omit,
|
|
418
|
+
directly_open_url: bool | Omit = omit,
|
|
414
419
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
415
420
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
416
421
|
extra_headers: Headers | None = None,
|
|
@@ -455,6 +460,8 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
455
460
|
url: The URL of the webpage. If not provided, the tool will use the current page in
|
|
456
461
|
the session.
|
|
457
462
|
|
|
463
|
+
directly_open_url: If true, the tool will directly open the URL in the browser.
|
|
464
|
+
|
|
458
465
|
extra_headers: Send extra headers
|
|
459
466
|
|
|
460
467
|
extra_query: Add additional query parameters to the request
|
|
@@ -478,6 +485,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
478
485
|
"provider": provider,
|
|
479
486
|
"secret_values": secret_values,
|
|
480
487
|
"url": url,
|
|
488
|
+
"directly_open_url": directly_open_url,
|
|
481
489
|
},
|
|
482
490
|
tool_perform_web_task_params.ToolPerformWebTaskParams,
|
|
483
491
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: anchorbrowser
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: The official Python library for the anchorbrowser API
|
|
5
5
|
Project-URL: Homepage, https://github.com/anchorbrowser/AnchorBrowser-SDK-Python
|
|
6
6
|
Project-URL: Repository, https://github.com/anchorbrowser/AnchorBrowser-SDK-Python
|
|
@@ -11,7 +11,7 @@ anchorbrowser/_resource.py,sha256=7lE1EgpVj5kwckk-27umtigTOf9nKTyRl97cgNwRbRQ,11
|
|
|
11
11
|
anchorbrowser/_response.py,sha256=xsiyWOC8LWW-NvbFtZ-MJD4f7eI9RnivKwtKImZ-8o4,28860
|
|
12
12
|
anchorbrowser/_streaming.py,sha256=ey2jst1hntYHV6HDiCFfHhWr_dUCSG4dG-VUqQkmCQ4,10249
|
|
13
13
|
anchorbrowser/_types.py,sha256=nAsmJDL_VDIWprgQ9LdTLnW1NtUssCOAD8OKIqeaHQ8,7302
|
|
14
|
-
anchorbrowser/_version.py,sha256=
|
|
14
|
+
anchorbrowser/_version.py,sha256=O615Ge6OxQIaGJzie9qLIe_TsCdT0Ha5nApPVL-_uc8,165
|
|
15
15
|
anchorbrowser/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
anchorbrowser/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
|
|
17
17
|
anchorbrowser/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
|
|
@@ -26,17 +26,17 @@ anchorbrowser/_utils/_transform.py,sha256=NjCzmnfqYrsAikUHQig6N9QfuTVbKipuP3ur9m
|
|
|
26
26
|
anchorbrowser/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,4786
|
|
27
27
|
anchorbrowser/_utils/_utils.py,sha256=ugfUaneOK7I8h9b3656flwf5u_kthY0gvNuqvgOLoSU,12252
|
|
28
28
|
anchorbrowser/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
|
29
|
-
anchorbrowser/lib/agent.py,sha256=
|
|
29
|
+
anchorbrowser/lib/agent.py,sha256=8Se6hKIbGQIbhON4BpDzA8HhFbubDgbry4MN-WeT8Xg,3711
|
|
30
30
|
anchorbrowser/lib/browser.py,sha256=Bq1HBeoxErULdMG8DajDglp3dUP68XMiW94C8YDCleE,6387
|
|
31
31
|
anchorbrowser/resources/__init__.py,sha256=7EiFSg_zGe3PD-8qVTwpphzf2YNWHbUOzHt-iE607IA,3369
|
|
32
|
-
anchorbrowser/resources/agent.py,sha256
|
|
32
|
+
anchorbrowser/resources/agent.py,sha256=xq-kcychfQTmCDfdjjQWmBWLlFf03DnW-BoK4oRPdfc,20185
|
|
33
33
|
anchorbrowser/resources/browser.py,sha256=BB5hq_ayIDL_ziYHq13oj8US3XkHzkoXiGLBm7h9dH0,5548
|
|
34
34
|
anchorbrowser/resources/events.py,sha256=B6TwziBmOVMjWwoFO7OJR2X_Jt_3jtzNhQg4lgY-7SE,10780
|
|
35
35
|
anchorbrowser/resources/extensions.py,sha256=KWySN-tu8Cxy-LbY3TXLNMPs1s5Hzwwk7Rmr1AYLVeU,15943
|
|
36
36
|
anchorbrowser/resources/identities.py,sha256=fsRJwlO6-4r67ZcUlO_wJVKobFyw5adl4JdFG1zxQ-0,6378
|
|
37
37
|
anchorbrowser/resources/profiles.py,sha256=g6xLjfmdXfRM5QV-N-omShpSPO_jMvRRmxKjOllq5RQ,16206
|
|
38
38
|
anchorbrowser/resources/task.py,sha256=mimwjwBWvSDbXUYhjq7fVpbmGbsxDkBVEmxDTHiVeTQ,16580
|
|
39
|
-
anchorbrowser/resources/tools.py,sha256=
|
|
39
|
+
anchorbrowser/resources/tools.py,sha256=P9PQ8Md08RCCD1l4jbjuo-2C-SKxVPnHBuqkzOKrKjc,26384
|
|
40
40
|
anchorbrowser/resources/sessions/__init__.py,sha256=51tmuaKqEsEMfFTtZOovPAid6vYyKLkv6quuFBnQSiY,3330
|
|
41
41
|
anchorbrowser/resources/sessions/all.py,sha256=5iN5Vv6UW-2p07lEqiRHw3fFQC4m_acfvsn3yZVi_g0,7193
|
|
42
42
|
anchorbrowser/resources/sessions/clipboard.py,sha256=RuoY6Ev5oKsuk0KhPgtRk5GXCjqCk2D16e2hXzRY-4I,9572
|
|
@@ -116,7 +116,7 @@ anchorbrowser/types/sessions/agent/file_upload_response.py,sha256=9DnqplfvEud89U
|
|
|
116
116
|
anchorbrowser/types/sessions/recordings/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekDUge2o_4pXQ,122
|
|
117
117
|
anchorbrowser/types/shared/__init__.py,sha256=FQKjY3VDxI8T0feNRazdY5TOqb2KDeEwZaoJjsxuEl4,152
|
|
118
118
|
anchorbrowser/types/shared/success_response.py,sha256=l9OWrucXoSjBdsx5QKdvBPFtxv8d0YdpYY6iL5cWWuc,314
|
|
119
|
-
anchorbrowser-0.5.
|
|
120
|
-
anchorbrowser-0.5.
|
|
121
|
-
anchorbrowser-0.5.
|
|
122
|
-
anchorbrowser-0.5.
|
|
119
|
+
anchorbrowser-0.5.2.dist-info/METADATA,sha256=c3Co87zcx8pn_9N9ygGiGxW4NYFAh13jHnPDTU6jtp0,15407
|
|
120
|
+
anchorbrowser-0.5.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
121
|
+
anchorbrowser-0.5.2.dist-info/licenses/LICENSE,sha256=QYTH6OztHxnELDn890vME8F7-euzmsHhWI4XOSYxwOg,11343
|
|
122
|
+
anchorbrowser-0.5.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|