sunholo 0.101.13__py3-none-any.whl → 0.102.0__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.
@@ -60,12 +60,13 @@ class GenAIFunctionProcessor:
60
60
  ```
61
61
  """
62
62
 
63
- def __init__(self, config: ConfigManager):
63
+ def __init__(self, config: ConfigManager=None, model_name=None):
64
64
  """
65
65
  Initializes the GenAIFunctionProcessor with the given configuration.
66
66
 
67
67
  Args:
68
68
  config (ConfigManager): The configuration manager instance.
69
+ model_name (str): The name of the model
69
70
  """
70
71
  if not genai:
71
72
  raise ImportError("import google.generativeai as genai is required, import via `pip install sunholo[gcp]`")
@@ -77,7 +78,12 @@ class GenAIFunctionProcessor:
77
78
  if 'decide_to_go_on' not in self.funcs:
78
79
  self.funcs['decide_to_go_on'] = self.decide_to_go_on
79
80
 
80
- self.model_name = config.vacConfig("model") if config.vacConfig("llm") == "vertex" else "gemini-1.5-flash"
81
+ self.model_name = "gemini-1.5-flash"
82
+ if config:
83
+ self.model_name = config.vacConfig("model") if config.vacConfig("llm") == "vertex" else "gemini-1.5-flash"
84
+ elif model_name:
85
+ self.model_name = model_name
86
+
81
87
  self.last_api_requests_and_responses = []
82
88
  self._validate_functions()
83
89
 
@@ -281,7 +287,7 @@ class GenAIFunctionProcessor:
281
287
  error_message = f"Error in {function_name}: {str(err)}"
282
288
  traceback_details = traceback.format_exc()
283
289
  log.warning(f"{error_message}\nTraceback: {traceback_details}")
284
- result = [f"{error_message}\n{traceback_details}"]
290
+ result = [error_message] #traceback uses too many tokens
285
291
  clean_result = self.remove_invisible_characters(result)
286
292
  api_requests_and_responses.append(
287
293
  [function_name, params, clean_result]
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.101.13
3
+ Version: 0.102.0
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.101.13.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.102.0.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -88,7 +88,7 @@ sunholo/gcs/metadata.py,sha256=oQLcXi4brsZ74aegWyC1JZmhlaEV270HS5_UWtAYYWE,898
88
88
  sunholo/genai/__init__.py,sha256=dBl6IA3-Fx6-Vx81r0XqxHlUq6WeW1iDX188dpChu8s,115
89
89
  sunholo/genai/images.py,sha256=eW5V2h2JdNqLkaw_u-pJSzu7edHzvrCWPLirolQXX5s,1617
90
90
  sunholo/genai/init.py,sha256=yG8E67TduFCTQPELo83OJuWfjwTnGZsyACospahyEaY,687
91
- sunholo/genai/process_funcs_cls.py,sha256=eCXRd4Aa9SNPdAjqN6Y2GYX_o5nlktHaS0zNk8mMtBM,29094
91
+ sunholo/genai/process_funcs_cls.py,sha256=wiOIMeGLFEParAkdwHbfySzsPuUgi0rimEYOMbWEZKU,29317
92
92
  sunholo/genai/safety.py,sha256=mkFDO_BeEgiKjQd9o2I4UxB6XI7a9U-oOFjZ8LGRUC4,1238
93
93
  sunholo/invoke/__init__.py,sha256=o1RhwBGOtVK0MIdD55fAIMCkJsxTksi8GD5uoqVKI-8,184
94
94
  sunholo/invoke/async_class.py,sha256=G8vD2H94fpBc37mSJSQODEKJ67P2mPQEHabtDaLOvxE,8033
@@ -147,9 +147,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
147
147
  sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
148
148
  sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
149
149
  sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
150
- sunholo-0.101.13.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
151
- sunholo-0.101.13.dist-info/METADATA,sha256=oyveQGMkcMQEef5c_L4T_A4nUMWQXDkYo9X_4Yqk454,8314
152
- sunholo-0.101.13.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
153
- sunholo-0.101.13.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
154
- sunholo-0.101.13.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
155
- sunholo-0.101.13.dist-info/RECORD,,
150
+ sunholo-0.102.0.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
151
+ sunholo-0.102.0.dist-info/METADATA,sha256=5-dYSKg8cpNoJLR8gKDD4f_y1sIlQ4TvJdox0l7K4n4,8312
152
+ sunholo-0.102.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
153
+ sunholo-0.102.0.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
154
+ sunholo-0.102.0.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
155
+ sunholo-0.102.0.dist-info/RECORD,,