sunholo 0.69.12__py3-none-any.whl → 0.69.13__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.
@@ -218,44 +218,46 @@ class DiscoveryEngineClient:
218
218
  def process_chunks(self, response):
219
219
  all_chunks = []
220
220
 
221
- if 'results' not in response:
221
+ # Check if the response contains results
222
+ if not hasattr(response, 'results') or not response.results:
222
223
  raise ValueError(f'No results found in response: {response=}')
223
224
 
224
- for result in response['results']:
225
- chunk = result['chunk']
226
- chunk_metadata = chunk['chunkMetadata']
225
+ # Iterate through each result in the response
226
+ for result in response.results:
227
+ chunk = result.chunk
228
+ chunk_metadata = chunk.chunkMetadata
227
229
 
228
- if 'previousChunks' in chunk_metadata:
230
+ if hasattr(chunk_metadata, 'previousChunks'):
229
231
  # Process previous chunks
230
- for prev_chunk in chunk['chunkMetadata']['previousChunks']:
232
+ for prev_chunk in chunk_metadata.previousChunks:
231
233
  prev_chunk_string = (
232
- f"# {prev_chunk['id']}\n"
233
- f"{prev_chunk['content']}\n"
234
+ f"# {prev_chunk.id}\n"
235
+ f"{prev_chunk.content}\n"
234
236
  f"## metadata\n"
235
- f"Document URI: {prev_chunk['documentMetadata']['uri']}\n"
236
- f"Document Title: {prev_chunk['documentMetadata']['title']}\n"
237
+ f"Document URI: {prev_chunk.documentMetadata.uri}\n"
238
+ f"Document Title: {prev_chunk.documentMetadata.title}\n"
237
239
  )
238
240
  all_chunks.append(prev_chunk_string)
239
241
 
240
242
  # Process fetched chunk
241
243
  fetched_chunk_string = (
242
- f"# {chunk['id']}\n"
243
- f"{chunk['content']}\n"
244
+ f"# {chunk.id}\n"
245
+ f"{chunk.content}\n"
244
246
  f"## metadata\n"
245
- f"Document URI: {chunk['documentMetadata']['uri']}\n"
246
- f"Document Title: {chunk['documentMetadata']['title']}\n"
247
+ f"Document URI: {chunk.documentMetadata.uri}\n"
248
+ f"Document Title: {chunk.documentMetadata.title}\n"
247
249
  )
248
250
  all_chunks.append(fetched_chunk_string)
249
251
 
250
252
  # Process next chunks
251
- if 'nextChunks' in chunk_metadata:
252
- for next_chunk in chunk_metadata['nextChunks']:
253
+ if hasattr(chunk_metadata, 'nextChunks'):
254
+ for next_chunk in chunk_metadata.nextChunks:
253
255
  next_chunk_string = (
254
- f"# {next_chunk['id']}\n"
255
- f"{next_chunk['content']}\n"
256
+ f"# {next_chunk.id}\n"
257
+ f"{next_chunk.content}\n"
256
258
  f"## metadata\n"
257
- f"Document URI: {next_chunk['documentMetadata']['uri']}\n"
258
- f"Document Title: {next_chunk['documentMetadata']['title']}\n"
259
+ f"Document URI: {next_chunk.documentMetadata.uri}\n"
260
+ f"Document Title: {next_chunk.documentMetadata.title}\n"
259
261
  )
260
262
  all_chunks.append(next_chunk_string)
261
263
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.69.12
3
+ Version: 0.69.13
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.12.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.69.13.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -63,7 +63,7 @@ sunholo/database/sql/sb/setup.sql,sha256=CvoFvZQev2uWjmFa3aj3m3iuPFzAAJZ0S7Qi3L3
63
63
  sunholo/discovery_engine/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
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=WFi0h-JfZd0eKtW6uzm6zfffkGMP2iKBHZU1Tw1uiCw,14944
66
+ sunholo/discovery_engine/discovery_engine_client.py,sha256=3nTiFlYSMps7WEQwm-9oReZH0f07PN6mjJjXrn2BFqA,15015
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.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,,
114
+ sunholo-0.69.13.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
115
+ sunholo-0.69.13.dist-info/METADATA,sha256=MaShm5cJCTDR_7FugF5T8rND03p3QymIOkqJcxdPP04,6242
116
+ sunholo-0.69.13.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
117
+ sunholo-0.69.13.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
118
+ sunholo-0.69.13.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
119
+ sunholo-0.69.13.dist-info/RECORD,,