sunholo 0.119.1__py3-none-any.whl → 0.119.4__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/discovery_engine/chunker_handler.py +4 -1
- sunholo/discovery_engine/create_new.py +7 -2
- sunholo/discovery_engine/discovery_engine_client.py +5 -3
- {sunholo-0.119.1.dist-info → sunholo-0.119.4.dist-info}/METADATA +1 -2
- {sunholo-0.119.1.dist-info → sunholo-0.119.4.dist-info}/RECORD +9 -9
- {sunholo-0.119.1.dist-info → sunholo-0.119.4.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.119.1.dist-info → sunholo-0.119.4.dist-info}/WHEEL +0 -0
- {sunholo-0.119.1.dist-info → sunholo-0.119.4.dist-info}/entry_points.txt +0 -0
- {sunholo-0.119.1.dist-info → sunholo-0.119.4.dist-info}/top_level.txt +0 -0
|
@@ -69,7 +69,10 @@ def do_discovery_engine(message_data:str, metadata:dict, config:ConfigManager=No
|
|
|
69
69
|
gcs_uri=message_data,
|
|
70
70
|
metadata=metadata
|
|
71
71
|
)
|
|
72
|
-
|
|
72
|
+
if response:
|
|
73
|
+
log.info(f"Imported file to corpus: {response} with metadata: {metadata}")
|
|
74
|
+
else:
|
|
75
|
+
log.warning(f"Could not import {message_data} got not response")
|
|
73
76
|
except Exception as err:
|
|
74
77
|
log.error(f"Error importing {message_data} - {corp=} - {str(err)}")
|
|
75
78
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from .discovery_engine_client import DiscoveryEngineClient
|
|
2
2
|
from ..utils import ConfigManager
|
|
3
3
|
from ..utils.gcp_project import get_gcp_project
|
|
4
|
+
from ..custom_logging import log
|
|
4
5
|
|
|
5
6
|
def create_new_discovery_engine(config:ConfigManager):
|
|
6
7
|
|
|
@@ -12,9 +13,13 @@ def create_new_discovery_engine(config:ConfigManager):
|
|
|
12
13
|
chunk_size = chunker_config["chunk_size"]
|
|
13
14
|
|
|
14
15
|
gcp_config = config.vacConfig("gcp_config")
|
|
15
|
-
|
|
16
|
+
if not gcp_config:
|
|
17
|
+
log.info("Found no gcp_config in configuration so using get_gcp_project()")
|
|
18
|
+
project_id = get_gcp_project()
|
|
19
|
+
else:
|
|
20
|
+
project_id = gcp_config.get("project_id") or get_gcp_project()
|
|
16
21
|
if not project_id:
|
|
17
|
-
raise ValueError("Could not find project_id in gcp_config")
|
|
22
|
+
raise ValueError("Could not find project_id in gcp_config or global")
|
|
18
23
|
|
|
19
24
|
#location = gcp_config.get('location')
|
|
20
25
|
|
|
@@ -435,7 +435,7 @@ class DiscoveryEngineClient:
|
|
|
435
435
|
return operation.operation.name
|
|
436
436
|
|
|
437
437
|
def _import_document_request(self,
|
|
438
|
-
request
|
|
438
|
+
request
|
|
439
439
|
) -> str:
|
|
440
440
|
"""
|
|
441
441
|
Handles the common logic for making an ImportDocumentsRequest, including retrying.
|
|
@@ -558,13 +558,15 @@ class DiscoveryEngineClient:
|
|
|
558
558
|
except json.JSONDecodeError as e:
|
|
559
559
|
log.error(f"Error decoding JSON in line: {line.strip()}. Error: {e}")
|
|
560
560
|
continue # Skip to the next line if there's an error
|
|
561
|
+
except Exception as e:
|
|
562
|
+
log.error(f"Unknown error: {str(e)}")
|
|
563
|
+
raise e
|
|
561
564
|
|
|
562
565
|
# 2. Use InlineSource to import:
|
|
563
566
|
request = discoveryengine.ImportDocumentsRequest(
|
|
564
567
|
parent=parent,
|
|
565
568
|
inline_source=discoveryengine.ImportDocumentsRequest.InlineSource(
|
|
566
569
|
documents=documents_with_metadata, # Pass the list of Document objects
|
|
567
|
-
data_schema="document" # Important: Set to "document" when providing full Documents
|
|
568
570
|
),
|
|
569
571
|
reconciliation_mode=discoveryengine.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL,
|
|
570
572
|
)
|
|
@@ -607,7 +609,6 @@ class DiscoveryEngineClient:
|
|
|
607
609
|
parent=parent,
|
|
608
610
|
inline_source=discoveryengine.ImportDocumentsRequest.InlineSource(
|
|
609
611
|
documents=[document],
|
|
610
|
-
data_schema="document"
|
|
611
612
|
),
|
|
612
613
|
reconciliation_mode=discoveryengine.ImportDocumentsRequest.ReconciliationMode.INCREMENTAL
|
|
613
614
|
)
|
|
@@ -617,6 +618,7 @@ class DiscoveryEngineClient:
|
|
|
617
618
|
|
|
618
619
|
except Exception as e:
|
|
619
620
|
log.error(f"Error importing document with metadata: {e}")
|
|
621
|
+
raise e
|
|
620
622
|
|
|
621
623
|
def get_mime_type(self, uri:str):
|
|
622
624
|
return guess_mime_type(uri)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.119.
|
|
3
|
+
Version: 0.119.4
|
|
4
4
|
Summary: Large Language Model DevOps - a package to help deploy LLMs to the Cloud.
|
|
5
5
|
Author-email: Holosun ApS <multivac@sunholo.com>
|
|
6
6
|
License: Apache License, Version 2.0
|
|
@@ -20,7 +20,6 @@ Description-Content-Type: text/markdown
|
|
|
20
20
|
License-File: LICENSE.txt
|
|
21
21
|
Requires-Dist: aiohttp
|
|
22
22
|
Requires-Dist: google-auth
|
|
23
|
-
Requires-Dist: google-cloud-discoveryengine>=0.13.4
|
|
24
23
|
Requires-Dist: pydantic
|
|
25
24
|
Requires-Dist: requests
|
|
26
25
|
Requires-Dist: ruamel.yaml
|
|
@@ -72,9 +72,9 @@ sunholo/database/sql/sb/delete_source_row.sql,sha256=r6fEuUKdbiLHCDGKSbKINDCpJjs
|
|
|
72
72
|
sunholo/database/sql/sb/return_sources.sql,sha256=89KAnxfK8n_qGK9jy1OQT8f9n4uYUtYL5cCxbC2mj_c,255
|
|
73
73
|
sunholo/database/sql/sb/setup.sql,sha256=CvoFvZQev2uWjmFa3aj3m3iuPFzAAJZ0S7Qi3L3-zZI,89
|
|
74
74
|
sunholo/discovery_engine/__init__.py,sha256=hLgqRDJ22Aov9o2QjAEfsVgnL3kMdM-g5p8RJ9OyKdQ,130
|
|
75
|
-
sunholo/discovery_engine/chunker_handler.py,sha256=
|
|
76
|
-
sunholo/discovery_engine/create_new.py,sha256=
|
|
77
|
-
sunholo/discovery_engine/discovery_engine_client.py,sha256=
|
|
75
|
+
sunholo/discovery_engine/chunker_handler.py,sha256=dmdXpUIYIkmXUf3M6V-vuWqDXNthLPsKoSyzQmQOu4c,5731
|
|
76
|
+
sunholo/discovery_engine/create_new.py,sha256=WUi4_xh_dFaGX3xA9jkNKZhaR6LCELjMPeRb0hyj4FU,1226
|
|
77
|
+
sunholo/discovery_engine/discovery_engine_client.py,sha256=b6UT7s-1zqrLnIfoP9bDs64hk0SUsqaA40ghbs2A7go,27552
|
|
78
78
|
sunholo/discovery_engine/get_ai_search_chunks.py,sha256=hsFGOQugSeTMPEaQ16XTs_D45F8NABBm2IsAEdTk7kQ,4316
|
|
79
79
|
sunholo/embedder/__init__.py,sha256=sI4N_CqgEVcrMDxXgxKp1FsfsB4FpjoXgPGkl4N_u4I,44
|
|
80
80
|
sunholo/embedder/embed_chunk.py,sha256=Vvvj3-H4pSb1a2sLik3-X3X459j2jrUq1dBNAsOcQLo,7156
|
|
@@ -164,9 +164,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
|
|
|
164
164
|
sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
|
|
165
165
|
sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
|
|
166
166
|
sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
|
|
167
|
-
sunholo-0.119.
|
|
168
|
-
sunholo-0.119.
|
|
169
|
-
sunholo-0.119.
|
|
170
|
-
sunholo-0.119.
|
|
171
|
-
sunholo-0.119.
|
|
172
|
-
sunholo-0.119.
|
|
167
|
+
sunholo-0.119.4.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
168
|
+
sunholo-0.119.4.dist-info/METADATA,sha256=cYBqEOOkHvurx9b3-ipXsEMDpa6JIARsvEpVIqWE2ZQ,9654
|
|
169
|
+
sunholo-0.119.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
170
|
+
sunholo-0.119.4.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
171
|
+
sunholo-0.119.4.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
172
|
+
sunholo-0.119.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|