sunholo 0.69.10__py3-none-any.whl → 0.69.12__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 +2 -0
- sunholo/discovery_engine/discovery_engine_client.py +11 -5
- sunholo/logging.py +7 -1
- {sunholo-0.69.10.dist-info → sunholo-0.69.12.dist-info}/METADATA +4 -2
- {sunholo-0.69.10.dist-info → sunholo-0.69.12.dist-info}/RECORD +9 -9
- {sunholo-0.69.10.dist-info → sunholo-0.69.12.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.69.10.dist-info → sunholo-0.69.12.dist-info}/WHEEL +0 -0
- {sunholo-0.69.10.dist-info → sunholo-0.69.12.dist-info}/entry_points.txt +0 -0
- {sunholo-0.69.10.dist-info → sunholo-0.69.12.dist-info}/top_level.txt +0 -0
|
@@ -51,6 +51,8 @@ def do_discovery_engine(message_data, metadata, vector_name):
|
|
|
51
51
|
|
|
52
52
|
if message_data.startswith("gs://"):
|
|
53
53
|
log.info(f"DiscoveryEngineClient.import_files for {message_data}")
|
|
54
|
+
if "/pdf_parts/" in message_data:
|
|
55
|
+
return None
|
|
54
56
|
for corp in corpuses:
|
|
55
57
|
try:
|
|
56
58
|
response = corp.import_documents(
|
|
@@ -201,19 +201,25 @@ class DiscoveryEngineClient:
|
|
|
201
201
|
),
|
|
202
202
|
)
|
|
203
203
|
|
|
204
|
+
log.info(f"Discovery engine request: {search_request=}")
|
|
204
205
|
search_response = self.search_client.search(search_request)
|
|
206
|
+
|
|
205
207
|
|
|
206
208
|
if parse_chunks_to_string:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
+
|
|
210
|
+
big_string = self.process_chunks(search_response)
|
|
211
|
+
log.info(f"Discovery engine chunks string sample: {big_string[:100]}")
|
|
212
|
+
|
|
213
|
+
return big_string
|
|
209
214
|
|
|
215
|
+
log.info("Discovery engine response object")
|
|
210
216
|
return search_response
|
|
211
217
|
|
|
212
218
|
def process_chunks(self, response):
|
|
213
219
|
all_chunks = []
|
|
214
220
|
|
|
215
221
|
if 'results' not in response:
|
|
216
|
-
raise ValueError('No results found in response')
|
|
222
|
+
raise ValueError(f'No results found in response: {response=}')
|
|
217
223
|
|
|
218
224
|
for result in response['results']:
|
|
219
225
|
chunk = result['chunk']
|
|
@@ -311,9 +317,9 @@ class DiscoveryEngineClient:
|
|
|
311
317
|
try:
|
|
312
318
|
operation = import_documents_with_retry(self.doc_client, request)
|
|
313
319
|
except ResourceExhausted as e:
|
|
314
|
-
|
|
320
|
+
log.error(f"Operation failed after retries due to quota exceeded: {e}")
|
|
315
321
|
except Exception as e:
|
|
316
|
-
|
|
322
|
+
log.error(f"An unexpected error occurred: {e}")
|
|
317
323
|
|
|
318
324
|
return operation.operation.name
|
|
319
325
|
|
sunholo/logging.py
CHANGED
|
@@ -119,8 +119,14 @@ class GoogleCloudLogging:
|
|
|
119
119
|
if log_text:
|
|
120
120
|
if isinstance(log_struct, dict):
|
|
121
121
|
logger.log_struct(log_struct, severity=severity, source_location=caller_info)
|
|
122
|
-
|
|
122
|
+
elif isinstance(log_struct, str):
|
|
123
123
|
logger.log_text(log_text, severity=severity, source_location=caller_info)
|
|
124
|
+
else:
|
|
125
|
+
try:
|
|
126
|
+
turn_to_text = str(log_text)
|
|
127
|
+
logger.log_text(turn_to_text, severity=severity, source_location=caller_info)
|
|
128
|
+
except Exception as err:
|
|
129
|
+
print(f"Could not log this: {log_text=} - {str(err)}")
|
|
124
130
|
|
|
125
131
|
elif log_struct:
|
|
126
132
|
if not isinstance(log_struct, dict):
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.69.
|
|
3
|
+
Version: 0.69.12
|
|
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.69.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.69.12.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -61,6 +61,7 @@ Requires-Dist: pypdf ; extra == 'all'
|
|
|
61
61
|
Requires-Dist: python-socketio ; extra == 'all'
|
|
62
62
|
Requires-Dist: rich ; extra == 'all'
|
|
63
63
|
Requires-Dist: supabase ; extra == 'all'
|
|
64
|
+
Requires-Dist: tantivy ; extra == 'all'
|
|
64
65
|
Requires-Dist: tiktoken ; extra == 'all'
|
|
65
66
|
Provides-Extra: anthropic
|
|
66
67
|
Requires-Dist: langchain-anthropic >=0.1.13 ; extra == 'anthropic'
|
|
@@ -75,6 +76,7 @@ Requires-Dist: pg8000 ; extra == 'database'
|
|
|
75
76
|
Requires-Dist: pgvector ; extra == 'database'
|
|
76
77
|
Requires-Dist: psycopg2-binary ; extra == 'database'
|
|
77
78
|
Requires-Dist: lancedb ; extra == 'database'
|
|
79
|
+
Requires-Dist: tantivy ; extra == 'database'
|
|
78
80
|
Provides-Extra: gcp
|
|
79
81
|
Requires-Dist: google-auth-httplib2 ; extra == 'gcp'
|
|
80
82
|
Requires-Dist: google-auth-oauthlib ; extra == 'gcp'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sunholo/__init__.py,sha256=0CdpufyRKWyZe7J7UKigL6j_qOorM-p0OjHIAuf9M38,864
|
|
2
|
-
sunholo/logging.py,sha256=
|
|
2
|
+
sunholo/logging.py,sha256=UUBl0_oBrW21O5cNAT5lYZ2OmAnVJ92PnAwtA_2Sz_g,12117
|
|
3
3
|
sunholo/agents/__init__.py,sha256=Hb4NXy2rN-83Z0-UDRwX-LXv2R29lcbSFPf8G6q4fZg,380
|
|
4
4
|
sunholo/agents/chat_history.py,sha256=8iX1bgvRW6fdp6r_DQR_caPHYrZ_9QJJgPxCiSDf3q8,5380
|
|
5
5
|
sunholo/agents/dispatch_to_qa.py,sha256=nFNdxhkr7rVYuUwVoBCBNYBI2Dke6-_z_ZApBEWb_cU,8291
|
|
@@ -61,9 +61,9 @@ sunholo/database/sql/sb/delete_source_row.sql,sha256=r6fEuUKdbiLHCDGKSbKINDCpJjs
|
|
|
61
61
|
sunholo/database/sql/sb/return_sources.sql,sha256=89KAnxfK8n_qGK9jy1OQT8f9n4uYUtYL5cCxbC2mj_c,255
|
|
62
62
|
sunholo/database/sql/sb/setup.sql,sha256=CvoFvZQev2uWjmFa3aj3m3iuPFzAAJZ0S7Qi3L3-zZI,89
|
|
63
63
|
sunholo/discovery_engine/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
|
-
sunholo/discovery_engine/chunker_handler.py,sha256=
|
|
64
|
+
sunholo/discovery_engine/chunker_handler.py,sha256=puNnV6vKnjNqk28FLnsIPMNsC-1Y6s20PK7ioi8qwzc,4491
|
|
65
65
|
sunholo/discovery_engine/create_new.py,sha256=7oZG78T6lW0EspRzlo7-qRyXFSuFxDn2dfSAVEaqlqY,978
|
|
66
|
-
sunholo/discovery_engine/discovery_engine_client.py,sha256=
|
|
66
|
+
sunholo/discovery_engine/discovery_engine_client.py,sha256=WFi0h-JfZd0eKtW6uzm6zfffkGMP2iKBHZU1Tw1uiCw,14944
|
|
67
67
|
sunholo/embedder/__init__.py,sha256=sI4N_CqgEVcrMDxXgxKp1FsfsB4FpjoXgPGkl4N_u4I,44
|
|
68
68
|
sunholo/embedder/embed_chunk.py,sha256=P744zUQJgqrjILunzaqtTerB9AwoXFU6tXBtz4rjWgQ,6673
|
|
69
69
|
sunholo/gcs/__init__.py,sha256=DtVw_AZwQn-IguR5BJuIi2XJeF_FQXizhJikzRNrXiE,50
|
|
@@ -111,9 +111,9 @@ sunholo/vertex/__init__.py,sha256=JvHcGFuv6R_nAhY2AdoqqhMpJ5ugeWPZ_svGhWrObBk,13
|
|
|
111
111
|
sunholo/vertex/init.py,sha256=JDMUaBRdednzbKF-5p33qqLit2LMsvgvWW-NRz0AqO0,1801
|
|
112
112
|
sunholo/vertex/memory_tools.py,sha256=8F1iTWnqEK9mX4W5RzCVKIjydIcNp6OFxjn_dtQ3GXo,5379
|
|
113
113
|
sunholo/vertex/safety.py,sha256=3meAX0HyGZYrH7rXPUAHxtI_3w_zoy_RX7Shtkoa660,1275
|
|
114
|
-
sunholo-0.69.
|
|
115
|
-
sunholo-0.69.
|
|
116
|
-
sunholo-0.69.
|
|
117
|
-
sunholo-0.69.
|
|
118
|
-
sunholo-0.69.
|
|
119
|
-
sunholo-0.69.
|
|
114
|
+
sunholo-0.69.12.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
115
|
+
sunholo-0.69.12.dist-info/METADATA,sha256=w1SqSvez7MqPL3PlMn4PIrhlFDru7p8XLU_DPiE8_AI,6242
|
|
116
|
+
sunholo-0.69.12.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
|
|
117
|
+
sunholo-0.69.12.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
118
|
+
sunholo-0.69.12.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
119
|
+
sunholo-0.69.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|