simplex 1.2.6__py3-none-any.whl → 1.2.8__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 +40 -6
- {simplex-1.2.6.dist-info → simplex-1.2.8.dist-info}/METADATA +1 -1
- simplex-1.2.8.dist-info/RECORD +11 -0
- simplex-1.2.6.dist-info/RECORD +0 -11
- {simplex-1.2.6.dist-info → simplex-1.2.8.dist-info}/LICENSE +0 -0
- {simplex-1.2.6.dist-info → simplex-1.2.8.dist-info}/WHEEL +0 -0
- {simplex-1.2.6.dist-info → simplex-1.2.8.dist-info}/entry_points.txt +0 -0
- {simplex-1.2.6.dist-info → simplex-1.2.8.dist-info}/top_level.txt +0 -0
simplex/simplex.py
CHANGED
|
@@ -2,8 +2,8 @@ import os
|
|
|
2
2
|
import requests
|
|
3
3
|
import atexit
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
BASE_URL = "https://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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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}'")
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
simplex/__init__.py,sha256=1mbM4XUk0FNW161WOkM4ayC1s_QSsaBEls6PZ0iBScY,74
|
|
2
|
+
simplex/cli.py,sha256=PkHt3sBKYfu0Smil4aCMoZUD-JbPw8xsBewpFcBYDKM,675
|
|
3
|
+
simplex/simplex.py,sha256=h50tySi2tn2iXgYDTtoUZN3j6ewh_-iWZKCRq431Cfk,8644
|
|
4
|
+
simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
|
|
5
|
+
simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
|
|
6
|
+
simplex-1.2.8.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
|
|
7
|
+
simplex-1.2.8.dist-info/METADATA,sha256=0AEZyu6qUVG9kKDji_K3azu4qoIIQRGQYtdJiZS_FJI,1349
|
|
8
|
+
simplex-1.2.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
9
|
+
simplex-1.2.8.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
|
|
10
|
+
simplex-1.2.8.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
|
|
11
|
+
simplex-1.2.8.dist-info/RECORD,,
|
simplex-1.2.6.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
simplex/__init__.py,sha256=1mbM4XUk0FNW161WOkM4ayC1s_QSsaBEls6PZ0iBScY,74
|
|
2
|
-
simplex/cli.py,sha256=PkHt3sBKYfu0Smil4aCMoZUD-JbPw8xsBewpFcBYDKM,675
|
|
3
|
-
simplex/simplex.py,sha256=qZPxheNfSl8gL_CST2br7K5pqRsdVgct5TBJa5vjsYE,7650
|
|
4
|
-
simplex/deploy/__init__.py,sha256=_JQ81F_Nu7hSAfMA691gzs6a4-8oZ-buJ9h3Au12BKw,96
|
|
5
|
-
simplex/deploy/push.py,sha256=hRAbtFZaECKnBljaOLQ5nzJ6hk7tZgc1c7QdgxKQFoY,6123
|
|
6
|
-
simplex-1.2.6.dist-info/LICENSE,sha256=Xh0SJjYZfNI71pCNMB40aKlBLLuOB0blx5xkTtufFNQ,1075
|
|
7
|
-
simplex-1.2.6.dist-info/METADATA,sha256=HgZl9RcXCuKt9eY_6J_pZBBLisTjgtO02OSEA8NTubM,1349
|
|
8
|
-
simplex-1.2.6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
9
|
-
simplex-1.2.6.dist-info/entry_points.txt,sha256=3veL2w3c5vxb3dm8I_M8Fs-370n1ZnvD8uu1nSsL7z8,45
|
|
10
|
-
simplex-1.2.6.dist-info/top_level.txt,sha256=cbMH1bYpN0A3gP-ecibPRHasHoqB-01T_2BUFS8p0CE,8
|
|
11
|
-
simplex-1.2.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|