simplex 1.2.73__tar.gz → 1.2.76__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.

Potentially problematic release.


This version of simplex might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.73
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
 
@@ -22,7 +22,7 @@ class PostInstallCommand(install):
22
22
 
23
23
  setup(
24
24
  name="simplex",
25
- version="1.2.73",
25
+ version="1.2.76",
26
26
  packages=find_packages(),
27
27
  package_data={
28
28
  "simplex": ["browser_agent/dom/*.js"], # Include JS files in the dom directory
@@ -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
1
+ Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.73
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
 
File without changes
File without changes
File without changes
File without changes
File without changes