sunholo 0.84.7__py3-none-any.whl → 0.84.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.
@@ -4,7 +4,7 @@ from ..custom_logging import log
4
4
  from ..utils import ConfigManager
5
5
  from .safety import genai_safety
6
6
 
7
- from typing import TYPE_CHECKING
7
+ from typing import TYPE_CHECKING, Union
8
8
 
9
9
  try:
10
10
  import google.generativeai as genai
@@ -24,14 +24,15 @@ class GenAIFunctionProcessor:
24
24
  of function names mapped to their implementations.
25
25
 
26
26
  Attributes:
27
- config (ConfigManager): Configuration manager instance.
27
+ config (ConfigManager): Configuration manager instance. Reach values via self.config within your own construct_tools() method
28
28
  funcs (dict): A dictionary of function names mapped to their implementations.
29
29
 
30
30
  Example usage:
31
+
31
32
  ```python
32
33
  class AlloyDBFunctionProcessor(GenAIFunctionProcessor):
33
34
  def construct_tools(self) -> dict:
34
- ...
35
+ pass
35
36
 
36
37
  config = ConfigManager()
37
38
  alloydb_processor = AlloyDBFunctionProcessor(config)
@@ -68,7 +69,7 @@ class GenAIFunctionProcessor:
68
69
  function implementations required for the application.
69
70
 
70
71
  Returns:
71
- dict: A dictionary where keys are function names and values are function objects. e.g. {"my_func": my_func}
72
+ dict: A dictionary where keys are function names and values are function objects
72
73
 
73
74
  Raises:
74
75
  NotImplementedError: If the method is not overridden in a subclass.
@@ -91,7 +92,7 @@ class GenAIFunctionProcessor:
91
92
  log.error(f"Function {func_name} is missing a docstring.")
92
93
  raise ValueError(f"Function {func_name} must have a docstring to be used as a genai tool.")
93
94
 
94
- def process_funcs(self, full_response, output_parts=True) -> list['Part'] | str:
95
+ def process_funcs(self, full_response, output_parts=True) -> Union[list['Part'], str]:
95
96
  """
96
97
  Processes the functions based on the full_response from the generative model.
97
98
 
@@ -111,6 +112,8 @@ class GenAIFunctionProcessor:
111
112
  results = alloydb_processor.process_funcs(full_response)
112
113
  ```
113
114
  """
115
+ from google.generativeai.protos import Part
116
+
114
117
  api_requests_and_responses = []
115
118
 
116
119
  # Loop through each part in the response to handle multiple function calls
@@ -180,6 +183,7 @@ class GenAIFunctionProcessor:
180
183
  GenerativeModel: An instance of the GenerativeModel configured with the provided tools.
181
184
 
182
185
  Example usage:
186
+
183
187
  ```python
184
188
  alloydb_model = alloydb_processor.get_model(
185
189
  model_name="gemini-1.5-pro",
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.84.7
3
+ Version: 0.84.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.84.7.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.84.8.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -83,7 +83,7 @@ sunholo/gcs/download_folder.py,sha256=ijJTnS595JqZhBH8iHFErQilMbkuKgL-bnTCMLGuvl
83
83
  sunholo/gcs/download_url.py,sha256=q1NiJSvEhdNrmU5ZJ-sBCMC_J5CxzrajY8LRgdPOV_M,6130
84
84
  sunholo/gcs/metadata.py,sha256=oQLcXi4brsZ74aegWyC1JZmhlaEV270HS5_UWtAYYWE,898
85
85
  sunholo/genai/__init__.py,sha256=o2c17UbgzIDxNKKF8deCLoctNpatAYgm9Cf9XDfpqvg,87
86
- sunholo/genai/process_funcs_cls.py,sha256=h0W767nXrwPesrc9iDEJ1bzesvXeze7YV8U7cASkKdc,8150
86
+ sunholo/genai/process_funcs_cls.py,sha256=q0XbsLaMWhN7LCukRGaXr0KzJtGmxbu6OVoGd3o3ibM,8270
87
87
  sunholo/genai/safety.py,sha256=mkFDO_BeEgiKjQd9o2I4UxB6XI7a9U-oOFjZ8LGRUC4,1238
88
88
  sunholo/invoke/__init__.py,sha256=bELcqIjzKvaupcIN5OQmDgGx_8jARtH9T6PCe8UgcvE,99
89
89
  sunholo/invoke/async_class.py,sha256=J-qMgarhdi6nPQyOIFM5k0wF7nqr8aJGaz99-Ye6XGQ,3507
@@ -138,9 +138,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
138
138
  sunholo/vertex/memory_tools.py,sha256=q_phxgGX2TG2j2MXNULF2xGzQnQPENwjPN9nZ_A9Gh0,7526
139
139
  sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
140
140
  sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
141
- sunholo-0.84.7.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
142
- sunholo-0.84.7.dist-info/METADATA,sha256=7k9YTlJrqeB25j52O1Qr3kCfTAmu2hy5W_Tn62IepEE,7412
143
- sunholo-0.84.7.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
144
- sunholo-0.84.7.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
145
- sunholo-0.84.7.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
146
- sunholo-0.84.7.dist-info/RECORD,,
141
+ sunholo-0.84.8.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
142
+ sunholo-0.84.8.dist-info/METADATA,sha256=iEv_hxCGy1Jyw1icFKKEStYm01YhOBKTtTUMk8HrWIQ,7412
143
+ sunholo-0.84.8.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
144
+ sunholo-0.84.8.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
145
+ sunholo-0.84.8.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
146
+ sunholo-0.84.8.dist-info/RECORD,,