simplex 1.2.73__py3-none-any.whl → 1.2.76__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 simplex might be problematic. Click here for more details.
- simplex/simplex.py +99 -4
- {simplex-1.2.73.dist-info → simplex-1.2.76.dist-info}/METADATA +12 -2
- simplex-1.2.76.dist-info/RECORD +11 -0
- {simplex-1.2.73.dist-info → simplex-1.2.76.dist-info}/WHEEL +1 -1
- simplex-1.2.73.dist-info/RECORD +0 -11
- {simplex-1.2.73.dist-info → simplex-1.2.76.dist-info}/LICENSE +0 -0
- {simplex-1.2.73.dist-info → simplex-1.2.76.dist-info}/entry_points.txt +0 -0
- {simplex-1.2.73.dist-info → simplex-1.2.76.dist-info}/top_level.txt +0 -0
simplex/simplex.py
CHANGED
|
@@ -222,9 +222,48 @@ class Simplex:
|
|
|
222
222
|
return
|
|
223
223
|
else:
|
|
224
224
|
raise ValueError(f"Failed to enqueue actions: {response.json()['error']}")
|
|
225
|
+
|
|
226
|
+
def captcha_exists(self):
|
|
227
|
+
data = {
|
|
228
|
+
'session_id': self.session_id,
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
response = requests.post(
|
|
232
|
+
f"{BASE_URL}/captcha_exists",
|
|
233
|
+
headers={
|
|
234
|
+
'x-api-key': self.api_key
|
|
235
|
+
},
|
|
236
|
+
data=data
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
if 'succeeded' not in response.json():
|
|
240
|
+
raise ValueError(f"It looks like the captcha_exists action failed to return a response. Did you set your api_key when creating the Simplex class?")
|
|
241
|
+
if response.json()['succeeded']:
|
|
242
|
+
return response.json()['captcha_detected']
|
|
243
|
+
else:
|
|
244
|
+
raise ValueError(f"Failed to check if captcha is present: {response.json()['error']}")
|
|
245
|
+
|
|
246
|
+
def wait_for_captcha(self):
|
|
247
|
+
data = {
|
|
248
|
+
'session_id': self.session_id,
|
|
249
|
+
}
|
|
225
250
|
|
|
251
|
+
response = requests.post(
|
|
252
|
+
f"{BASE_URL}/wait_for_captcha",
|
|
253
|
+
headers={
|
|
254
|
+
'x-api-key': self.api_key
|
|
255
|
+
},
|
|
256
|
+
data=data
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
if 'succeeded' not in response.json():
|
|
260
|
+
raise ValueError(f"It looks like the wait_for_captcha action failed to return a response. Did you set your api_key when creating the Simplex class?")
|
|
261
|
+
if response.json()['succeeded']:
|
|
262
|
+
return response.json()['captcha_solved']
|
|
263
|
+
else:
|
|
264
|
+
raise ValueError(f"Failed to wait for captcha: {response.json()['error']}")
|
|
226
265
|
|
|
227
|
-
def click(self, element_description: str, override_fail_state: bool = False):
|
|
266
|
+
def click(self, element_description: str, dropdown_option: bool = False, override_fail_state: bool = False):
|
|
228
267
|
if not element_description or not element_description.strip():
|
|
229
268
|
raise ValueError("element_description cannot be empty")
|
|
230
269
|
if not self.session_id:
|
|
@@ -233,7 +272,8 @@ class Simplex:
|
|
|
233
272
|
data = {
|
|
234
273
|
'element_description': element_description,
|
|
235
274
|
'session_id': self.session_id,
|
|
236
|
-
'override_fail_state': override_fail_state
|
|
275
|
+
'override_fail_state': override_fail_state,
|
|
276
|
+
'dropdown_option': dropdown_option
|
|
237
277
|
}
|
|
238
278
|
|
|
239
279
|
response = requests.post(
|
|
@@ -572,6 +612,60 @@ class Simplex:
|
|
|
572
612
|
else:
|
|
573
613
|
raise ValueError(f"Failed to wait: {response.json()['error']}")
|
|
574
614
|
|
|
615
|
+
def set_dialog_settings(self, accept: bool = True):
|
|
616
|
+
if not self.session_id:
|
|
617
|
+
raise ValueError("Must call create_session before calling action set_dialog_settings")
|
|
618
|
+
|
|
619
|
+
data = {
|
|
620
|
+
'session_id': self.session_id,
|
|
621
|
+
'accept': accept
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
response = requests.post(
|
|
625
|
+
f"{BASE_URL}/set_dialog_settings",
|
|
626
|
+
headers={
|
|
627
|
+
'x-api-key': self.api_key
|
|
628
|
+
},
|
|
629
|
+
data=data
|
|
630
|
+
)
|
|
631
|
+
|
|
632
|
+
if 'succeeded' not in response.json():
|
|
633
|
+
raise ValueError(f"It looks like the set_dialog_settings action failed to return a response. Did you set your api_key when creating the Simplex class?")
|
|
634
|
+
if response.json()['succeeded']:
|
|
635
|
+
return
|
|
636
|
+
else:
|
|
637
|
+
raise ValueError(f"Failed to set dialog settings: {response.json()['error']}")
|
|
638
|
+
|
|
639
|
+
def get_dialog_message(self):
|
|
640
|
+
if not self.session_id:
|
|
641
|
+
raise ValueError("Must call create_session before calling action get_dialog_message")
|
|
642
|
+
|
|
643
|
+
data = {
|
|
644
|
+
'session_id': self.session_id
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
response = requests.post(
|
|
648
|
+
f"{BASE_URL}/get_dialog_message",
|
|
649
|
+
headers={
|
|
650
|
+
'x-api-key': self.api_key
|
|
651
|
+
},
|
|
652
|
+
data=data
|
|
653
|
+
)
|
|
654
|
+
|
|
655
|
+
if 'succeeded' not in response.json():
|
|
656
|
+
raise ValueError(f"It looks like the get_dialog_message action failed to return a response. Did you set your api_key when creating the Simplex class?")
|
|
657
|
+
|
|
658
|
+
res = response.json()
|
|
659
|
+
if res['succeeded']:
|
|
660
|
+
if 'message' in res:
|
|
661
|
+
return res['message']
|
|
662
|
+
else:
|
|
663
|
+
return None
|
|
664
|
+
else:
|
|
665
|
+
raise ValueError(f"Failed to get dialog message: {response.json()['error']}")
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
575
669
|
def create_login_session(self, url: str, save_directory: Optional[str] = None):
|
|
576
670
|
if not PLAYWRIGHT_AVAILABLE:
|
|
577
671
|
raise ImportError("This feature requires playwright. Install simplex[playwright] to use it.")
|
|
@@ -823,7 +917,7 @@ class Simplex:
|
|
|
823
917
|
|
|
824
918
|
return filename, response.content
|
|
825
919
|
|
|
826
|
-
def exists(self, element_description: str, override_fail_state: bool = False):
|
|
920
|
+
def exists(self, element_description: str, override_fail_state: bool = False, max_steps: Optional[int] = None):
|
|
827
921
|
if not element_description or not element_description.strip():
|
|
828
922
|
raise ValueError("element_description cannot be empty")
|
|
829
923
|
if not self.session_id:
|
|
@@ -832,7 +926,8 @@ class Simplex:
|
|
|
832
926
|
data = {
|
|
833
927
|
'element_description': element_description,
|
|
834
928
|
'session_id': self.session_id,
|
|
835
|
-
'override_fail_state': override_fail_state
|
|
929
|
+
'override_fail_state': override_fail_state,
|
|
930
|
+
'max_steps': max_steps
|
|
836
931
|
}
|
|
837
932
|
|
|
838
933
|
response = requests.post(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: simplex
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.76
|
|
4
4
|
Summary: Official Python SDK for Simplex API
|
|
5
5
|
Home-page: https://simplex.sh
|
|
6
6
|
Author: Simplex Labs, Inc.
|
|
@@ -19,6 +19,16 @@ Requires-Dist: python-dotenv
|
|
|
19
19
|
Requires-Dist: click
|
|
20
20
|
Provides-Extra: playwright
|
|
21
21
|
Requires-Dist: rebrowser-playwright>=1.0.0; extra == "playwright"
|
|
22
|
+
Dynamic: author
|
|
23
|
+
Dynamic: author-email
|
|
24
|
+
Dynamic: classifier
|
|
25
|
+
Dynamic: description
|
|
26
|
+
Dynamic: description-content-type
|
|
27
|
+
Dynamic: home-page
|
|
28
|
+
Dynamic: provides-extra
|
|
29
|
+
Dynamic: requires-dist
|
|
30
|
+
Dynamic: requires-python
|
|
31
|
+
Dynamic: summary
|
|
22
32
|
|
|
23
33
|
# Simplex AI Python SDK
|
|
24
34
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
simplex/__init__.py,sha256=L_5i__xt_ZDkr6e-Wx9cr84t9sXpioOT7j01NJYJCTE,75
|
|
2
|
+
simplex/cli.py,sha256=0K_pzoVdF7vfTJPUONhFzzTvjZk2M7FZPpEONjZWJC8,2268
|
|
3
|
+
simplex/simplex.py,sha256=NsSGeR_bmqpl60aVvak0LoBJMyzySCEvstFXjS4vTS0,39767
|
|
4
|
+
simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
|
|
5
|
+
simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
|
|
6
|
+
simplex-1.2.76.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
|
|
7
|
+
simplex-1.2.76.dist-info/METADATA,sha256=I20rjBbj_P7lioJ4ijblp0j2V3BMJKVDuWl-P2ZfC3E,1055
|
|
8
|
+
simplex-1.2.76.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
9
|
+
simplex-1.2.76.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
|
|
10
|
+
simplex-1.2.76.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
|
|
11
|
+
simplex-1.2.76.dist-info/RECORD,,
|
simplex-1.2.73.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
simplex/__init__.py,sha256=L_5i__xt_ZDkr6e-Wx9cr84t9sXpioOT7j01NJYJCTE,75
|
|
2
|
-
simplex/cli.py,sha256=0K_pzoVdF7vfTJPUONhFzzTvjZk2M7FZPpEONjZWJC8,2268
|
|
3
|
-
simplex/simplex.py,sha256=Juc_vRnluPNBSoMBfxoDgWz5kb2rbv-1hdt7CpaaMgQ,36378
|
|
4
|
-
simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
|
|
5
|
-
simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
|
|
6
|
-
simplex-1.2.73.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
|
|
7
|
-
simplex-1.2.73.dist-info/METADATA,sha256=ed8zy1xvLeOGJYGjAZs4WpyoP0qhUgsuvUDva8gmAjc,834
|
|
8
|
-
simplex-1.2.73.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
9
|
-
simplex-1.2.73.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
|
|
10
|
-
simplex-1.2.73.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
|
|
11
|
-
simplex-1.2.73.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|