sunholo 0.74.5__py3-none-any.whl → 0.74.7__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.
@@ -189,12 +189,11 @@ class BrowseWebWithImagePromptsBot:
189
189
  if status != 200:
190
190
  log.error(f"Failed to navigate to {url}: HTTP {status}")
191
191
  self.action_log.append(f"Tried to navigate to {url} but failed: HTTP {status} - browsing back to {previous_url}")
192
- url = previous_url
193
- self.page.goto(previous_url)
192
+ self.page.go_back()
194
193
 
195
194
  self.page.wait_for_load_state()
196
- log.info(f'Navigated to {url}')
197
- self.action_log.append(f"Navigated to {url}")
195
+ log.info(f'Navigated to {self.page.url}')
196
+ self.action_log.append(f"Navigated to {self.page.url}")
198
197
 
199
198
  except Exception as err:
200
199
  log.warning(f"navigate failed with {str(err)}")
@@ -202,7 +201,7 @@ class BrowseWebWithImagePromptsBot:
202
201
 
203
202
  def get_locator(self, selector, by_text=True):
204
203
  if by_text:
205
- elements = self.page.locator(f"text={selector}").all()
204
+ elements = self.page.get_by_text(selector).all()
206
205
  if elements:
207
206
  return elements[0]
208
207
  else:
@@ -357,9 +356,11 @@ class BrowseWebWithImagePromptsBot:
357
356
  output = json.loads(response)
358
357
  elif isinstance(response, list):
359
358
  log.warning(f'Response was a list, assuming its only new_instructions: {response=}')
360
- output['new_instructions'] = response
361
- output['status'] = 'in-progress'
362
- output['message'] = 'No message was received, which is a mistake by the assistant'
359
+ output = {
360
+ 'new_instructions' : response,
361
+ 'status': 'in-progress',
362
+ 'message': 'No message was received, which is a mistake by the assistant'
363
+ }
363
364
  else:
364
365
  log.warning(f'Unknown response: {response=} {type(response)}')
365
366
  output = None
@@ -516,9 +517,13 @@ This method should be implemented by subclasses: `def send_prompt_to_llm(self, p
516
517
  self.take_screenshot()
517
518
 
518
519
  self.close()
520
+
521
+ answer = None
522
+ if next_instructions and next_instructions.get('status') == 'completed':
523
+ answer = next_instructions.get('message'),
519
524
 
520
525
  return {
521
- "answer": next_instructions.get('message', 'No last message was received'),
526
+ "answer": answer,
522
527
  "metadata": {
523
528
  "website": self.website_name,
524
529
  "log": self.action_log,
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.74.5
3
+ Version: 0.74.7
4
4
  Summary: Large Language Model DevOps - a package to help deploy LLMs to the Cloud.
5
5
  Home-page: https://github.com/sunholo-data/sunholo-py
6
- Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.74.5.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.74.7.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -99,7 +99,7 @@ sunholo/streaming/streaming.py,sha256=9z6pXINEopuL_Z1RnmgXAoZJum9dzyuOxqYtEYnjf8
99
99
  sunholo/summarise/__init__.py,sha256=MZk3dblUMODcPb1crq4v-Z508NrFIpkSWNf9FIO8BcU,38
100
100
  sunholo/summarise/summarise.py,sha256=C3HhjepTjUhUC8FLk4jMQIBvq1BcORniwuTFHjPVhVo,3784
101
101
  sunholo/tools/__init__.py,sha256=5NuYpwwTX81qGUWvgwfItoSLXteNnp7KjgD7IPZUFjI,53
102
- sunholo/tools/web_browser.py,sha256=e9VQyk4Q8CqxuHiOTGSBRw7sei7Wkcy75ptrtKXo9Wo,21672
102
+ sunholo/tools/web_browser.py,sha256=SGNSObQ6bxgFGrI6FoKI31F1EuSQ1XonJxauStYWtTg,21780
103
103
  sunholo/utils/__init__.py,sha256=Hv02T5L2zYWvCso5hzzwm8FQogwBq0OgtUbN_7Quzqc,89
104
104
  sunholo/utils/api_key.py,sha256=Ct4bIAQZxzPEw14hP586LpVxBAVi_W9Serpy0BK-7KI,244
105
105
  sunholo/utils/big_context.py,sha256=gJIP7_ZL-YSLhOMq8jmFTMqH1wq8eB1NK7oKPeZAq2s,5578
@@ -117,9 +117,9 @@ sunholo/vertex/extensions_class.py,sha256=4PsUM9dSYrIPpq9bZ3K2rL9MRb_rlqAgnMsW0o
117
117
  sunholo/vertex/init.py,sha256=-w7b9GKsyJnAJpYHYz6_zBUtmeJeLXlEkgOfwoe4DEI,2715
118
118
  sunholo/vertex/memory_tools.py,sha256=pomHrDKqvY8MZxfUqoEwhdlpCvSGP6KmFJMVKOimXjs,6842
119
119
  sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
120
- sunholo-0.74.5.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
121
- sunholo-0.74.5.dist-info/METADATA,sha256=yCZXDFsvYMx-E_wQxSk2vEurvvW1ukKukJ8D__Vn0rI,7010
122
- sunholo-0.74.5.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
123
- sunholo-0.74.5.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
124
- sunholo-0.74.5.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
125
- sunholo-0.74.5.dist-info/RECORD,,
120
+ sunholo-0.74.7.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
121
+ sunholo-0.74.7.dist-info/METADATA,sha256=7UcUFn-TT6y-4aTHe3JyuBpoK1iiBVbFsusIAXys94U,7010
122
+ sunholo-0.74.7.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
123
+ sunholo-0.74.7.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
124
+ sunholo-0.74.7.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
125
+ sunholo-0.74.7.dist-info/RECORD,,