sunholo 0.99.7__py3-none-any.whl → 0.99.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.
- sunholo/genai/process_funcs_cls.py +13 -7
- {sunholo-0.99.7.dist-info → sunholo-0.99.8.dist-info}/METADATA +2 -2
- {sunholo-0.99.7.dist-info → sunholo-0.99.8.dist-info}/RECORD +7 -7
- {sunholo-0.99.7.dist-info → sunholo-0.99.8.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.99.7.dist-info → sunholo-0.99.8.dist-info}/WHEEL +0 -0
- {sunholo-0.99.7.dist-info → sunholo-0.99.8.dist-info}/entry_points.txt +0 -0
- {sunholo-0.99.7.dist-info → sunholo-0.99.8.dist-info}/top_level.txt +0 -0
|
@@ -269,9 +269,9 @@ class GenAIFunctionProcessor:
|
|
|
269
269
|
traceback_details = traceback.format_exc()
|
|
270
270
|
log.warning(f"{error_message}\nTraceback: {traceback_details}")
|
|
271
271
|
result = [f"{error_message}\n{traceback_details}"]
|
|
272
|
-
|
|
272
|
+
clean_result = self.remove_invisible_characters(result)
|
|
273
273
|
api_requests_and_responses.append(
|
|
274
|
-
[function_name, params,
|
|
274
|
+
[function_name, params, clean_result]
|
|
275
275
|
)
|
|
276
276
|
else:
|
|
277
277
|
log.error(f"Function {function_name} is not recognized")
|
|
@@ -350,6 +350,12 @@ class GenAIFunctionProcessor:
|
|
|
350
350
|
except Exception as err:
|
|
351
351
|
log.error(f"Error initializing model: {str(err)}")
|
|
352
352
|
return None
|
|
353
|
+
|
|
354
|
+
def remove_invisible_characters(self, string:str):
|
|
355
|
+
clean = string.encode('utf-8').decode('unicode_escape')
|
|
356
|
+
log.info(f"Cleaning:\n{string}\n > to >\n{clean}")
|
|
357
|
+
|
|
358
|
+
return clean
|
|
353
359
|
|
|
354
360
|
def run_agent_loop(self, chat, content, callback, guardrail_max=10, loop_return=3):
|
|
355
361
|
"""
|
|
@@ -484,11 +490,11 @@ class GenAIFunctionProcessor:
|
|
|
484
490
|
if fn_result_json:
|
|
485
491
|
log.info(f"{fn_result_json} dict parsing")
|
|
486
492
|
if fn_result_json.get('stdout'):
|
|
487
|
-
text = fn_result_json.get('stdout')
|
|
488
|
-
token += text
|
|
493
|
+
text = fn_result_json.get('stdout')
|
|
494
|
+
token += self.remove_invisible_characters(text)
|
|
489
495
|
if fn_result_json.get('stderr'):
|
|
490
|
-
text = fn_result_json.get('stdout')
|
|
491
|
-
token += text
|
|
496
|
+
text = fn_result_json.get('stdout')
|
|
497
|
+
token += self.remove_invisible_characters(text)
|
|
492
498
|
# If neither 'stdout' nor 'stderr' is present, dump the entire JSON
|
|
493
499
|
if 'stdout' not in fn_result_json and 'stderr' not in fn_result_json:
|
|
494
500
|
log.info(f"No recognised keys ('stdout' or 'stderr') in dict: {fn_result_json=} - dumping it all")
|
|
@@ -496,7 +502,7 @@ class GenAIFunctionProcessor:
|
|
|
496
502
|
else:
|
|
497
503
|
# probably a string, just return it
|
|
498
504
|
log.info(f"{fn_result_json} non-dict (String?) parsing")
|
|
499
|
-
token += f"{fn_result}\n--- end ---\n"
|
|
505
|
+
token += f"{self.remove_invisible_characters(fn_result)}\n--- end ---\n"
|
|
500
506
|
|
|
501
507
|
this_text += token
|
|
502
508
|
token_queue.append(token)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.99.
|
|
3
|
+
Version: 0.99.8
|
|
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.99.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.99.8.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -86,7 +86,7 @@ sunholo/gcs/download_url.py,sha256=q1NiJSvEhdNrmU5ZJ-sBCMC_J5CxzrajY8LRgdPOV_M,6
|
|
|
86
86
|
sunholo/gcs/metadata.py,sha256=oQLcXi4brsZ74aegWyC1JZmhlaEV270HS5_UWtAYYWE,898
|
|
87
87
|
sunholo/genai/__init__.py,sha256=dBl6IA3-Fx6-Vx81r0XqxHlUq6WeW1iDX188dpChu8s,115
|
|
88
88
|
sunholo/genai/init.py,sha256=yG8E67TduFCTQPELo83OJuWfjwTnGZsyACospahyEaY,687
|
|
89
|
-
sunholo/genai/process_funcs_cls.py,sha256=
|
|
89
|
+
sunholo/genai/process_funcs_cls.py,sha256=mw-6qxtk6QedeWTSeP-hyfyc_LT8X_2_IXqAO6ZXkJc,25623
|
|
90
90
|
sunholo/genai/safety.py,sha256=mkFDO_BeEgiKjQd9o2I4UxB6XI7a9U-oOFjZ8LGRUC4,1238
|
|
91
91
|
sunholo/invoke/__init__.py,sha256=o1RhwBGOtVK0MIdD55fAIMCkJsxTksi8GD5uoqVKI-8,184
|
|
92
92
|
sunholo/invoke/async_class.py,sha256=uvCP8ekUCfTRWk7xwofTzRqFykMAwrRZ4Ce_YUR6PVs,2820
|
|
@@ -144,9 +144,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
|
|
|
144
144
|
sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
|
|
145
145
|
sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
|
|
146
146
|
sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
|
|
147
|
-
sunholo-0.99.
|
|
148
|
-
sunholo-0.99.
|
|
149
|
-
sunholo-0.99.
|
|
150
|
-
sunholo-0.99.
|
|
151
|
-
sunholo-0.99.
|
|
152
|
-
sunholo-0.99.
|
|
147
|
+
sunholo-0.99.8.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
148
|
+
sunholo-0.99.8.dist-info/METADATA,sha256=o77jfs-et_Fqf2oI_oB3EA7xDAxuMlxWffcz9IHSa4E,8310
|
|
149
|
+
sunholo-0.99.8.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
150
|
+
sunholo-0.99.8.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
151
|
+
sunholo-0.99.8.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
152
|
+
sunholo-0.99.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|