sunholo 0.78.5__py3-none-any.whl → 0.79.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/chunker/doc_handling.py +4 -0
- sunholo/database/alloydb.py +40 -7
- sunholo/utils/config_class.py +5 -1
- {sunholo-0.78.5.dist-info → sunholo-0.79.0.dist-info}/METADATA +2 -2
- {sunholo-0.78.5.dist-info → sunholo-0.79.0.dist-info}/RECORD +9 -9
- {sunholo-0.78.5.dist-info → sunholo-0.79.0.dist-info}/WHEEL +1 -1
- {sunholo-0.78.5.dist-info → sunholo-0.79.0.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.78.5.dist-info → sunholo-0.79.0.dist-info}/entry_points.txt +0 -0
- {sunholo-0.78.5.dist-info → sunholo-0.79.0.dist-info}/top_level.txt +0 -0
sunholo/chunker/doc_handling.py
CHANGED
|
@@ -175,6 +175,10 @@ Be careful not to add any speculation or any details that are not covered in the
|
|
|
175
175
|
bucket_name = os.getenv("DOC_BUCKET")
|
|
176
176
|
if not bucket_name:
|
|
177
177
|
raise ValueError("No DOC_BUCKET configured for summary")
|
|
178
|
+
|
|
179
|
+
if bucket_name.startswith("gs://"):
|
|
180
|
+
bucket_name = bucket_name[len("gs://"):]
|
|
181
|
+
|
|
178
182
|
with tempfile.NamedTemporaryFile(mode='w+', delete=False) as temp_file:
|
|
179
183
|
temp_file.write(summary)
|
|
180
184
|
temp_file.flush()
|
sunholo/database/alloydb.py
CHANGED
|
@@ -232,7 +232,7 @@ async def load_alloydb_sql_async(sql, vector_name):
|
|
|
232
232
|
return documents
|
|
233
233
|
|
|
234
234
|
def and_or_ilike(sources, search_type="OR", operator="ILIKE"):
|
|
235
|
-
unique_sources = set(sources)
|
|
235
|
+
unique_sources = set(sources.split())
|
|
236
236
|
# Choose the delimiter based on the search_type argument
|
|
237
237
|
delimiter = ' AND ' if search_type.upper() == "AND" else ' OR '
|
|
238
238
|
|
|
@@ -240,14 +240,14 @@ def and_or_ilike(sources, search_type="OR", operator="ILIKE"):
|
|
|
240
240
|
conditions = delimiter.join(f"TRIM(source) {operator} '%{source}%'" for source in unique_sources)
|
|
241
241
|
if not conditions:
|
|
242
242
|
log.warning("Alloydb doc query found no like_patterns")
|
|
243
|
-
return
|
|
243
|
+
return ""
|
|
244
244
|
|
|
245
245
|
return conditions
|
|
246
246
|
|
|
247
247
|
def _get_sources_from_docstore(sources, vector_name, search_type="OR"):
|
|
248
248
|
if not sources:
|
|
249
249
|
log.warning("No sources found for alloydb fetch")
|
|
250
|
-
return
|
|
250
|
+
return ""
|
|
251
251
|
|
|
252
252
|
table_name = f"{vector_name}_docstore"
|
|
253
253
|
|
|
@@ -263,10 +263,37 @@ def _get_sources_from_docstore(sources, vector_name, search_type="OR"):
|
|
|
263
263
|
|
|
264
264
|
return query
|
|
265
265
|
|
|
266
|
+
def _list_sources_from_docstore(sources, vector_name, search_type="OR"):
|
|
267
|
+
table_name = f"{vector_name}_docstore"
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
if sources:
|
|
271
|
+
conditions = and_or_ilike(sources, search_type=search_type)
|
|
272
|
+
query = f"""
|
|
273
|
+
SELECT DISTINCT langchain_metadata->>'objectId' AS objectId
|
|
274
|
+
FROM {table_name}
|
|
275
|
+
WHERE {conditions}
|
|
276
|
+
ORDER BY langchain_metadata->>'objectId' ASC
|
|
277
|
+
LIMIT 500;
|
|
278
|
+
"""
|
|
279
|
+
else:
|
|
280
|
+
query = f"""
|
|
281
|
+
SELECT DISTINCT langchain_metadata->>'objectId' AS objectId
|
|
282
|
+
FROM {table_name}
|
|
283
|
+
ORDER BY langchain_metadata->>'objectId' ASC
|
|
284
|
+
LIMIT 500;
|
|
285
|
+
"""
|
|
286
|
+
|
|
287
|
+
return query
|
|
266
288
|
|
|
267
|
-
|
|
289
|
+
|
|
290
|
+
async def get_sources_from_docstore_async(sources, vector_name, search_type="OR", just_source_name=False):
|
|
268
291
|
|
|
269
|
-
|
|
292
|
+
if just_source_name:
|
|
293
|
+
query = _list_sources_from_docstore(sources, vector_name=vector_name, search_type=search_type)
|
|
294
|
+
else:
|
|
295
|
+
query = _get_sources_from_docstore(sources, vector_name=vector_name, search_type=search_type)
|
|
296
|
+
|
|
270
297
|
if not query:
|
|
271
298
|
return []
|
|
272
299
|
|
|
@@ -274,9 +301,13 @@ async def get_sources_from_docstore_async(sources, vector_name, search_type="OR"
|
|
|
274
301
|
|
|
275
302
|
return documents
|
|
276
303
|
|
|
277
|
-
def get_sources_from_docstore(sources, vector_name, search_type="OR"):
|
|
304
|
+
def get_sources_from_docstore(sources, vector_name, search_type="OR", just_source_name=False):
|
|
278
305
|
|
|
279
|
-
|
|
306
|
+
if just_source_name:
|
|
307
|
+
query = _list_sources_from_docstore(sources, vector_name=vector_name, search_type=search_type)
|
|
308
|
+
else:
|
|
309
|
+
query = _get_sources_from_docstore(sources, vector_name=vector_name, search_type=search_type)
|
|
310
|
+
|
|
280
311
|
if not query:
|
|
281
312
|
return []
|
|
282
313
|
|
|
@@ -303,3 +334,5 @@ def delete_sources_from_alloydb(sources, vector_name):
|
|
|
303
334
|
DELETE FROM {vector_name}_vectorstore_{vector_length}
|
|
304
335
|
WHERE {conditions}
|
|
305
336
|
"""
|
|
337
|
+
|
|
338
|
+
return query
|
sunholo/utils/config_class.py
CHANGED
|
@@ -37,6 +37,10 @@ class ConfigManager:
|
|
|
37
37
|
self.local_config_folder = local_config_folder
|
|
38
38
|
self.configs_by_kind = self.load_all_configs()
|
|
39
39
|
|
|
40
|
+
test_agent = self.vacConfig("agent")
|
|
41
|
+
if not test_agent:
|
|
42
|
+
print(f"WARNING: No vacConfig.agent found for {self.vector_name} - are you in right folder? {local_config_folder=} {self.config_folder=}")
|
|
43
|
+
|
|
40
44
|
def load_all_configs(self):
|
|
41
45
|
"""
|
|
42
46
|
Load all configuration files from the specified directories into a dictionary.
|
|
@@ -121,7 +125,7 @@ class ConfigManager:
|
|
|
121
125
|
self.config_cache[filename] = (config, datetime.now())
|
|
122
126
|
log.debug(f"Loaded and cached {config_file}")
|
|
123
127
|
if is_local:
|
|
124
|
-
log.warning(f"Local configuration override for {filename}")
|
|
128
|
+
log.warning(f"Local configuration override for {filename} via {self.local_config_folder}")
|
|
125
129
|
return config
|
|
126
130
|
|
|
127
131
|
def _check_and_reload_configs(self):
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.79.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.79.0.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -31,7 +31,7 @@ sunholo/bots/github_webhook.py,sha256=5pQPRLM_wxxcILVaIzUDV8Kt7Arcm2dL1r1kMMHA52
|
|
|
31
31
|
sunholo/bots/webapp.py,sha256=EIMxdAJ_xtufwJmvnn7N_Fb_1hZ9DjhJ0Kf_hp02vEU,1926
|
|
32
32
|
sunholo/chunker/__init__.py,sha256=A5canS0XPgisHu0OZ7sVdILgEHGzgH9kpkDi4oBwLZk,135
|
|
33
33
|
sunholo/chunker/azure.py,sha256=iZ0mXjei0cILsLuSUnZK0mmUUsQNiC3ZQr1iX8q5IeY,3263
|
|
34
|
-
sunholo/chunker/doc_handling.py,sha256=
|
|
34
|
+
sunholo/chunker/doc_handling.py,sha256=AV-HU4FePKsk1mPASc3XOhJrqwdxnvEKc0GSpPTswMA,8714
|
|
35
35
|
sunholo/chunker/encode_metadata.py,sha256=SYHaqKcr4lCzwmrzUGhgX4_l4pzDv7wAeNCw7a461MA,1912
|
|
36
36
|
sunholo/chunker/images.py,sha256=Xmh1vwHrVhoXm5iH2dhCc52O8YgdzE8KrDSdL-pGnp8,1861
|
|
37
37
|
sunholo/chunker/loaders.py,sha256=xiToUVgPz2ZzcqpUAq7aNP3PTenb_rBUAFzu0JPycIg,10268
|
|
@@ -58,7 +58,7 @@ sunholo/components/llm.py,sha256=XhSFuvthK35LDirX-zUbeLrLU8ccLSGxdJOOQovBGEM,114
|
|
|
58
58
|
sunholo/components/retriever.py,sha256=F-wgZMpGJ8mGxJMAHA7HNgDwEhnvq1Pd6EGnTuBFlY8,6719
|
|
59
59
|
sunholo/components/vectorstore.py,sha256=zUJ90L1S4IyxLB0JUWopeuwVjcsSqdhj1QreEfsJhsE,5548
|
|
60
60
|
sunholo/database/__init__.py,sha256=Zz0Shcq-CtStf9rJGIYB_Ybzb8rY_Q9mfSj-nviM490,241
|
|
61
|
-
sunholo/database/alloydb.py,sha256=
|
|
61
|
+
sunholo/database/alloydb.py,sha256=ZZGDA6DBSoWouDFi69LvTT1DgiiBz3aSR6u1hFO-IZY,11520
|
|
62
62
|
sunholo/database/alloydb_client.py,sha256=AYA0SSaBy-1XEfeZI97sMGehfrwnfbwZ8sE0exzI2E0,7254
|
|
63
63
|
sunholo/database/database.py,sha256=UDHkceiEvJmS3esQX2LYEjEMrHcogN_JHuJXoVWCH3M,7354
|
|
64
64
|
sunholo/database/lancedb.py,sha256=2rAbJVusMrm5TPtVTsUtmwn0z1iZ_wvbKhc6eyT6ClE,708
|
|
@@ -116,7 +116,7 @@ sunholo/utils/__init__.py,sha256=Hv02T5L2zYWvCso5hzzwm8FQogwBq0OgtUbN_7Quzqc,89
|
|
|
116
116
|
sunholo/utils/api_key.py,sha256=Ct4bIAQZxzPEw14hP586LpVxBAVi_W9Serpy0BK-7KI,244
|
|
117
117
|
sunholo/utils/big_context.py,sha256=gJIP7_ZL-YSLhOMq8jmFTMqH1wq8eB1NK7oKPeZAq2s,5578
|
|
118
118
|
sunholo/utils/config.py,sha256=XOH2pIvHs6QLnCwVAn7RuyRyV10TfbCEXabSjuEhKdo,8947
|
|
119
|
-
sunholo/utils/config_class.py,sha256=
|
|
119
|
+
sunholo/utils/config_class.py,sha256=GP58SfYYn32dSTUnyixKGujgF2DZRctc23ZhFRvDTZ8,8808
|
|
120
120
|
sunholo/utils/config_schema.py,sha256=Wv-ncitzljOhgbDaq9qnFqH5LCuxNv59dTGDWgd1qdk,4189
|
|
121
121
|
sunholo/utils/gcp.py,sha256=uueODEpA-P6O15-t0hmcGC9dONLO_hLfzSsSoQnkUss,4854
|
|
122
122
|
sunholo/utils/gcp_project.py,sha256=0ozs6tzI4qEvEeXb8MxLnCdEVoWKxlM6OH05htj7_tc,1325
|
|
@@ -132,9 +132,9 @@ sunholo/vertex/init.py,sha256=uyg76EqS39jWJ2gxMqXOLWP6MQ2hc81wFdwgG86ZoCM,2868
|
|
|
132
132
|
sunholo/vertex/memory_tools.py,sha256=pomHrDKqvY8MZxfUqoEwhdlpCvSGP6KmFJMVKOimXjs,6842
|
|
133
133
|
sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
|
|
134
134
|
sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
|
|
135
|
-
sunholo-0.
|
|
136
|
-
sunholo-0.
|
|
137
|
-
sunholo-0.
|
|
138
|
-
sunholo-0.
|
|
139
|
-
sunholo-0.
|
|
140
|
-
sunholo-0.
|
|
135
|
+
sunholo-0.79.0.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
136
|
+
sunholo-0.79.0.dist-info/METADATA,sha256=-sMhBNEnku2Fz06P5Ihk8N6KP-VlQ37zCidev8zEMjU,7348
|
|
137
|
+
sunholo-0.79.0.dist-info/WHEEL,sha256=Rp8gFpivVLXx-k3U95ozHnQw8yDcPxmhOpn_Gx8d5nc,91
|
|
138
|
+
sunholo-0.79.0.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
139
|
+
sunholo-0.79.0.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
140
|
+
sunholo-0.79.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|