sunholo 0.134.4__py3-none-any.whl → 0.134.5__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.
@@ -224,34 +224,56 @@ def search_command(args):
224
224
  if args.parse_chunks_to_string:
225
225
  console.print("\n[bold magenta]--- Combined Chunk String ---[/bold magenta]")
226
226
  console.print(results_data if results_data else "[yellow]No results found or error occurred.[/yellow]")
227
+ elif isinstance(results_data, str):
228
+ # Handle string result when parse_chunks_to_string is False but a string was returned anyway
229
+ console.print("\n[bold magenta]--- Results String ---[/bold magenta]")
230
+ console.print(results_data)
227
231
  elif results_data: # It's a pager object
228
- console.print("\n[bold magenta]--- Individual Chunks ---[/bold magenta]")
229
- chunk_count = 0
230
- try:
231
- # Iterate through the pager returned by get_chunks
232
- for page in results_data.pages:
233
- if not hasattr(page, 'results') or not page.results: continue
234
- for result in page.results:
235
- # Ensure the result structure is as expected by get_chunks
236
- if hasattr(result, 'chunk'):
237
- chunk_count += 1
238
- console.print(f"\n[bold]Chunk {chunk_count}:[/bold]")
239
- # Use the client's formatter if available
240
- console.print(client.chunk_format(result.chunk))
241
- elif hasattr(result, 'document') and hasattr(result.document, 'chunks'):
242
- # Fallback if structure is different (e.g., document with chunks)
243
- for chunk in result.document.chunks:
244
- chunk_count += 1
245
- console.print(f"\n[bold]Chunk {chunk_count} (from doc {result.document.id}):[/bold]")
246
- console.print(f" Content: {getattr(chunk, 'content', 'N/A')}")
247
- console.print(f" Doc Name: {getattr(chunk, 'document_metadata', {}).get('name', 'N/A')}") # Example access
248
-
249
- if chunk_count == 0:
250
- console.print("[yellow]No chunks found in the results.[/yellow]")
251
-
252
- except Exception as page_err:
253
- console.print(f"[bold red]Error processing search results pager: {page_err}[/bold red]")
254
- console.print(f"[red]{traceback.format_exc()}[/red]")
232
+ if args.content_search_spec_type == "chunks":
233
+ console.print("\n[bold magenta]--- Individual Chunks ---[/bold magenta]")
234
+ chunk_count = 0
235
+ try:
236
+ # Iterate through the pager returned by get_chunks
237
+ for page in results_data.pages:
238
+ if not hasattr(page, 'results') or not page.results: continue
239
+ for result in page.results:
240
+ # Ensure the result structure is as expected by get_chunks
241
+ if hasattr(result, 'chunk'):
242
+ chunk_count += 1
243
+ console.print(f"\n[bold]Chunk {chunk_count}:[/bold]")
244
+ # Use the client's formatter if available
245
+ console.print(client.chunk_format(result.chunk))
246
+ elif hasattr(result, 'document') and hasattr(result.document, 'chunks'):
247
+ # Fallback if structure is different (e.g., document with chunks)
248
+ for chunk in result.document.chunks:
249
+ chunk_count += 1
250
+ console.print(f"\n[bold]Chunk {chunk_count} (from doc {result.document.id}):[/bold]")
251
+ console.print(f" Content: {getattr(chunk, 'content', 'N/A')}")
252
+ console.print(f" Doc Name: {getattr(chunk, 'document_metadata', {}).get('name', 'N/A')}")
253
+ if chunk_count == 0:
254
+ console.print("[yellow]No chunks found in the results.[/yellow]")
255
+
256
+ except Exception as page_err:
257
+ console.print(f"[bold red]Error processing search results pager: {page_err}[/bold red]")
258
+ console.print(f"[red]{traceback.format_exc()}[/red]")
259
+ elif args.content_search_spec_type == "documents":
260
+ console.print("\n[bold magenta]--- Individual Documents ---[/bold magenta]")
261
+ doc_count = 0
262
+ try:
263
+ # Iterate through the pager returned by get_documents
264
+ for page in results_data.pages:
265
+ if not hasattr(page, 'results') or not page.results: continue
266
+ for result in page.results:
267
+ if hasattr(result, 'document'):
268
+ doc_count += 1
269
+ console.print(f"\n[bold]Document {doc_count}:[/bold]")
270
+ console.print(client.document_format(result.document))
271
+
272
+ if doc_count == 0:
273
+ console.print("[yellow]No documents found in the results.[/yellow]")
274
+ except Exception as page_err:
275
+ console.print(f"[bold red]Error processing document results: {page_err}[/bold red]")
276
+ console.print(f"[red]{traceback.format_exc()}[/red]")
255
277
  else:
256
278
  console.print("[yellow]No results found or error occurred.[/yellow]")
257
279
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sunholo
3
- Version: 0.134.4
3
+ Version: 0.134.5
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=bUhCPoKrkMtdeTBHLyCZf9syVwHn5kE0yXpqDBIzmTc,34120
76
+ sunholo/discovery_engine/cli.py,sha256=0FKitDCqnKwtONyGt7gmsRoE5W6HHCIDqaTt8S0Dw4s,35631
77
77
  sunholo/discovery_engine/create_new.py,sha256=WUi4_xh_dFaGX3xA9jkNKZhaR6LCELjMPeRb0hyj4FU,1226
78
78
  sunholo/discovery_engine/discovery_engine_client.py,sha256=Ak3VpadtgpPWfIEot87EiNh4vbDUg9gQVa-1UDnoGMA,58442
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.4.dist-info/licenses/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
172
- sunholo-0.134.4.dist-info/METADATA,sha256=g2a99cYiyPfDeVa55srGe2k_5_MHsJhzwBll43hQ56M,10067
173
- sunholo-0.134.4.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
174
- sunholo-0.134.4.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
175
- sunholo-0.134.4.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
176
- sunholo-0.134.4.dist-info/RECORD,,
171
+ sunholo-0.134.5.dist-info/licenses/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
172
+ sunholo-0.134.5.dist-info/METADATA,sha256=OyzGPXRwE0gTZBioO_oT-pHLXH4s-Fw51ws6pWmT_Jc,10067
173
+ sunholo-0.134.5.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
174
+ sunholo-0.134.5.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
175
+ sunholo-0.134.5.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
176
+ sunholo-0.134.5.dist-info/RECORD,,