sunholo 0.131.5__py3-none-any.whl → 0.131.7__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.
@@ -370,36 +370,56 @@ def search_engine_command(args):
370
370
 
371
371
  console.print("-" * 20)
372
372
 
373
-
374
373
  # Print Document Results (available on the page level)
375
374
  if hasattr(page, 'results') and page.results:
376
- console.print(f"[bold blue]Documents Found ({len(page.results)} on this page):[/bold blue]")
377
- for i, result in enumerate(page.results):
378
- results_found_on_any_page = True
379
- results_found_on_this_page = True
380
- console.print(f"\n[bold]Result {i+1}:[/bold]")
381
- doc = result.document
382
- console.print(f" ID: {doc.id}")
383
- console.print(f" Name: {doc.name}")
384
- # Display structData if present
385
- if doc.struct_data:
386
- try:
387
- # Convert Struct to dict for nice printing
388
- struct_dict = MessageToDict(doc.struct_data._pb)
389
- console.print(f" Metadata: {json.dumps(struct_dict, indent=2)}")
390
- except Exception as json_err:
391
- console.print(f"[yellow] Warning: Could not convert metadata Struct to JSON: {json_err}[/yellow]")
392
- console.print(f" Metadata: {doc.struct_data}") # Fallback
393
-
394
- # Display Snippets if requested and available
395
- if args.return_snippet and 'snippets' in doc.derived_struct_data:
375
+ console.print(f"[bold blue]Documents Found ({len(page.results)} on this page):[/bold blue]")
376
+ for i, result in enumerate(page.results):
377
+ results_found_on_any_page = True
378
+ results_found_on_this_page = True
379
+ console.print(f"\n[bold]Result {i+1}:[/bold]")
380
+ doc = result.document
381
+ console.print(f" ID: {doc.id}")
382
+ console.print(f" Name: {doc.name}")
383
+ # Display structData if present
384
+ if doc.struct_data:
385
+ # Attempt 1: Preferred - Use proto-plus .to_json() if available
386
+ if hasattr(doc.struct_data, 'to_json'):
387
+ console.print(f"[yellow] to_json[/yellow]")
388
+ # Pass indent directly if the method supports it
389
+ try:
390
+ metadata_output = doc.struct_data.to_json(indent=2)
391
+ except TypeError: # In case to_json doesn't accept indent
392
+ metadata_output = doc.struct_data.to_json()
393
+ # Optionally re-parse and indent if needed, but often okay as is
394
+ # parsed_json = json.loads(metadata_output)
395
+ # metadata_output = json.dumps(parsed_json, indent=2)
396
+
397
+
398
+ # Attempt 2: Use proto-plus .to_dict() then json.dumps
399
+ elif hasattr(doc.struct_data, 'to_dict'):
400
+ console.print(f"[yellow] to_dict[/yellow]")
401
+
402
+ struct_dict = doc.struct_data.to_dict()
403
+ metadata_output = json.dumps(struct_dict, indent=2)
404
+ else:
405
+ try:
406
+ # Convert Struct to dict for nice printing
407
+ struct_dict = str(doc.struct_data)
408
+ metadata_output = json.dumps(struct_dict, indent=2)
409
+ except Exception as json_err:
410
+ console.print(f"[yellow] Warning: Could not convert metadata Struct to JSON: {json_err}[/yellow]")
411
+ metadata_output = doc.struct_data
412
+ console.print(f" Metadata: {json.dumps(metadata_output, indent=2)}")
413
+ # Display Snippets if requested and available
414
+ if args.return_snippet and 'snippets' in doc.derived_struct_data:
396
415
  console.print("[bold cyan] Snippets:[/bold cyan]")
397
416
  for snippet in doc.derived_struct_data['snippets']:
398
417
  console.print(f" - {snippet.get('snippet', 'N/A').strip()}") # Adjust key if needed
399
- elif args.return_snippet:
418
+ elif args.return_snippet:
400
419
  console.print("[yellow] (Snippets requested but not found in result)[/yellow]")
401
- console.print("-" * 5)
402
- console.print("-" * 20) # End of results list for page
420
+ console.print("-" * 5)
421
+
422
+ console.print("-" * 20) # End of results list for page
403
423
 
404
424
  if not results_found_on_this_page:
405
425
  console.print("[yellow](No summary or document results on this page)[/yellow]")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sunholo
3
- Version: 0.131.5
3
+ Version: 0.131.7
4
4
  Summary: AI DevOps - a package to help deploy GenAI to the Cloud.
5
5
  Author-email: Holosun ApS <multivac@sunholo.com>
6
6
  License: Apache License, Version 2.0
@@ -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=-ERTG9jxt6bEMkCfXRYCrCxTth_Y2XhS3TkK1t-W_f8,31462
76
+ sunholo/discovery_engine/cli.py,sha256=BJsjZ5s9lmX4Wo7OabE9CW14XbiQfx3trRaIw3y7vvo,32885
77
77
  sunholo/discovery_engine/create_new.py,sha256=WUi4_xh_dFaGX3xA9jkNKZhaR6LCELjMPeRb0hyj4FU,1226
78
78
  sunholo/discovery_engine/discovery_engine_client.py,sha256=nV4loBBnOqGPRlEbFIFRJEB6cXKDVgJOMRMdf4-v510,51775
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.131.5.dist-info/licenses/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
172
- sunholo-0.131.5.dist-info/METADATA,sha256=hRtqYxbxEn06q1a3HM2nOIhYC2ugJ5Z7G4zm4YfHaCw,10067
173
- sunholo-0.131.5.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
174
- sunholo-0.131.5.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
175
- sunholo-0.131.5.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
176
- sunholo-0.131.5.dist-info/RECORD,,
171
+ sunholo-0.131.7.dist-info/licenses/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
172
+ sunholo-0.131.7.dist-info/METADATA,sha256=IV3U8oDWbRRvlfV17OtG6U2Y1EADO_nKBUrFCFaiclM,10067
173
+ sunholo-0.131.7.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
174
+ sunholo-0.131.7.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
175
+ sunholo-0.131.7.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
176
+ sunholo-0.131.7.dist-info/RECORD,,