sunholo 0.120.2__py3-none-any.whl → 0.120.3__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)
@@ -276,10 +280,9 @@ async def download_gcs_upload_genai(img_url,
276
280
 
277
281
  # Use semaphore to limit concurrent uploads
278
282
  async with upload_semaphore:
279
- downloaded_content = await asyncio.to_thread(
280
- client.files.upload,
281
- file=file_path,
282
- config=dict(mime_type=mime_type, display_name=display_name)
283
+ client.files.upload(
284
+ file=file_path, # Unsanitized path for filesystem access
285
+ config=dict(mime_type=mime_type, display_name=display_name, name=api_name)
283
286
  )
284
287
 
285
288
  # 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.3
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=JEHtylSk_ahOHPjCl9vczivOf23vSF_wvkQ7NqHqBOo,12340
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.3.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
170
+ sunholo-0.120.3.dist-info/METADATA,sha256=iMpZN30TCw9tT6r0gLK0RGIdLuWpMKU2oHIkIHOWFac,9808
171
+ sunholo-0.120.3.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
172
+ sunholo-0.120.3.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
173
+ sunholo-0.120.3.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
174
+ sunholo-0.120.3.dist-info/RECORD,,