sunholo 0.85.2__py3-none-any.whl → 0.86.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.
- sunholo/genai/__init__.py +1 -0
- sunholo/genai/init.py +18 -0
- sunholo/genai/process_funcs_cls.py +1 -1
- sunholo/invoke/direct_vac_func.py +1 -4
- {sunholo-0.85.2.dist-info → sunholo-0.86.0.dist-info}/METADATA +2 -2
- {sunholo-0.85.2.dist-info → sunholo-0.86.0.dist-info}/RECORD +10 -9
- {sunholo-0.85.2.dist-info → sunholo-0.86.0.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.85.2.dist-info → sunholo-0.86.0.dist-info}/WHEEL +0 -0
- {sunholo-0.85.2.dist-info → sunholo-0.86.0.dist-info}/entry_points.txt +0 -0
- {sunholo-0.85.2.dist-info → sunholo-0.86.0.dist-info}/top_level.txt +0 -0
sunholo/genai/__init__.py
CHANGED
sunholo/genai/init.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
def init_genai():
|
|
4
|
+
"""
|
|
5
|
+
There are some features that come to the google.generativeai first,
|
|
6
|
+
which needs to be authenticated via a GOOGLE_API_KEY environment variable,
|
|
7
|
+
created via the Google AI Console at https://aistudio.google.com/app/apikey
|
|
8
|
+
"""
|
|
9
|
+
try:
|
|
10
|
+
import google.generativeai as genai
|
|
11
|
+
except ImportError:
|
|
12
|
+
raise ImportError("google.generativeai not installed, please install via 'pip install sunholo'[gcp]'")
|
|
13
|
+
|
|
14
|
+
GOOGLE_API_KEY=os.getenv('GOOGLE_API_KEY')
|
|
15
|
+
if not GOOGLE_API_KEY:
|
|
16
|
+
raise ValueError("google.generativeai needs GOOGLE_API_KEY set in environment variable")
|
|
17
|
+
|
|
18
|
+
genai.configure(api_key=GOOGLE_API_KEY)
|
|
@@ -58,7 +58,7 @@ class GenAIFunctionProcessor:
|
|
|
58
58
|
|
|
59
59
|
self.config = config
|
|
60
60
|
self.funcs = self.construct_tools()
|
|
61
|
-
self.model_name = config.vacConfig("model")
|
|
61
|
+
self.model_name = config.vacConfig("model") if config.vacConfig("llm") == "vertex" else "gemini-1.5-flash"
|
|
62
62
|
self.last_api_requests_and_responses = []
|
|
63
63
|
self._validate_functions()
|
|
64
64
|
|
|
@@ -56,10 +56,7 @@ def direct_vac(vac_input: dict, vac_name: str, chat_history=[]):
|
|
|
56
56
|
|
|
57
57
|
log.info(f'Batch invoke_vac_qa {vac_name} with {qa_kwargs=}')
|
|
58
58
|
|
|
59
|
-
vac_response = send_to_qa(
|
|
60
|
-
vac_input["user_input"],
|
|
61
|
-
**qa_kwargs
|
|
62
|
-
)
|
|
59
|
+
vac_response = send_to_qa(**qa_kwargs)
|
|
63
60
|
|
|
64
61
|
# ensures {'answer': answer}
|
|
65
62
|
answer = parse_output(vac_response)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.86.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.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.86.0.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -84,12 +84,13 @@ sunholo/gcs/add_file.py,sha256=TRbdEd3j-lFnyC7kqs5IWEPMPlDMFLR68fdTWga06Wo,8096
|
|
|
84
84
|
sunholo/gcs/download_folder.py,sha256=ijJTnS595JqZhBH8iHFErQilMbkuKgL-bnTCMLGuvlA,1614
|
|
85
85
|
sunholo/gcs/download_url.py,sha256=q1NiJSvEhdNrmU5ZJ-sBCMC_J5CxzrajY8LRgdPOV_M,6130
|
|
86
86
|
sunholo/gcs/metadata.py,sha256=oQLcXi4brsZ74aegWyC1JZmhlaEV270HS5_UWtAYYWE,898
|
|
87
|
-
sunholo/genai/__init__.py,sha256=
|
|
88
|
-
sunholo/genai/
|
|
87
|
+
sunholo/genai/__init__.py,sha256=dBl6IA3-Fx6-Vx81r0XqxHlUq6WeW1iDX188dpChu8s,115
|
|
88
|
+
sunholo/genai/init.py,sha256=yG8E67TduFCTQPELo83OJuWfjwTnGZsyACospahyEaY,687
|
|
89
|
+
sunholo/genai/process_funcs_cls.py,sha256=8wLO45x6FTNbbTbNtgK8Xa_bm1mLyn5vOqoE9RPvE78,11839
|
|
89
90
|
sunholo/genai/safety.py,sha256=mkFDO_BeEgiKjQd9o2I4UxB6XI7a9U-oOFjZ8LGRUC4,1238
|
|
90
91
|
sunholo/invoke/__init__.py,sha256=bELcqIjzKvaupcIN5OQmDgGx_8jARtH9T6PCe8UgcvE,99
|
|
91
92
|
sunholo/invoke/async_class.py,sha256=vmLT6DqE1YaPd4W88_QzPQvSzsjwLUAwt23vGZm-BEs,5767
|
|
92
|
-
sunholo/invoke/direct_vac_func.py,sha256=
|
|
93
|
+
sunholo/invoke/direct_vac_func.py,sha256=fuTJlH5PsqWhN_yVMaWisHCTZU1JEUz8I8yVbWsNUFE,4268
|
|
93
94
|
sunholo/invoke/invoke_vac_utils.py,sha256=sJc1edHTHMzMGXjji1N67c3iUaP7BmAL5nj82Qof63M,2053
|
|
94
95
|
sunholo/langfuse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
95
96
|
sunholo/langfuse/callback.py,sha256=jl0SZsFS53uMW9DGeM9SOL_EsRZsba0wwFGLqKzu9_U,1684
|
|
@@ -140,9 +141,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
|
|
|
140
141
|
sunholo/vertex/memory_tools.py,sha256=q_phxgGX2TG2j2MXNULF2xGzQnQPENwjPN9nZ_A9Gh0,7526
|
|
141
142
|
sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
|
|
142
143
|
sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
|
|
143
|
-
sunholo-0.
|
|
144
|
-
sunholo-0.
|
|
145
|
-
sunholo-0.
|
|
146
|
-
sunholo-0.
|
|
147
|
-
sunholo-0.
|
|
148
|
-
sunholo-0.
|
|
144
|
+
sunholo-0.86.0.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
145
|
+
sunholo-0.86.0.dist-info/METADATA,sha256=65x3Mmm4bllUh35pA4bDP7XDlfgVmZ1L_OdXX29fhIs,7598
|
|
146
|
+
sunholo-0.86.0.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
|
|
147
|
+
sunholo-0.86.0.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
148
|
+
sunholo-0.86.0.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
149
|
+
sunholo-0.86.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|