simplex 1.2.55__tar.gz → 1.2.57__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
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.55
3
+ Version: 1.2.57
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://simplex.sh
6
6
  Author: Simplex Labs, Inc.
@@ -22,7 +22,7 @@ class PostInstallCommand(install):
22
22
 
23
23
  setup(
24
24
  name="simplex",
25
- version="1.2.55",
25
+ version="1.2.57",
26
26
  packages=find_packages(),
27
27
  package_data={
28
28
  "simplex": ["browser_agent/dom/*.js"], # Include JS files in the dom directory
@@ -110,7 +110,10 @@ class Simplex:
110
110
  else:
111
111
  raise ValueError(f"Failed to close session: {response.json()['error']}")
112
112
 
113
- def create_session(self, show_in_console: Optional[bool] = True, proxies: Optional[bool] = True, session_data: Optional[dict | str] = None):
113
+ def create_session(self, show_in_console: Optional[bool] = True, proxies: Optional[bool] = True, workflow_name: Optional[str] = None, session_data: Optional[dict | str] = None):
114
+ if self.session_id:
115
+ raise ValueError("A session is already active. Please close the current session before creating a new one.")
116
+
114
117
  if session_data:
115
118
  if isinstance(session_data, dict):
116
119
  session_data_dict = session_data
@@ -130,7 +133,7 @@ class Simplex:
130
133
  headers={
131
134
  'x-api-key': self.api_key
132
135
  },
133
- data={'proxies': proxies, 'session_data': json.dumps(session_data_dict)}
136
+ data={'proxies': proxies, 'session_data': json.dumps(session_data_dict), 'workflow_name': workflow_name}
134
137
  )
135
138
  else:
136
139
  response = requests.post(
@@ -138,7 +141,7 @@ class Simplex:
138
141
  headers={
139
142
  'x-api-key': self.api_key
140
143
  },
141
- data={'proxies': proxies}
144
+ data={'proxies': proxies, "workflow_name": workflow_name}
142
145
  )
143
146
  # Check for non-200 status code
144
147
  if response.status_code != 200:
@@ -356,12 +359,13 @@ class Simplex:
356
359
  },
357
360
  data=data
358
361
  )
359
- if 'succeeded' not in response.json():
362
+ response_json = response.json()
363
+ if 'succeeded' not in response_json:
360
364
  raise ValueError(f"It looks like the extract_text action failed to return a response. Did you set your api_key when creating the Simplex class?")
361
- if response.json()["succeeded"]:
362
- return response.json()["text"]
365
+ if response_json["succeeded"]:
366
+ return response_json["text"]
363
367
  else:
364
- raise ValueError(f"Failed to extract text: {response.json()['error']}")
368
+ raise ValueError(f"Failed to extract text: {response_json['error']}")
365
369
 
366
370
  def extract_image(self, element_description: str, cdp_url: str = None):
367
371
  if not cdp_url and not self.session_id:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.55
3
+ Version: 1.2.57
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://simplex.sh
6
6
  Author: Simplex Labs, Inc.
@@ -11,5 +11,4 @@ simplex.egg-info/entry_points.txt
11
11
  simplex.egg-info/requires.txt
12
12
  simplex.egg-info/top_level.txt
13
13
  simplex/deploy/__init__.py
14
- simplex/deploy/push.py
15
- tests/test.py
14
+ simplex/deploy/push.py
@@ -1,23 +0,0 @@
1
- from simplex import Simplex
2
- import os
3
- from dotenv import load_dotenv
4
- import time
5
- from playwright.async_api import Page
6
-
7
- import asyncio
8
- import os
9
- import dotenv
10
-
11
- dotenv.load_dotenv()
12
-
13
- async def main():
14
- simplex = Simplex(os.getenv("SIMPLEX_API_KEY"))
15
-
16
- simplex.create_session()
17
- simplex.goto("https://gmail.com")
18
- simplex.type("test@gmail.com")
19
- simplex.press_enter()
20
- simplex.wait(1000000)
21
- if __name__ == "__main__":
22
- asyncio.run(main())
23
-
File without changes
File without changes
File without changes
File without changes
File without changes