simplex 1.2.6__tar.gz → 1.2.7__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.6
3
+ Version: 1.2.7
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://simplex.sh
6
6
  Author: Simplex Labs, Inc.
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="simplex",
5
- version="1.2.6",
5
+ version="1.2.7",
6
6
  packages=find_packages(),
7
7
  package_data={
8
8
  "simplex": ["browser_agent/dom/*.js"], # Include JS files in the dom directory
@@ -2,8 +2,8 @@ import os
2
2
  import requests
3
3
  import atexit
4
4
 
5
- # BASE_URL = "https://api.simplex.sh"
6
- BASE_URL = "http://localhost:8000"
5
+ BASE_URL = "http://api.simplex.sh"
6
+ import json
7
7
 
8
8
  class Simplex:
9
9
  def __init__(self, api_key: str):
@@ -68,7 +68,7 @@ class Simplex:
68
68
  },
69
69
  data=data
70
70
  )
71
- print(response.json())
71
+ return response.json()
72
72
 
73
73
  def click(self, element_description: str, cdp_url: str = None):
74
74
  if not cdp_url and not self.session_id:
@@ -88,7 +88,7 @@ class Simplex:
88
88
  },
89
89
  data=data
90
90
  )
91
- print(response.json())
91
+ return response.json()
92
92
 
93
93
  def type(self, text: str, cdp_url: str = None):
94
94
  if not cdp_url and not self.session_id:
@@ -108,7 +108,7 @@ class Simplex:
108
108
  },
109
109
  data=data
110
110
  )
111
- print(response.json())
111
+ return response.json()
112
112
 
113
113
  def press_enter(self, cdp_url: str = None):
114
114
  if not cdp_url and not self.session_id:
@@ -128,7 +128,7 @@ class Simplex:
128
128
  },
129
129
  data=data
130
130
  )
131
- print(response.json())
131
+ return response.json()
132
132
 
133
133
  def extract_bbox(self, element_description: str, cdp_url: str = None):
134
134
  if not cdp_url and not self.session_id:
@@ -235,6 +235,40 @@ class Simplex:
235
235
  )
236
236
  return response.json()
237
237
 
238
+ def capture_login_session(self, url: str):
239
+ response = requests.post(
240
+ f"{BASE_URL}/capture_login_session",
241
+ headers={
242
+ 'x-api-key': self.api_key
243
+ },
244
+ data={'url': url}
245
+ )
246
+ return response.json()
247
+
248
+ def restore_login_session(self, session_data_filepath: str, cdp_url: str = None):
249
+ filename = session_data_filepath
250
+
251
+ with open(filename, 'r') as f:
252
+ session_data = json.load(f)
253
+
254
+ # Serialize the data to JSON string
255
+ data = {
256
+ 'session_data': json.dumps(session_data) # Serialize the session_data
257
+ }
258
+ if cdp_url:
259
+ data['cdp_url'] = cdp_url
260
+ else:
261
+ data['session_id'] = self.session_id
262
+
263
+ response = requests.post(
264
+ f"{BASE_URL}/restore_login_session",
265
+ headers={
266
+ 'x-api-key': self.api_key
267
+ },
268
+ data=data
269
+ )
270
+ return response.json()
271
+
238
272
  def run_agent(self, prompt: str, cdp_url: str = None):
239
273
  if not cdp_url and not self.session_id:
240
274
  raise ValueError(f"Must call create_session before calling action run_agent with and prompt='{prompt}'")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.2.6
3
+ Version: 1.2.7
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://simplex.sh
6
6
  Author: Simplex Labs, Inc.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes