simplex 1.1.0__tar.gz → 1.2.0__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.1.0
3
+ Version: 1.2.0
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://github.com/shreyka/simplex-python
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.1.0",
5
+ version="1.2.0",
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  "openai>=1.0.0",
@@ -29,7 +29,7 @@ class Simplex:
29
29
 
30
30
  self.driver = self.browser.new_page(viewport={"width": 1280, "height": 720})
31
31
 
32
- def find_element(self, element_description: str, state: Image.Image | None = None, annotate: bool = False) -> List[int]:
32
+ def find_element(self, element_description: str, state: Image.Image | None = None, annotate: bool = True) -> List[int]:
33
33
  """
34
34
  Find an element in the screenshot using the element description
35
35
 
@@ -153,7 +153,7 @@ class Simplex:
153
153
  """
154
154
  self.driver.goto(url)
155
155
 
156
- def execute_action(self, action: List[List[str]], state: Image.Image | None = None, annotate: bool = False) -> None:
156
+ def execute_action(self, action: List[List[str]], state: Image.Image | None = None, annotate: bool = True) -> None:
157
157
  """
158
158
  Execute an action with playwright driver
159
159
 
@@ -166,12 +166,12 @@ class Simplex:
166
166
 
167
167
  try:
168
168
  if action_type == "CLICK":
169
- bbox = self.find_element(description, state, annotate)
169
+ bbox = self.find_element(description, state, annotate=annotate)
170
170
  center_x, center_y = center_bbox(bbox)
171
171
  self.driver.mouse.click(center_x, center_y)
172
172
 
173
173
  elif action_type == "HOVER":
174
- bbox = self.find_element(description, state, annotate)
174
+ bbox = self.find_element(description, state, annotate=annotate)
175
175
  center_x, center_y = center_bbox(bbox)
176
176
  self.driver.mouse.move(center_x, center_y)
177
177
 
@@ -188,14 +188,14 @@ class Simplex:
188
188
  print(f"Error executing action: {e}")
189
189
  return None
190
190
 
191
- def do(self, step_description: str, annotate: bool = False) -> None:
191
+ def do(self, step_description: str, annotate: bool = True) -> None:
192
192
  """
193
193
  Execute a step description
194
194
  """
195
195
  state = self.take_stable_screenshot()
196
196
  actions = self.step_to_action(step_description, state)
197
197
  for action in actions:
198
- self.execute_action(action, annotate)
198
+ self.execute_action(action, annotate=annotate)
199
199
 
200
200
  def take_stable_screenshot(self) -> Image.Image:
201
201
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: simplex
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Official Python SDK for Simplex API
5
5
  Home-page: https://github.com/shreyka/simplex-python
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
File without changes