sunholo 0.134.0__py3-none-any.whl → 0.134.2__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/custom_logging.py +20 -0
- sunholo/discovery_engine/cli.py +21 -5
- {sunholo-0.134.0.dist-info → sunholo-0.134.2.dist-info}/METADATA +1 -1
- {sunholo-0.134.0.dist-info → sunholo-0.134.2.dist-info}/RECORD +8 -8
- {sunholo-0.134.0.dist-info → sunholo-0.134.2.dist-info}/WHEEL +0 -0
- {sunholo-0.134.0.dist-info → sunholo-0.134.2.dist-info}/entry_points.txt +0 -0
- {sunholo-0.134.0.dist-info → sunholo-0.134.2.dist-info}/licenses/LICENSE.txt +0 -0
- {sunholo-0.134.0.dist-info → sunholo-0.134.2.dist-info}/top_level.txt +0 -0
sunholo/custom_logging.py
CHANGED
@@ -193,6 +193,26 @@ class GoogleCloudLogging:
|
|
193
193
|
except Exception as text_err:
|
194
194
|
print(f"Even fallback text logging failed: {text_err}")
|
195
195
|
|
196
|
+
def log(self, message, *args, **kwargs):
|
197
|
+
"""
|
198
|
+
Some weird bug keeps calling this method - do not use normally
|
199
|
+
|
200
|
+
A catch-all method to handle unexpected .log() calls on this class.
|
201
|
+
Routes the call to the appropriate logging method based on severity level.
|
202
|
+
"""
|
203
|
+
severity = kwargs.get('severity', 'INFO')
|
204
|
+
# Remove severity from kwargs if it exists to avoid passing it twice
|
205
|
+
if 'severity' in kwargs:
|
206
|
+
del kwargs['severity']
|
207
|
+
|
208
|
+
# Determine if this is a structured log or simple message
|
209
|
+
if isinstance(message, dict):
|
210
|
+
# Assume this is a structured log
|
211
|
+
return self.structured_log(log_struct=message, severity=severity)
|
212
|
+
else:
|
213
|
+
# Assume this is a text log
|
214
|
+
return self.structured_log(log_text=message, severity=severity)
|
215
|
+
|
196
216
|
def debug(self, log_text=None, log_struct=None):
|
197
217
|
|
198
218
|
"""
|
sunholo/discovery_engine/cli.py
CHANGED
@@ -277,11 +277,25 @@ def search_by_id_and_or_date_command(args):
|
|
277
277
|
elif results_data:
|
278
278
|
console.print("\n[bold magenta]--- Individual Chunks (Filtered) ---[/bold magenta]")
|
279
279
|
chunk_count = 0
|
280
|
-
# ... (pager iteration identical to search_command) ...
|
281
280
|
try:
|
281
|
+
# Iterate through the pager returned by get_chunks
|
282
282
|
for page in results_data.pages:
|
283
|
-
|
284
|
-
|
283
|
+
if not hasattr(page, 'results') or not page.results: continue
|
284
|
+
for result in page.results:
|
285
|
+
# Ensure the result structure is as expected by get_chunks
|
286
|
+
if hasattr(result, 'chunk'):
|
287
|
+
chunk_count += 1
|
288
|
+
console.print(f"\n[bold]Chunk {chunk_count}:[/bold]")
|
289
|
+
# Use the client's formatter if available
|
290
|
+
console.print(client.chunk_format(result.chunk))
|
291
|
+
elif hasattr(result, 'document') and hasattr(result.document, 'chunks'):
|
292
|
+
# Fallback if structure is different (e.g., document with chunks)
|
293
|
+
for chunk in result.document.chunks:
|
294
|
+
chunk_count += 1
|
295
|
+
console.print(f"\n[bold]Chunk {chunk_count} (from doc {result.document.id}):[/bold]")
|
296
|
+
console.print(f" Content: {getattr(chunk, 'content', 'N/A')}")
|
297
|
+
console.print(f" Doc Name: {getattr(chunk, 'document_metadata', {}).get('name', 'N/A')}") # Example access
|
298
|
+
|
285
299
|
if chunk_count == 0:
|
286
300
|
console.print("[yellow]No chunks found in the filtered results.[/yellow]")
|
287
301
|
except Exception as page_err:
|
@@ -402,8 +416,10 @@ def search_engine_command(args):
|
|
402
416
|
try:
|
403
417
|
struct_dict = convert_composite_to_native(doc.struct_data)
|
404
418
|
metadata_output = struct_dict.get("structData", {})
|
405
|
-
|
406
|
-
|
419
|
+
title = struct_dict.get("title", "")
|
420
|
+
content = struct_dict.get("content", "")
|
421
|
+
console.print(f" Title: {title}")
|
422
|
+
console.print(f" Content: {content}")
|
407
423
|
except Exception as json_err:
|
408
424
|
console.print(f"[yellow] Warning: Could not convert metadata Struct to JSON: {json_err}[/yellow]")
|
409
425
|
metadata_output = doc.struct_data
|
@@ -1,5 +1,5 @@
|
|
1
1
|
sunholo/__init__.py,sha256=InRbX4V0-qdNHo9zYH3GEye7ASLR6LX8-SMvPV4Jsaw,1212
|
2
|
-
sunholo/custom_logging.py,sha256
|
2
|
+
sunholo/custom_logging.py,sha256=PrUXreBF0nZJMfa8A8cbFhTWoaOWWB_i6qwZfnjvRlo,18296
|
3
3
|
sunholo/langchain_types.py,sha256=uZ4zvgej_f7pLqjtu4YP7qMC_eZD5ym_5x4pyvA1Ih4,1834
|
4
4
|
sunholo/agents/__init__.py,sha256=X2I3pPkGeKWjc3d0QgSpkTyqD8J8JtrEWqwrumf1MMc,391
|
5
5
|
sunholo/agents/chat_history.py,sha256=Gph_CdlP2otYnNdR1q1Umyyyvcad2F6K3LxU5yBQ9l0,5387
|
@@ -73,7 +73,7 @@ sunholo/database/sql/sb/return_sources.sql,sha256=89KAnxfK8n_qGK9jy1OQT8f9n4uYUt
|
|
73
73
|
sunholo/database/sql/sb/setup.sql,sha256=CvoFvZQev2uWjmFa3aj3m3iuPFzAAJZ0S7Qi3L3-zZI,89
|
74
74
|
sunholo/discovery_engine/__init__.py,sha256=hLgqRDJ22Aov9o2QjAEfsVgnL3kMdM-g5p8RJ9OyKdQ,130
|
75
75
|
sunholo/discovery_engine/chunker_handler.py,sha256=wkvXl4rFtYfN6AZUKdW9_QD49Whf77BukDbO82UwlAg,7480
|
76
|
-
sunholo/discovery_engine/cli.py,sha256=
|
76
|
+
sunholo/discovery_engine/cli.py,sha256=so8blTu708TjbyifWdZG_eju0p9L98wLq5Lpl9T-yGo,33159
|
77
77
|
sunholo/discovery_engine/create_new.py,sha256=WUi4_xh_dFaGX3xA9jkNKZhaR6LCELjMPeRb0hyj4FU,1226
|
78
78
|
sunholo/discovery_engine/discovery_engine_client.py,sha256=lB6D05ZOXm9Avl6hM6vJZvPZD_TzNroyBl-E5cJYWAk,52661
|
79
79
|
sunholo/discovery_engine/get_ai_search_chunks.py,sha256=I6Dt1CznqEvE7XIZ2PkLqopmjpO96iVEWJJqL5cJjOU,5554
|
@@ -168,9 +168,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
|
|
168
168
|
sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
|
169
169
|
sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
|
170
170
|
sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
|
171
|
-
sunholo-0.134.
|
172
|
-
sunholo-0.134.
|
173
|
-
sunholo-0.134.
|
174
|
-
sunholo-0.134.
|
175
|
-
sunholo-0.134.
|
176
|
-
sunholo-0.134.
|
171
|
+
sunholo-0.134.2.dist-info/licenses/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
172
|
+
sunholo-0.134.2.dist-info/METADATA,sha256=Ujn_UARqsdpkBJdyHwDnHwS38VO5l58T9vNMD6R55x8,10067
|
173
|
+
sunholo-0.134.2.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
174
|
+
sunholo-0.134.2.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
175
|
+
sunholo-0.134.2.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
176
|
+
sunholo-0.134.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|