sunholo 0.66.1__py3-none-any.whl → 0.66.3__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/llamaindex/import_files.py +43 -12
- {sunholo-0.66.1.dist-info → sunholo-0.66.3.dist-info}/METADATA +2 -2
- {sunholo-0.66.1.dist-info → sunholo-0.66.3.dist-info}/RECORD +7 -7
- {sunholo-0.66.1.dist-info → sunholo-0.66.3.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.66.1.dist-info → sunholo-0.66.3.dist-info}/WHEEL +0 -0
- {sunholo-0.66.1.dist-info → sunholo-0.66.3.dist-info}/entry_points.txt +0 -0
- {sunholo-0.66.1.dist-info → sunholo-0.66.3.dist-info}/top_level.txt +0 -0
|
@@ -7,6 +7,7 @@ from ..logging import log
|
|
|
7
7
|
from ..utils.config import load_config_key
|
|
8
8
|
from ..vertex import init_vertex
|
|
9
9
|
from .get_files import fetch_corpus
|
|
10
|
+
from ..components import load_memories
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
def do_llamaindex(message_data, metadata, vector_name):
|
|
@@ -45,30 +46,60 @@ def do_llamaindex(message_data, metadata, vector_name):
|
|
|
45
46
|
raise ValueError(f"Need config.{vector_name}.gcp_config to configure llamaindex on VertexAI")
|
|
46
47
|
|
|
47
48
|
init_vertex(gcp_config)
|
|
48
|
-
corpus = fetch_corpus(gcp_config)
|
|
49
|
-
#display_name = load_config_key("display_name", vector_name=vector_name, filename="config/llm_config.yaml")
|
|
50
|
-
#description = load_config_key("description", vector_name=vector_name, filename="config/llm_config.yaml")
|
|
51
49
|
|
|
50
|
+
global_project_id = gcp_config.get('project_id')
|
|
51
|
+
global_location = gcp_config.get('location')
|
|
52
|
+
global_rag_id = gcp_config.get('rag_id')
|
|
53
|
+
#global_data_store_id = gcp_config.get('data_store_id')
|
|
54
|
+
|
|
55
|
+
memories = load_memories(vector_name)
|
|
56
|
+
tools = []
|
|
57
|
+
|
|
58
|
+
if not memories:
|
|
59
|
+
return tools
|
|
60
|
+
|
|
61
|
+
corpuses = []
|
|
62
|
+
for memory in memories:
|
|
63
|
+
for key, value in memory.items(): # Now iterate over the dictionary
|
|
64
|
+
log.info(f"Found memory {key}")
|
|
65
|
+
vectorstore = value.get('vectorstore')
|
|
66
|
+
if vectorstore == "llamaindex":
|
|
67
|
+
log.info(f"Found vectorstore {vectorstore}")
|
|
68
|
+
rag_id = value.get('rag_id')
|
|
69
|
+
project_id = gcp_config.get('project_id')
|
|
70
|
+
location = gcp_config.get('location')
|
|
71
|
+
corpus = fetch_corpus(
|
|
72
|
+
project_id=project_id or global_project_id,
|
|
73
|
+
location=location or global_location,
|
|
74
|
+
rag_id=rag_id or global_rag_id
|
|
75
|
+
)
|
|
76
|
+
corpuses.append(corpus)
|
|
77
|
+
if not corpuses:
|
|
78
|
+
log.error("Could not find a RAG corpus to import data to")
|
|
79
|
+
return None
|
|
80
|
+
|
|
52
81
|
try:
|
|
53
82
|
corpura = rag.list_corpora()
|
|
54
|
-
log.info(f"Corpora: {corpura} - {type(corpura)}")
|
|
83
|
+
log.info(f"All Corpora: {corpura} - {type(corpura)}")
|
|
55
84
|
except Exception as err:
|
|
56
85
|
log.warning(f"Could not list any corpora - {str(err)}")
|
|
57
86
|
|
|
58
|
-
log.info(f"Found llamaindex corpus: {
|
|
87
|
+
log.info(f"Found llamaindex corpus: {corpuses}")
|
|
59
88
|
|
|
60
89
|
# native support for cloud storage and drive links
|
|
61
90
|
chunker_config = load_config_key("chunker", vector_name=vector_name, kind="vacConfig")
|
|
62
91
|
|
|
92
|
+
|
|
63
93
|
if message_data.startswith("gs://") or message_data.startswith("https://drive.google.com"):
|
|
64
94
|
log.info(f"rag.import_files for {message_data}")
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
95
|
+
for corp in corpuses:
|
|
96
|
+
response = rag.import_files(
|
|
97
|
+
corpus_name=corp.name,
|
|
98
|
+
paths=[message_data],
|
|
99
|
+
chunk_size=chunker_config.get("chunk_size"), # Optional
|
|
100
|
+
chunk_overlap=chunker_config.get("overlap"), # Optional
|
|
101
|
+
)
|
|
102
|
+
log.info(f"Imported file to corpus: {response} with metadata: {metadata}")
|
|
72
103
|
|
|
73
104
|
metadata["source"] = message_data
|
|
74
105
|
return metadata
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.66.
|
|
3
|
+
Version: 0.66.3
|
|
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.66.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.66.3.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -70,7 +70,7 @@ sunholo/langfuse/prompts.py,sha256=HO4Zy9usn5tKooBPCKksuw4Lff3c03Ny5wqn4ce_xZM,1
|
|
|
70
70
|
sunholo/llamaindex/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
71
|
sunholo/llamaindex/generate.py,sha256=l1Picr-hVwkmAUD7XmTCa63qY9ERliFHQXwyX3BqB2Q,686
|
|
72
72
|
sunholo/llamaindex/get_files.py,sha256=6rhXCDqQ_lrIapISQ_OYQDjiSATXvS_9m3qq53-oIl0,781
|
|
73
|
-
sunholo/llamaindex/import_files.py,sha256=
|
|
73
|
+
sunholo/llamaindex/import_files.py,sha256=9z5A_zKkcwPaAtYD6thkFPtiKPWNB7VVV6EqZLHUbgY,6371
|
|
74
74
|
sunholo/lookup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
75
75
|
sunholo/lookup/model_lookup.yaml,sha256=O7o-jP53MLA06C8pI-ILwERShO-xf6z_258wtpZBv6A,739
|
|
76
76
|
sunholo/patches/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -104,9 +104,9 @@ sunholo/vertex/__init__.py,sha256=JvHcGFuv6R_nAhY2AdoqqhMpJ5ugeWPZ_svGhWrObBk,13
|
|
|
104
104
|
sunholo/vertex/init.py,sha256=JDMUaBRdednzbKF-5p33qqLit2LMsvgvWW-NRz0AqO0,1801
|
|
105
105
|
sunholo/vertex/memory_tools.py,sha256=8F1iTWnqEK9mX4W5RzCVKIjydIcNp6OFxjn_dtQ3GXo,5379
|
|
106
106
|
sunholo/vertex/safety.py,sha256=3meAX0HyGZYrH7rXPUAHxtI_3w_zoy_RX7Shtkoa660,1275
|
|
107
|
-
sunholo-0.66.
|
|
108
|
-
sunholo-0.66.
|
|
109
|
-
sunholo-0.66.
|
|
110
|
-
sunholo-0.66.
|
|
111
|
-
sunholo-0.66.
|
|
112
|
-
sunholo-0.66.
|
|
107
|
+
sunholo-0.66.3.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
108
|
+
sunholo-0.66.3.dist-info/METADATA,sha256=leJE_PT71BuDO_rc6o3ftNGgyzG0xGGzTDVbnclv6Ug,5998
|
|
109
|
+
sunholo-0.66.3.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
|
|
110
|
+
sunholo-0.66.3.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
111
|
+
sunholo-0.66.3.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
112
|
+
sunholo-0.66.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|