sunholo 0.136.0__py3-none-any.whl → 0.136.1__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/discovery_engine_client.py +51 -29
- {sunholo-0.136.0.dist-info → sunholo-0.136.1.dist-info}/METADATA +1 -1
- {sunholo-0.136.0.dist-info → sunholo-0.136.1.dist-info}/RECORD +7 -7
- {sunholo-0.136.0.dist-info → sunholo-0.136.1.dist-info}/WHEEL +0 -0
- {sunholo-0.136.0.dist-info → sunholo-0.136.1.dist-info}/entry_points.txt +0 -0
- {sunholo-0.136.0.dist-info → sunholo-0.136.1.dist-info}/licenses/LICENSE.txt +0 -0
- {sunholo-0.136.0.dist-info → sunholo-0.136.1.dist-info}/top_level.txt +0 -0
@@ -487,23 +487,34 @@ class DiscoveryEngineClient:
|
|
487
487
|
all_documents = []
|
488
488
|
result_count = 0
|
489
489
|
# Check if the response contains results
|
490
|
-
if not hasattr(response, 'results') or not response.results:
|
490
|
+
if not response or not hasattr(response, 'results') or not response.results:
|
491
491
|
log.info(f'No results found in response: {response=}')
|
492
492
|
return []
|
493
493
|
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
494
|
+
should_break=False
|
495
|
+
# Process the pager properly
|
496
|
+
for page in response.pages:
|
497
|
+
if should_break:
|
498
|
+
break
|
499
|
+
if hasattr(page, 'results') and page.results:
|
500
|
+
for result in page.results:
|
501
|
+
if result_count >= max_limit:
|
502
|
+
log.info("Breaking results loop as max limit reached")
|
503
|
+
should_break = True # Set flag to break outer loop
|
504
|
+
break
|
505
|
+
|
506
|
+
if hasattr(result, 'document'):
|
507
|
+
document = result.document
|
508
|
+
all_documents.append(self.document_format(document))
|
509
|
+
result_count += 1
|
510
|
+
|
511
|
+
# Check if we've reached max_limit
|
512
|
+
if max_limit is not None and result_count >= max_limit:
|
513
|
+
log.info(f"Reached max_limit of {max_limit} results, stopping processing")
|
514
|
+
should_break = True
|
515
|
+
break
|
516
|
+
else:
|
517
|
+
log.warning("No document found in result")
|
507
518
|
|
508
519
|
# Combine all documents into one long string
|
509
520
|
result_string = "\n\n".join(all_documents)
|
@@ -516,23 +527,34 @@ class DiscoveryEngineClient:
|
|
516
527
|
result_count = 0
|
517
528
|
|
518
529
|
# Check if the response contains results
|
519
|
-
if not hasattr(response, 'results') or not response.results:
|
530
|
+
if not response or not hasattr(response, 'results') or not response.results:
|
520
531
|
log.info(f'No results found in response: {response=}')
|
521
532
|
return []
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
533
|
+
|
534
|
+
should_break=False
|
535
|
+
# Process the pager properly
|
536
|
+
async for page in response.pages:
|
537
|
+
if should_break:
|
538
|
+
break
|
539
|
+
if hasattr(page, 'results') and page.results:
|
540
|
+
for result in page.results:
|
541
|
+
if result_count >= max_limit:
|
542
|
+
log.info("Breaking results loop as max limit reached")
|
543
|
+
should_break = True # Set flag to break outer loop
|
544
|
+
break
|
545
|
+
|
546
|
+
if hasattr(result, 'document'):
|
547
|
+
document = result.document
|
548
|
+
all_documents.append(self.document_format(document))
|
549
|
+
result_count += 1
|
550
|
+
|
551
|
+
# Check if we've reached max_limit
|
552
|
+
if max_limit is not None and result_count >= max_limit:
|
553
|
+
log.info(f"Reached max_limit of {max_limit} results, stopping processing")
|
554
|
+
should_break = True
|
555
|
+
break
|
556
|
+
else:
|
557
|
+
log.warning("No document found in result")
|
536
558
|
|
537
559
|
# Combine all documents into one long string
|
538
560
|
result_string = "\n\n".join(all_documents)
|
@@ -75,7 +75,7 @@ sunholo/discovery_engine/__init__.py,sha256=hLgqRDJ22Aov9o2QjAEfsVgnL3kMdM-g5p8R
|
|
75
75
|
sunholo/discovery_engine/chunker_handler.py,sha256=wkvXl4rFtYfN6AZUKdW9_QD49Whf77BukDbO82UwlAg,7480
|
76
76
|
sunholo/discovery_engine/cli.py,sha256=tsKqNSDCEsDTz5-wuNwjttb3Xt35D97-KyyEiaqolMQ,35628
|
77
77
|
sunholo/discovery_engine/create_new.py,sha256=WUi4_xh_dFaGX3xA9jkNKZhaR6LCELjMPeRb0hyj4FU,1226
|
78
|
-
sunholo/discovery_engine/discovery_engine_client.py,sha256
|
78
|
+
sunholo/discovery_engine/discovery_engine_client.py,sha256=-0vSF4vd26ihhj7_XkxZJ6TvUCJrThLxZ8lMSTe5vqs,63448
|
79
79
|
sunholo/discovery_engine/get_ai_search_chunks.py,sha256=I6Dt1CznqEvE7XIZ2PkLqopmjpO96iVEWJJqL5cJjOU,5554
|
80
80
|
sunholo/embedder/__init__.py,sha256=sI4N_CqgEVcrMDxXgxKp1FsfsB4FpjoXgPGkl4N_u4I,44
|
81
81
|
sunholo/embedder/embed_chunk.py,sha256=did2pKkWM2o0KkRcb0H9l2x_WjCq6OyuHDxGbITFKPM,6530
|
@@ -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.136.
|
172
|
-
sunholo-0.136.
|
173
|
-
sunholo-0.136.
|
174
|
-
sunholo-0.136.
|
175
|
-
sunholo-0.136.
|
176
|
-
sunholo-0.136.
|
171
|
+
sunholo-0.136.1.dist-info/licenses/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
172
|
+
sunholo-0.136.1.dist-info/METADATA,sha256=2aeqbpV_AQcKkI1c_WUgZh63q6a7ZMNaAbk5C9fSzAY,10067
|
173
|
+
sunholo-0.136.1.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
|
174
|
+
sunholo-0.136.1.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
175
|
+
sunholo-0.136.1.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
176
|
+
sunholo-0.136.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|