sunholo 0.118.5__py3-none-any.whl → 0.118.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.
@@ -220,8 +220,8 @@ async def download_gcs_upload_genai(img_url,
220
220
  await f.write(file_bytes)
221
221
 
222
222
  # Upload the file and get its content reference
223
- try:
224
- if not genai_lib:
223
+ if not genai_lib:
224
+ try:
225
225
  downloaded_content: file_types.File = await asyncio.to_thread(
226
226
  partial(genai.upload_file, name=name, mime_type=mime_type, display_name=display_name),
227
227
  sanitized_file
@@ -229,19 +229,25 @@ async def download_gcs_upload_genai(img_url,
229
229
  return {"role": "user", "parts": [{"file_data": downloaded_content},
230
230
  {"text": f"You have been given the ability to read and work with filename '{display_name=}' with {mime_type=} {display_url=}"}
231
231
  ]}
232
- else:
232
+ except Exception as err:
233
+ msg = f"Could not upload {sanitized_file} to genai.upload_file: {str(err)} {traceback.format_exc()} {display_url=}"
234
+ log.error(msg)
235
+ return {"role": "user", "parts": [{"text": msg}]}
236
+ else:
237
+ try:
233
238
  client = genaiv2.Client()
234
239
  downloaded_content = await asyncio.to_thread(
235
- partial(client.files.upload, config=dict(mime_type=mime_type, display_name=display_name)),
236
- sanitized_file
237
- )
240
+ client.files.upload,
241
+ file=sanitized_file,
242
+ config=dict(mime_type=mime_type, display_name=display_name)
243
+ )
238
244
  return {"role": "user", "parts": [{"file_data": downloaded_content},
239
245
  {"text": f"You have been given the ability to read and work with filename '{display_name=}' with {mime_type=} {display_url=}"}
240
246
  ]}
241
- except Exception as err:
242
- msg = f"Could not upload {sanitized_file} to genai.upload_file: {str(err)} {traceback.format_exc()} {display_url=}"
243
- log.error(msg)
244
- return {"role": "user", "parts": [{"text": msg}]}
247
+ except Exception as err:
248
+ msg = f"Could not upload {sanitized_file} to genaiv2.client.files.upload: {str(err)} {traceback.format_exc()} {display_url=}"
249
+ log.error(msg)
250
+ return {"role": "user", "parts": [{"text": msg}]}
245
251
 
246
252
  except Exception as err:
247
253
  log.error(f"Error processing file {img_url} {mime_type=} on attempt {attempt + 1}/{retries}: {str(err)}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: sunholo
3
- Version: 0.118.5
3
+ Version: 0.118.7
4
4
  Summary: Large Language Model DevOps - a package to help deploy LLMs to the Cloud.
5
5
  Author-email: Holosun ApS <multivac@sunholo.com>
6
6
  License: Apache License, Version 2.0
@@ -87,7 +87,7 @@ sunholo/gcs/download_url.py,sha256=Ul81n1rklr8WogPsuxWWD1Nr8RHU451LzHPMJNhAKzw,6
87
87
  sunholo/gcs/extract_and_sign.py,sha256=paRrTCvCN5vkQwCB7OSkxWi-pfOgOtZ0bwdXE08c3Ps,1546
88
88
  sunholo/gcs/metadata.py,sha256=oQLcXi4brsZ74aegWyC1JZmhlaEV270HS5_UWtAYYWE,898
89
89
  sunholo/genai/__init__.py,sha256=TV3PYHWoR4cChdmCOaYB0PtAEQ86qol9XYYEtb1JmSA,239
90
- sunholo/genai/file_handling.py,sha256=3-8DOD95j4iHWW3MZF_ypq8V2GtgpO7LdVT61QSmiW4,9397
90
+ sunholo/genai/file_handling.py,sha256=hKJ79Hl-4sFMRaLgqdnJzxux4SYdoWNT3IQw0zEhtJs,9740
91
91
  sunholo/genai/genaiv2.py,sha256=uqWcfvlsPVPyQo-W_cP9h2TTzyYfzj4lyJlyqPyKTkI,20269
92
92
  sunholo/genai/images.py,sha256=EyjsDqt6XQw99pZUQamomCpMOoIah9bp3XY94WPU7Ms,1678
93
93
  sunholo/genai/init.py,sha256=yG8E67TduFCTQPELo83OJuWfjwTnGZsyACospahyEaY,687
@@ -164,9 +164,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
164
164
  sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
165
165
  sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
166
166
  sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
167
- sunholo-0.118.5.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
168
- sunholo-0.118.5.dist-info/METADATA,sha256=tf0Je6o02Z0Bc5yQpJVVuee10GfiaSZ4mxG17cTRQyM,9638
169
- sunholo-0.118.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
170
- sunholo-0.118.5.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
171
- sunholo-0.118.5.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
172
- sunholo-0.118.5.dist-info/RECORD,,
167
+ sunholo-0.118.7.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
168
+ sunholo-0.118.7.dist-info/METADATA,sha256=NcuQ7vC8i1fZSqaGIl8fd2BOKt9kGRcUB9E0qoxHd14,9638
169
+ sunholo-0.118.7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
170
+ sunholo-0.118.7.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
171
+ sunholo-0.118.7.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
172
+ sunholo-0.118.7.dist-info/RECORD,,