sunholo 0.120.2__py3-none-any.whl → 0.120.4__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.
@@ -242,14 +242,18 @@ async def download_gcs_upload_genai(img_url,
242
242
 
243
243
  extension = mimetypes.guess_extension(mime_type)
244
244
 
245
+ # Create a unique directory for this upload task
245
246
  # Create a unique directory for this upload task
246
247
  unique_id = str(uuid.uuid4())
247
248
  temp_dir = os.path.join(tempfile.gettempdir(), f"upload_{unique_id}")
248
249
  os.makedirs(temp_dir, exist_ok=True)
249
-
250
- # Create a file with unique path
250
+
251
+ # Create a file with unique path - NO sanitization in the filesystem path
251
252
  file_path = os.path.join(temp_dir, f"file_{unique_id}{extension}")
252
- file_path = sanitize_file(file_path)
253
+
254
+ api_name = sanitize_file(f"file-{unique_id[:8]}")
255
+
256
+
253
257
  log.info(f"Writing file {file_path}")
254
258
  async with aiofiles.open(file_path, 'wb') as f:
255
259
  await f.write(file_bytes)
@@ -257,9 +261,9 @@ async def download_gcs_upload_genai(img_url,
257
261
  try:
258
262
  if not genai_lib:
259
263
  downloaded_content = await asyncio.to_thread(
260
- partial(genai.upload_file, name=name, mime_type=mime_type, display_name=display_name),
261
- file_path
262
- )
264
+ partial(genai.upload_file, name=api_name, mime_type=mime_type, display_name=display_name),
265
+ file_path # Use the unsanitized path for filesystem access
266
+ )
263
267
 
264
268
  # Clean up after successful upload
265
269
  try:
@@ -278,8 +282,8 @@ async def download_gcs_upload_genai(img_url,
278
282
  async with upload_semaphore:
279
283
  downloaded_content = await asyncio.to_thread(
280
284
  client.files.upload,
281
- file=file_path,
282
- config=dict(mime_type=mime_type, display_name=display_name)
285
+ file=file_path, # Use the unsanitized path for filesystem access
286
+ config=dict(mime_type=mime_type, display_name=display_name, name=api_name)
283
287
  )
284
288
 
285
289
  # Clean up after successful upload
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: sunholo
3
- Version: 0.120.2
3
+ Version: 0.120.4
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
@@ -89,7 +89,7 @@ sunholo/gcs/download_url.py,sha256=Ul81n1rklr8WogPsuxWWD1Nr8RHU451LzHPMJNhAKzw,6
89
89
  sunholo/gcs/extract_and_sign.py,sha256=paRrTCvCN5vkQwCB7OSkxWi-pfOgOtZ0bwdXE08c3Ps,1546
90
90
  sunholo/gcs/metadata.py,sha256=oQLcXi4brsZ74aegWyC1JZmhlaEV270HS5_UWtAYYWE,898
91
91
  sunholo/genai/__init__.py,sha256=TV3PYHWoR4cChdmCOaYB0PtAEQ86qol9XYYEtb1JmSA,239
92
- sunholo/genai/file_handling.py,sha256=HawdumqE1kRGisqFIJQCSsviwU0GAi-_Hf1NfBwKi_0,12242
92
+ sunholo/genai/file_handling.py,sha256=dMINjhp0CzbRgkI_TTzeNx9kbH450PAJJ12kAgQEp6Q,12489
93
93
  sunholo/genai/genaiv2.py,sha256=uqWcfvlsPVPyQo-W_cP9h2TTzyYfzj4lyJlyqPyKTkI,20269
94
94
  sunholo/genai/images.py,sha256=EyjsDqt6XQw99pZUQamomCpMOoIah9bp3XY94WPU7Ms,1678
95
95
  sunholo/genai/init.py,sha256=yG8E67TduFCTQPELo83OJuWfjwTnGZsyACospahyEaY,687
@@ -166,9 +166,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
166
166
  sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
167
167
  sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
168
168
  sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
169
- sunholo-0.120.2.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
170
- sunholo-0.120.2.dist-info/METADATA,sha256=QECpWEQrMEew9HWU_e7_4ngRWft_x1xS5XbIfwiC2Vg,9808
171
- sunholo-0.120.2.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
172
- sunholo-0.120.2.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
173
- sunholo-0.120.2.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
174
- sunholo-0.120.2.dist-info/RECORD,,
169
+ sunholo-0.120.4.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
170
+ sunholo-0.120.4.dist-info/METADATA,sha256=yTYW7hEE0mvGjB4VGSU2ASHd9Myihabn31UH-ZGtMrY,9808
171
+ sunholo-0.120.4.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
172
+ sunholo-0.120.4.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
173
+ sunholo-0.120.4.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
174
+ sunholo-0.120.4.dist-info/RECORD,,