sunholo 0.80.0__py3-none-any.whl → 0.80.2__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/agents/flask/qna_routes.py +1 -0
- sunholo/components/retriever.py +22 -13
- sunholo/utils/config_class.py +1 -1
- {sunholo-0.80.0.dist-info → sunholo-0.80.2.dist-info}/METADATA +2 -2
- {sunholo-0.80.0.dist-info → sunholo-0.80.2.dist-info}/RECORD +9 -9
- {sunholo-0.80.0.dist-info → sunholo-0.80.2.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.80.0.dist-info → sunholo-0.80.2.dist-info}/WHEEL +0 -0
- {sunholo-0.80.0.dist-info → sunholo-0.80.2.dist-info}/entry_points.txt +0 -0
- {sunholo-0.80.0.dist-info → sunholo-0.80.2.dist-info}/top_level.txt +0 -0
|
@@ -535,6 +535,7 @@ def prep_vac(request, vector_name):
|
|
|
535
535
|
chat_history = data.pop('chat_history', None)
|
|
536
536
|
vector_name = data.pop('vector_name', vector_name)
|
|
537
537
|
|
|
538
|
+
log.info("Turning chat_history into paired tuples")
|
|
538
539
|
paired_messages = extract_chat_history(chat_history)
|
|
539
540
|
|
|
540
541
|
all_input = {'user_input': user_input,
|
sunholo/components/retriever.py
CHANGED
|
@@ -57,6 +57,26 @@ def pick_retriever(vector_name:str=None, config:ConfigManager=None, embeddings=N
|
|
|
57
57
|
vectorstore = value.get('vectorstore')
|
|
58
58
|
if vectorstore:
|
|
59
59
|
log.info(f"Found vectorstore {vectorstore}")
|
|
60
|
+
|
|
61
|
+
if vectorstore == "vertex_ai_search" or vectorstore == "discovery_engine":
|
|
62
|
+
# use direct retriever
|
|
63
|
+
from langchain.retrievers import GoogleVertexAISearchRetriever
|
|
64
|
+
gcp_config = config.vacConfig('gcp_config')
|
|
65
|
+
try:
|
|
66
|
+
gcp_retriever = GoogleVertexAISearchRetriever(
|
|
67
|
+
data_store_id=None if value.get("search_engine_id") else vector_name,
|
|
68
|
+
max_documents=value.get('max_documents', 5),
|
|
69
|
+
project_id=gcp_config.get('project_id') or get_gcp_project(),
|
|
70
|
+
search_engine_id=value.get("search_engine_id"),
|
|
71
|
+
location_id=gcp_config.get("location", "global"),
|
|
72
|
+
engine_data_type=value.get("engine_data_type",0)
|
|
73
|
+
)
|
|
74
|
+
except Exception as err:
|
|
75
|
+
log.error(f"Could not init GoogleVertexAISearchRetriever - {str(err)}")
|
|
76
|
+
continue
|
|
77
|
+
|
|
78
|
+
retriever_list.append(gcp_retriever)
|
|
79
|
+
|
|
60
80
|
from_metadata_id = value.get('from_metadata_id')
|
|
61
81
|
if from_metadata_id:
|
|
62
82
|
# this entry needs to be fetched via metadata key
|
|
@@ -66,7 +86,7 @@ def pick_retriever(vector_name:str=None, config:ConfigManager=None, embeddings=N
|
|
|
66
86
|
embeddings = embeddings or get_embeddings(config=config)
|
|
67
87
|
read_only = value.get('read_only')
|
|
68
88
|
try:
|
|
69
|
-
|
|
89
|
+
vectorstore_obj = pick_vectorstore(
|
|
70
90
|
vectorstore,
|
|
71
91
|
config=config,
|
|
72
92
|
embeddings=embeddings,
|
|
@@ -76,23 +96,12 @@ def pick_retriever(vector_name:str=None, config:ConfigManager=None, embeddings=N
|
|
|
76
96
|
continue
|
|
77
97
|
|
|
78
98
|
k_override = value.get('k', 3)
|
|
79
|
-
if
|
|
99
|
+
if vectorstore_obj:
|
|
80
100
|
vs_retriever = vectorstore.as_retriever(search_kwargs=dict(k=k_override))
|
|
81
101
|
retriever_list.append(vs_retriever)
|
|
82
102
|
else:
|
|
83
103
|
log.warning(f"No vectorstore found despite being in config: {key=}")
|
|
84
104
|
|
|
85
|
-
if value.get('provider') == "GoogleCloudEnterpriseSearchRetriever":
|
|
86
|
-
log.info(f"Found GoogleCloudEnterpriseSearchRetriever {value['provider']}")
|
|
87
|
-
gcp_retriever = GoogleCloudEnterpriseSearchRetriever(
|
|
88
|
-
project_id=get_gcp_project(),
|
|
89
|
-
search_engine_id=value["db_id"],
|
|
90
|
-
location_id=value.get("location", "global"),
|
|
91
|
-
engine_data_type=1 if value.get("type","unstructured") == "structured" else 0,
|
|
92
|
-
query_expansion_condition=2
|
|
93
|
-
)
|
|
94
|
-
retriever_list.append(gcp_retriever)
|
|
95
|
-
|
|
96
105
|
#TODO: more memory stores here
|
|
97
106
|
|
|
98
107
|
if not retriever_list or len(retriever_list) == 0:
|
sunholo/utils/config_class.py
CHANGED
|
@@ -86,6 +86,7 @@ class ConfigManager:
|
|
|
86
86
|
continue
|
|
87
87
|
if filename.endswith(('.yaml', '.yml', '.json')):
|
|
88
88
|
config_file = os.path.join(folder, filename)
|
|
89
|
+
log.debug(f"Checking config file: {config_file}")
|
|
89
90
|
if filename in self.config_cache:
|
|
90
91
|
cached_config, cache_time = self.config_cache[filename]
|
|
91
92
|
time_to_recache = (current_time - cache_time)
|
|
@@ -159,7 +160,6 @@ class ConfigManager:
|
|
|
159
160
|
if isinstance(value, dict) and key in dict1 and isinstance(dict1[key], dict):
|
|
160
161
|
dict1[key] = self._merge_dicts(dict1[key], value)
|
|
161
162
|
else:
|
|
162
|
-
print(f"Merging '{key}' to new '{value}'")
|
|
163
163
|
dict1[key] = value
|
|
164
164
|
return dict1
|
|
165
165
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.80.
|
|
3
|
+
Version: 0.80.2
|
|
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.80.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.80.2.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -13,7 +13,7 @@ sunholo/agents/fastapi/base.py,sha256=W-cyF8ZDUH40rc-c-Apw3-_8IIi2e4Y9qRtnoVnsc1
|
|
|
13
13
|
sunholo/agents/fastapi/qna_routes.py,sha256=lKHkXPmwltu9EH3RMwmD153-J6pE7kWQ4BhBlV3to-s,3864
|
|
14
14
|
sunholo/agents/flask/__init__.py,sha256=uqfHNw2Ru3EJ4dJEcbp86h_lkquBQPMxZbjhV_xe3rs,72
|
|
15
15
|
sunholo/agents/flask/base.py,sha256=FgSaCODyoTtlstJtsqlLPScdgRUtv9_plxftdzHdVFo,809
|
|
16
|
-
sunholo/agents/flask/qna_routes.py,sha256=
|
|
16
|
+
sunholo/agents/flask/qna_routes.py,sha256=pSXAipANqoE4wgDv4YD2_Sd7GvpGmFcj4Quslf4FKTM,22057
|
|
17
17
|
sunholo/agents/flask/vac_routes.py,sha256=JHBrz9URmRzxoNAiqEeI-5qWyKfVSZ1Ix__1t19p6HI,19527
|
|
18
18
|
sunholo/archive/__init__.py,sha256=qNHWm5rGPVOlxZBZCpA1wTYPbalizRT7f8X4rs2t290,31
|
|
19
19
|
sunholo/archive/archive.py,sha256=PxVfDtO2_2ZEEbnhXSCbXLdeoHoQVImo4y3Jr2XkCFY,1204
|
|
@@ -55,7 +55,7 @@ sunholo/cli/swagger.py,sha256=absYKAU-7Yd2eiVNUY-g_WLl2zJfeRUNdWQ0oH8M_HM,1564
|
|
|
55
55
|
sunholo/cli/vertex.py,sha256=8130YCarxHL1UC3aqblNmUwGZTXbkdL4Y_FOnZJsWiI,2056
|
|
56
56
|
sunholo/components/__init__.py,sha256=IDoylb74zFKo6NIS3RQqUl0PDFBGVxM1dfUmO7OJ44U,176
|
|
57
57
|
sunholo/components/llm.py,sha256=5wRVf7lIb7q1vRADNcdQp26L9l4vGHFIvjtUDurZN_s,11488
|
|
58
|
-
sunholo/components/retriever.py,sha256=
|
|
58
|
+
sunholo/components/retriever.py,sha256=G89Gfctsxr_Y2igFTUtPVcluUoZ6L7UXA5yO0207sV8,7377
|
|
59
59
|
sunholo/components/vectorstore.py,sha256=xKk7micTRwZckaI7U6PxvFz_ZSjCH48xPTDYiDcv2tc,5913
|
|
60
60
|
sunholo/database/__init__.py,sha256=Zz0Shcq-CtStf9rJGIYB_Ybzb8rY_Q9mfSj-nviM490,241
|
|
61
61
|
sunholo/database/alloydb.py,sha256=c1PEmK9fJCxYaVmKv4emvOoXrajV7KqaVK5mqpeksvM,11527
|
|
@@ -117,7 +117,7 @@ sunholo/utils/__init__.py,sha256=Hv02T5L2zYWvCso5hzzwm8FQogwBq0OgtUbN_7Quzqc,89
|
|
|
117
117
|
sunholo/utils/api_key.py,sha256=Ct4bIAQZxzPEw14hP586LpVxBAVi_W9Serpy0BK-7KI,244
|
|
118
118
|
sunholo/utils/big_context.py,sha256=gJIP7_ZL-YSLhOMq8jmFTMqH1wq8eB1NK7oKPeZAq2s,5578
|
|
119
119
|
sunholo/utils/config.py,sha256=aG29MXcL5qzQMtCMqcdy-2ysDCYf9Zn_ZLk5NNOQNSE,8982
|
|
120
|
-
sunholo/utils/config_class.py,sha256=
|
|
120
|
+
sunholo/utils/config_class.py,sha256=AbjTTgelMiaTPpTSBlbl6CC5wggcVE8ZFr4LJQ4t8Mg,9029
|
|
121
121
|
sunholo/utils/config_schema.py,sha256=Wv-ncitzljOhgbDaq9qnFqH5LCuxNv59dTGDWgd1qdk,4189
|
|
122
122
|
sunholo/utils/gcp.py,sha256=uueODEpA-P6O15-t0hmcGC9dONLO_hLfzSsSoQnkUss,4854
|
|
123
123
|
sunholo/utils/gcp_project.py,sha256=0ozs6tzI4qEvEeXb8MxLnCdEVoWKxlM6OH05htj7_tc,1325
|
|
@@ -133,9 +133,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
|
|
|
133
133
|
sunholo/vertex/memory_tools.py,sha256=pgSahVDh7GPEulu3nl-w0jb5lTClb4TCnVxPnMokNZY,7533
|
|
134
134
|
sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
|
|
135
135
|
sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
|
|
136
|
-
sunholo-0.80.
|
|
137
|
-
sunholo-0.80.
|
|
138
|
-
sunholo-0.80.
|
|
139
|
-
sunholo-0.80.
|
|
140
|
-
sunholo-0.80.
|
|
141
|
-
sunholo-0.80.
|
|
136
|
+
sunholo-0.80.2.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
137
|
+
sunholo-0.80.2.dist-info/METADATA,sha256=uNKoHN6qsuLMg_784oOLPV1AJamXOqOifURetX-YDdo,7348
|
|
138
|
+
sunholo-0.80.2.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
139
|
+
sunholo-0.80.2.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
140
|
+
sunholo-0.80.2.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
141
|
+
sunholo-0.80.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|