sunholo 0.61.7__py3-none-any.whl → 0.61.8__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/data_to_embed_pubsub.py +24 -0
- {sunholo-0.61.7.dist-info → sunholo-0.61.8.dist-info}/METADATA +2 -2
- {sunholo-0.61.7.dist-info → sunholo-0.61.8.dist-info}/RECORD +7 -7
- {sunholo-0.61.7.dist-info → sunholo-0.61.8.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.61.7.dist-info → sunholo-0.61.8.dist-info}/WHEEL +0 -0
- {sunholo-0.61.7.dist-info → sunholo-0.61.8.dist-info}/entry_points.txt +0 -0
- {sunholo-0.61.7.dist-info → sunholo-0.61.8.dist-info}/top_level.txt +0 -0
|
@@ -11,11 +11,31 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
+
import pathlib
|
|
15
|
+
|
|
14
16
|
from ..logging import log
|
|
15
17
|
from ..pubsub import process_pubsub_message
|
|
16
18
|
from .message_data import handle_gcs_message, handle_google_drive_message, handle_github_message, handle_http_message, handle_json_content_message
|
|
17
19
|
from .publish import process_docs_chunks_vector_name
|
|
20
|
+
from .splitter import chunk_doc_to_docs
|
|
21
|
+
|
|
18
22
|
from ..llamaindex.import_files import llamaindex_chunker_check
|
|
23
|
+
from . import loaders
|
|
24
|
+
|
|
25
|
+
def direct_file_to_embed(file_name: pathlib.Path, metadata: dict, vector_name: str):
|
|
26
|
+
|
|
27
|
+
log.info(f"Sending direct file upload {file_name} to loaders.read_file_to_documents {metadata}")
|
|
28
|
+
docs = loaders.read_file_to_documents(file_name, metadata=metadata)
|
|
29
|
+
if docs is None:
|
|
30
|
+
log.warning(f"loaders.read_file_to_documents docs2 failed to load file {metadata}")
|
|
31
|
+
|
|
32
|
+
return None
|
|
33
|
+
|
|
34
|
+
chunks = chunk_doc_to_docs(docs, file_name.suffix, vector_name=vector_name)
|
|
35
|
+
|
|
36
|
+
return format_chunk_return(chunks, metadata, vector_name)
|
|
37
|
+
|
|
38
|
+
|
|
19
39
|
|
|
20
40
|
def data_to_embed_pubsub(data: dict):
|
|
21
41
|
"""Triggered from a message on a Cloud Pub/Sub topic.
|
|
@@ -62,7 +82,11 @@ def process_chunker_data(message_data, metadata, vector_name):
|
|
|
62
82
|
|
|
63
83
|
else:
|
|
64
84
|
chunks, metadata = handle_json_content_message(message_data, metadata, vector_name)
|
|
85
|
+
|
|
86
|
+
return format_chunk_return(chunks, metadata, vector_name)
|
|
87
|
+
|
|
65
88
|
|
|
89
|
+
def format_chunk_return(chunks, metadata, vector_name):
|
|
66
90
|
# to be really sure
|
|
67
91
|
if metadata:
|
|
68
92
|
metadata["vector_name"] = vector_name
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.61.
|
|
3
|
+
Version: 0.61.8
|
|
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.61.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.61.8.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -22,7 +22,7 @@ sunholo/bots/discord.py,sha256=cCFae5K1BCa6JVkWGLh_iZ9qFO1JpXb6K4eJrlDfEro,2442
|
|
|
22
22
|
sunholo/bots/github_webhook.py,sha256=5pQPRLM_wxxcILVaIzUDV8Kt7Arcm2dL1r1kMMHA524,9629
|
|
23
23
|
sunholo/bots/webapp.py,sha256=EIMxdAJ_xtufwJmvnn7N_Fb_1hZ9DjhJ0Kf_hp02vEU,1926
|
|
24
24
|
sunholo/chunker/__init__.py,sha256=UhQBZTKwDfBXm0TPv4LvsGc5pdUGCbYzi3qPTOkU4gw,55
|
|
25
|
-
sunholo/chunker/data_to_embed_pubsub.py,sha256=
|
|
25
|
+
sunholo/chunker/data_to_embed_pubsub.py,sha256=_uIf1hLD-fF3_S_TaG5PzpzoEcnooehN9K9CaGN7PwI,3820
|
|
26
26
|
sunholo/chunker/doc_handling.py,sha256=rIyknpzDyj5A0u_DqSQVD_CXLRNZPOU6TCL4bhCdjOI,8563
|
|
27
27
|
sunholo/chunker/images.py,sha256=Xmh1vwHrVhoXm5iH2dhCc52O8YgdzE8KrDSdL-pGnp8,1861
|
|
28
28
|
sunholo/chunker/loaders.py,sha256=xiToUVgPz2ZzcqpUAq7aNP3PTenb_rBUAFzu0JPycIg,10268
|
|
@@ -96,9 +96,9 @@ sunholo/utils/parsers.py,sha256=OrHmASqIbI45atVOhiGodgLvnfrzkvVzyHnSvAXD89I,3841
|
|
|
96
96
|
sunholo/utils/user_ids.py,sha256=SQd5_H7FE7vcTZp9AQuQDWBXd4FEEd7TeVMQe1H4Ny8,292
|
|
97
97
|
sunholo/vertex/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
98
98
|
sunholo/vertex/init_vertex.py,sha256=JDMUaBRdednzbKF-5p33qqLit2LMsvgvWW-NRz0AqO0,1801
|
|
99
|
-
sunholo-0.61.
|
|
100
|
-
sunholo-0.61.
|
|
101
|
-
sunholo-0.61.
|
|
102
|
-
sunholo-0.61.
|
|
103
|
-
sunholo-0.61.
|
|
104
|
-
sunholo-0.61.
|
|
99
|
+
sunholo-0.61.8.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
100
|
+
sunholo-0.61.8.dist-info/METADATA,sha256=yW6gVMlt1_S4pAeXHijSp86J2dR3P9-qvjabNZ6J1qU,8057
|
|
101
|
+
sunholo-0.61.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
102
|
+
sunholo-0.61.8.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
103
|
+
sunholo-0.61.8.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
104
|
+
sunholo-0.61.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|