sunholo 0.80.3__py3-none-any.whl → 0.80.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/components/retriever.py +5 -1
- sunholo/discovery_engine/chunker_handler.py +25 -7
- sunholo/gcs/add_file.py +3 -2
- {sunholo-0.80.3.dist-info → sunholo-0.80.5.dist-info}/METADATA +2 -2
- {sunholo-0.80.3.dist-info → sunholo-0.80.5.dist-info}/RECORD +9 -9
- {sunholo-0.80.3.dist-info → sunholo-0.80.5.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.80.3.dist-info → sunholo-0.80.5.dist-info}/WHEEL +0 -0
- {sunholo-0.80.3.dist-info → sunholo-0.80.5.dist-info}/entry_points.txt +0 -0
- {sunholo-0.80.3.dist-info → sunholo-0.80.5.dist-info}/top_level.txt +0 -0
sunholo/components/retriever.py
CHANGED
|
@@ -60,11 +60,14 @@ def pick_retriever(vector_name:str=None, config:ConfigManager=None, embeddings=N
|
|
|
60
60
|
|
|
61
61
|
if vectorstore == "vertex_ai_search" or vectorstore == "discovery_engine":
|
|
62
62
|
# use direct retriever
|
|
63
|
+
if value.get('chunks'):
|
|
64
|
+
log.warning(f"{config.vector_name} will not be using GoogleVertexAISearchRetriever with chunks vertex AI search as not supported yet")
|
|
65
|
+
continue
|
|
63
66
|
from langchain.retrievers import GoogleVertexAISearchRetriever
|
|
64
67
|
gcp_config = config.vacConfig('gcp_config')
|
|
65
68
|
try:
|
|
66
69
|
gcp_retriever = GoogleVertexAISearchRetriever(
|
|
67
|
-
data_store_id=None if value.get("search_engine_id") else vector_name,
|
|
70
|
+
data_store_id=None if value.get("search_engine_id") else config.vector_name,
|
|
68
71
|
max_documents=value.get('max_documents', 5),
|
|
69
72
|
project_id=gcp_config.get('project_id') or get_gcp_project(),
|
|
70
73
|
search_engine_id=value.get("search_engine_id"),
|
|
@@ -76,6 +79,7 @@ def pick_retriever(vector_name:str=None, config:ConfigManager=None, embeddings=N
|
|
|
76
79
|
continue
|
|
77
80
|
|
|
78
81
|
retriever_list.append(gcp_retriever)
|
|
82
|
+
continue
|
|
79
83
|
|
|
80
84
|
from_metadata_id = value.get('from_metadata_id')
|
|
81
85
|
if from_metadata_id:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from ..custom_logging import log
|
|
2
|
-
from ..utils
|
|
2
|
+
from ..utils import load_config_key, ConfigManager
|
|
3
3
|
from ..utils.gcp_project import get_gcp_project
|
|
4
4
|
from ..components import load_memories
|
|
5
5
|
|
|
@@ -86,8 +86,9 @@ def do_discovery_engine(message_data, metadata, vector_name):
|
|
|
86
86
|
log.warning("Only gs:// data is supported for Discovery Engine")
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
def check_discovery_engine_in_memory(
|
|
90
|
-
memories =
|
|
89
|
+
def check_discovery_engine_in_memory(config:ConfigManager):
|
|
90
|
+
memories = config.vacConfig("memory")
|
|
91
|
+
|
|
91
92
|
for memory in memories: # Iterate over the list
|
|
92
93
|
for key, value in memory.items(): # Now iterate over the dictionary
|
|
93
94
|
log.info(f"Found memory {key}")
|
|
@@ -99,15 +100,32 @@ def check_discovery_engine_in_memory(vector_name):
|
|
|
99
100
|
|
|
100
101
|
return False
|
|
101
102
|
|
|
102
|
-
def
|
|
103
|
+
def check_write_memories(config:ConfigManager):
|
|
104
|
+
write_mem = []
|
|
105
|
+
memories = config.vacConfig("memory")
|
|
106
|
+
for memory in memories:
|
|
107
|
+
for key, value in memory.items():
|
|
108
|
+
if value.get('read_only'):
|
|
109
|
+
continue
|
|
110
|
+
write_mem.append(memory)
|
|
111
|
+
|
|
112
|
+
return write_mem
|
|
113
|
+
|
|
114
|
+
def discovery_engine_chunker_check(message_data, metadata, vector_name:str=None, config:ConfigManager=None):
|
|
115
|
+
|
|
116
|
+
if config is None:
|
|
117
|
+
if vector_name is None:
|
|
118
|
+
raise ValueError("Must provide config or vector_name")
|
|
119
|
+
config = ConfigManager(vector_name=vector_name)
|
|
120
|
+
|
|
103
121
|
# discovery engine handles its own chunking/embedding
|
|
104
|
-
memories =
|
|
122
|
+
memories = config.vacConfig("memory")
|
|
105
123
|
if not memories:
|
|
106
124
|
return None
|
|
107
125
|
|
|
108
|
-
total_memories = len(
|
|
126
|
+
total_memories = len(check_write_memories(config))
|
|
109
127
|
llama = None
|
|
110
|
-
if check_discovery_engine_in_memory(
|
|
128
|
+
if check_discovery_engine_in_memory(config):
|
|
111
129
|
llama = do_discovery_engine(message_data, metadata, vector_name)
|
|
112
130
|
log.info(f"Processed discovery engine: {llama}")
|
|
113
131
|
|
sunholo/gcs/add_file.py
CHANGED
|
@@ -118,12 +118,13 @@ def add_file_to_gcs(filename: str,
|
|
|
118
118
|
if os.getenv('EXTENSIONS_BUCKET'):
|
|
119
119
|
bucket_filepath = os.path.basename(filename)
|
|
120
120
|
|
|
121
|
-
if vector_name
|
|
122
|
-
|
|
121
|
+
if not vector_name:
|
|
122
|
+
vector_name = "global"
|
|
123
123
|
|
|
124
124
|
if not bucket_filepath:
|
|
125
125
|
|
|
126
126
|
bucket_filepath = f"{vector_name}/{year}/{month}/{day}/{hour}/{os.path.basename(filename)}"
|
|
127
|
+
|
|
127
128
|
bucket_filepath_prev = f"{vector_name}/{year}/{month}/{day}/{hour_prev}/{os.path.basename(filename)}"
|
|
128
129
|
|
|
129
130
|
blob = bucket.blob(bucket_filepath)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.80.
|
|
3
|
+
Version: 0.80.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.80.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.80.5.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -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=hKF3Az6DfDwUaKLkSTuzGg_5THS_lv7C51tfnzhb960,7653
|
|
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
|
|
@@ -71,13 +71,13 @@ sunholo/database/sql/sb/delete_source_row.sql,sha256=r6fEuUKdbiLHCDGKSbKINDCpJjs
|
|
|
71
71
|
sunholo/database/sql/sb/return_sources.sql,sha256=89KAnxfK8n_qGK9jy1OQT8f9n4uYUtYL5cCxbC2mj_c,255
|
|
72
72
|
sunholo/database/sql/sb/setup.sql,sha256=CvoFvZQev2uWjmFa3aj3m3iuPFzAAJZ0S7Qi3L3-zZI,89
|
|
73
73
|
sunholo/discovery_engine/__init__.py,sha256=qUKWzuHApDRJIUoynukVdGRBEq8eC9T7l9a3bWckgI0,59
|
|
74
|
-
sunholo/discovery_engine/chunker_handler.py,sha256=
|
|
74
|
+
sunholo/discovery_engine/chunker_handler.py,sha256=NgLCnnJ3mcrvy4BPNxmBxJX4BOYXNdLKf2YxC5TwX0o,5088
|
|
75
75
|
sunholo/discovery_engine/create_new.py,sha256=7oZG78T6lW0EspRzlo7-qRyXFSuFxDn2dfSAVEaqlqY,978
|
|
76
76
|
sunholo/discovery_engine/discovery_engine_client.py,sha256=oORB2SVVqrYrz7E3srPrknyuR6Dl3SJJwaVrbVXJER4,17726
|
|
77
77
|
sunholo/embedder/__init__.py,sha256=sI4N_CqgEVcrMDxXgxKp1FsfsB4FpjoXgPGkl4N_u4I,44
|
|
78
78
|
sunholo/embedder/embed_chunk.py,sha256=MCbTePWjUbIRVDFFhHJ94BvOZvIom62-mTr0PmfQyt0,6951
|
|
79
79
|
sunholo/gcs/__init__.py,sha256=SZvbsMFDko40sIRHTHppA37IijvJTae54vrhooEF5-4,90
|
|
80
|
-
sunholo/gcs/add_file.py,sha256=
|
|
80
|
+
sunholo/gcs/add_file.py,sha256=0GruAKsvVO9qVddwJ1ugr4ldpk_QKXmhKKVio2QwuPE,7124
|
|
81
81
|
sunholo/gcs/download_folder.py,sha256=ijJTnS595JqZhBH8iHFErQilMbkuKgL-bnTCMLGuvlA,1614
|
|
82
82
|
sunholo/gcs/download_url.py,sha256=i_LKd3fJQNDqpUzDgSSehWVSzOPA-HPM7o0Tf8nLrM4,5235
|
|
83
83
|
sunholo/gcs/metadata.py,sha256=oQLcXi4brsZ74aegWyC1JZmhlaEV270HS5_UWtAYYWE,898
|
|
@@ -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.5.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
137
|
+
sunholo-0.80.5.dist-info/METADATA,sha256=VkZcaejfXjHhZxi3Lkhwb0_MuScBe27ZfS6sgvEVm-Q,7348
|
|
138
|
+
sunholo-0.80.5.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
139
|
+
sunholo-0.80.5.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
140
|
+
sunholo-0.80.5.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
141
|
+
sunholo-0.80.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|