sunholo 0.79.3__py3-none-any.whl → 0.79.5__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 +5 -3
- sunholo/chunker/splitter.py +4 -3
- sunholo/vertex/extensions_call.py +1 -1
- sunholo/vertex/memory_tools.py +9 -5
- {sunholo-0.79.3.dist-info → sunholo-0.79.5.dist-info}/METADATA +2 -2
- {sunholo-0.79.3.dist-info → sunholo-0.79.5.dist-info}/RECORD +10 -10
- {sunholo-0.79.3.dist-info → sunholo-0.79.5.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.79.3.dist-info → sunholo-0.79.5.dist-info}/WHEEL +0 -0
- {sunholo-0.79.3.dist-info → sunholo-0.79.5.dist-info}/entry_points.txt +0 -0
- {sunholo-0.79.3.dist-info → sunholo-0.79.5.dist-info}/top_level.txt +0 -0
sunholo/chunker/doc_handling.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from ..utils import load_config_key
|
|
1
|
+
from ..utils import load_config_key, ConfigManager
|
|
2
2
|
from ..custom_logging import log
|
|
3
3
|
from ..database.alloydb import add_document_if_not_exists
|
|
4
4
|
from ..database.uuid import generate_uuid_from_object_id
|
|
@@ -109,8 +109,10 @@ def summarise_docs(docs, vector_name, summary_threshold_default=10000, model_lim
|
|
|
109
109
|
|
|
110
110
|
if not docs:
|
|
111
111
|
return None
|
|
112
|
+
|
|
113
|
+
config = ConfigManager(vector_name)
|
|
112
114
|
|
|
113
|
-
chunker_config =
|
|
115
|
+
chunker_config = config.vacConfig("chunker")
|
|
114
116
|
summarise_chunking_config = chunker_config.get("summarise") if chunker_config else None
|
|
115
117
|
|
|
116
118
|
if not summarise_chunking_config:
|
|
@@ -122,7 +124,7 @@ def summarise_docs(docs, vector_name, summary_threshold_default=10000, model_lim
|
|
|
122
124
|
summary_threshold = summarise_chunking_config.get("threshold") if summarise_chunking_config.get("threshold") else summary_threshold_default
|
|
123
125
|
model_limit = summarise_chunking_config.get("model_limit") if summarise_chunking_config.get("model_limit") else model_limit_default
|
|
124
126
|
|
|
125
|
-
summary_llm = llm_str_to_llm(summary_llm_str, model=model)
|
|
127
|
+
summary_llm = llm_str_to_llm(summary_llm_str, model=model, config=config)
|
|
126
128
|
|
|
127
129
|
doc_summaries = {}
|
|
128
130
|
for doc in docs:
|
sunholo/chunker/splitter.py
CHANGED
|
@@ -113,8 +113,9 @@ def choose_splitter(extension: str, chunk_size: int=1024, chunk_overlap:int=200,
|
|
|
113
113
|
|
|
114
114
|
if vector_name:
|
|
115
115
|
# check if there is a chunking configuration
|
|
116
|
-
from ..utils import
|
|
117
|
-
|
|
116
|
+
from ..utils import ConfigManager
|
|
117
|
+
config = ConfigManager(vector_name)
|
|
118
|
+
chunk_config = config.vacConfig("chunker")
|
|
118
119
|
if chunk_config:
|
|
119
120
|
if chunk_config.get("type") == "semantic":
|
|
120
121
|
embedding_str = chunk_config.get("llm")
|
|
@@ -124,7 +125,7 @@ def choose_splitter(extension: str, chunk_size: int=1024, chunk_overlap:int=200,
|
|
|
124
125
|
log.info(f"Semantic chunking for {vector_name}")
|
|
125
126
|
from langchain_experimental.text_splitter import SemanticChunker
|
|
126
127
|
from ..components import pick_embedding
|
|
127
|
-
embeddings = pick_embedding(embedding_str)
|
|
128
|
+
embeddings = pick_embedding(embedding_str, config=config)
|
|
128
129
|
semantic_splitter = SemanticChunker(
|
|
129
130
|
embeddings, breakpoint_threshold_type="percentile"
|
|
130
131
|
)
|
|
@@ -10,7 +10,7 @@ def dynamic_extension_call(question, config:ConfigManager, project_id:str=None,
|
|
|
10
10
|
|
|
11
11
|
extensions = config.vacConfig('extensions')
|
|
12
12
|
if not extensions:
|
|
13
|
-
log.warning(f"No extensions founded for vac: {
|
|
13
|
+
log.warning(f"No extensions founded for vac: {config.vector_name}")
|
|
14
14
|
|
|
15
15
|
return None
|
|
16
16
|
|
sunholo/vertex/memory_tools.py
CHANGED
|
@@ -66,11 +66,15 @@ def get_vertex_memories(config:ConfigManager):
|
|
|
66
66
|
|
|
67
67
|
if rag_id:
|
|
68
68
|
log.info("Using rag_id for using vectorstore: llamaindex")
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
try:
|
|
70
|
+
corpus = fetch_corpus(
|
|
71
|
+
project_id=project_id or get_gcp_project(),
|
|
72
|
+
location=location or global_location,
|
|
73
|
+
rag_id=rag_id
|
|
74
|
+
)
|
|
75
|
+
except Exception as err:
|
|
76
|
+
log.error(f"Skipping - No rag found for {rag_id=} - {str(err)}")
|
|
77
|
+
continue
|
|
74
78
|
else:
|
|
75
79
|
log.info(f"Using display_name {config.vector_name} to derive rag_id")
|
|
76
80
|
manager = LlamaIndexVertexCorpusManager(project_id=project_id, location=location)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.79.
|
|
3
|
+
Version: 0.79.5
|
|
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.79.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.79.5.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=MVF9_-QdKUoJqlpEJ49pv2sdjMDxEiMNxzmO7w5nWDQ,3270
|
|
34
|
-
sunholo/chunker/doc_handling.py,sha256=
|
|
34
|
+
sunholo/chunker/doc_handling.py,sha256=UAf9BmUMpKCKRlAMl1qNZK6xDNYWk1z3ARoftWoa_54,8734
|
|
35
35
|
sunholo/chunker/encode_metadata.py,sha256=hxxd9KU35Xi0Z_EL8kt_oD66pKfBLhEjBImC16ew-Eo,1919
|
|
36
36
|
sunholo/chunker/images.py,sha256=id2PBu6XyGEOtgafq2v0c9_O6kxaC_pYFMnbsIitkSg,1868
|
|
37
37
|
sunholo/chunker/loaders.py,sha256=CCB0IGigNAWT__2ImVin_j83W3eGS2Qe5I6U18YQzoM,10275
|
|
@@ -40,7 +40,7 @@ sunholo/chunker/pdfs.py,sha256=njDPop751GMHi3cOwIKd2Yct-_lWR2gqcB7WykfHphs,2480
|
|
|
40
40
|
sunholo/chunker/process_chunker_data.py,sha256=OnMvXHRv3rGpFsU50FyUNkNIwC1D8TkhaWWbn72yQss,3523
|
|
41
41
|
sunholo/chunker/publish.py,sha256=AX5u-fcyDytED67IfizMzvOMcYPXEo6XBJvyk_7maK8,2939
|
|
42
42
|
sunholo/chunker/pubsub.py,sha256=48bhuAcszN7LGe3-ksPSLHHhq0uKxiXOrizck5qpcP0,1012
|
|
43
|
-
sunholo/chunker/splitter.py,sha256=
|
|
43
|
+
sunholo/chunker/splitter.py,sha256=QLAEsJOpEYFZr9-UGZUuAlNVyjfCWb8jvzCHg0rVShE,6751
|
|
44
44
|
sunholo/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
45
|
sunholo/cli/chat_vac.py,sha256=UNLzZYAejjEvMR0EjpxIHXyvUpBDoqThohzzFL_m3Yg,23026
|
|
46
46
|
sunholo/cli/cli.py,sha256=yuY7SLFiYDUKqJDOXy7jL1l6P0UVPMuAZK9bXXTG8ck,3939
|
|
@@ -125,16 +125,16 @@ sunholo/utils/timedelta.py,sha256=BbLabEx7_rbErj_YbNM0MBcaFN76DC4PTe4zD2ucezg,49
|
|
|
125
125
|
sunholo/utils/user_ids.py,sha256=SQd5_H7FE7vcTZp9AQuQDWBXd4FEEd7TeVMQe1H4Ny8,292
|
|
126
126
|
sunholo/utils/version.py,sha256=P1QAJQdZfT2cMqdTSmXmcxrD2PssMPEGM-WI6083Fck,237
|
|
127
127
|
sunholo/vertex/__init__.py,sha256=tMd7ysJ1uwBjfFSn8JL0uS3-s6h_X4GAUBz8AArZEF0,339
|
|
128
|
-
sunholo/vertex/extensions_call.py,sha256=
|
|
128
|
+
sunholo/vertex/extensions_call.py,sha256=QeQbL3aAHlc4_-SynOzooZ_3xkQWAlcgNmFBSwLNtN8,13816
|
|
129
129
|
sunholo/vertex/extensions_class.py,sha256=2QGW28lNjoMEnaoVb3QcqEDwphclIsZthnpLUi5_Ivo,21033
|
|
130
130
|
sunholo/vertex/genai_functions.py,sha256=2z6grM9H0Z79Yzx88l8mE1wXck3bRa0TWvnqZZ9ifDc,2051
|
|
131
131
|
sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
|
|
132
|
-
sunholo/vertex/memory_tools.py,sha256=
|
|
132
|
+
sunholo/vertex/memory_tools.py,sha256=pgSahVDh7GPEulu3nl-w0jb5lTClb4TCnVxPnMokNZY,7533
|
|
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.79.
|
|
136
|
-
sunholo-0.79.
|
|
137
|
-
sunholo-0.79.
|
|
138
|
-
sunholo-0.79.
|
|
139
|
-
sunholo-0.79.
|
|
140
|
-
sunholo-0.79.
|
|
135
|
+
sunholo-0.79.5.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
136
|
+
sunholo-0.79.5.dist-info/METADATA,sha256=B4e56x_LDOAPMTDXey40Sa4P0P9j69ZqL2pZUVjPaj8,7348
|
|
137
|
+
sunholo-0.79.5.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
138
|
+
sunholo-0.79.5.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
139
|
+
sunholo-0.79.5.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
140
|
+
sunholo-0.79.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|