sunholo 0.120.1__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.
@@ -139,10 +139,8 @@ async def construct_file_content(gs_list, bucket:str, genai_lib=False, timeout=6
139
139
  display_url = file_info.get('url')
140
140
  mime_type = file_info['contentType']
141
141
  # Generate a unique name for each file
142
- import uuid
143
142
  original_name = sanitize_file(file_info['name'])
144
- unique_id = str(uuid.uuid4())[:8]
145
- unique_name = sanitize_file(f"{original_name}-{unique_id}")
143
+ unique_name = sanitize_file(f"{original_name}")
146
144
 
147
145
  display_name = file_info['name']
148
146
  log.info(f"Processing {unique_name=} {display_name=}")
@@ -244,14 +242,18 @@ async def download_gcs_upload_genai(img_url,
244
242
 
245
243
  extension = mimetypes.guess_extension(mime_type)
246
244
 
245
+ # Create a unique directory for this upload task
247
246
  # Create a unique directory for this upload task
248
247
  unique_id = str(uuid.uuid4())
249
248
  temp_dir = os.path.join(tempfile.gettempdir(), f"upload_{unique_id}")
250
249
  os.makedirs(temp_dir, exist_ok=True)
251
-
252
- # Create a file with unique path
250
+
251
+ # Create a file with unique path - NO sanitization in the filesystem path
253
252
  file_path = os.path.join(temp_dir, f"file_{unique_id}{extension}")
254
253
 
254
+ api_name = sanitize_file(f"file-{unique_id[:8]}")
255
+
256
+
255
257
  log.info(f"Writing file {file_path}")
256
258
  async with aiofiles.open(file_path, 'wb') as f:
257
259
  await f.write(file_bytes)
@@ -278,10 +280,9 @@ async def download_gcs_upload_genai(img_url,
278
280
 
279
281
  # Use semaphore to limit concurrent uploads
280
282
  async with upload_semaphore:
281
- downloaded_content = await asyncio.to_thread(
282
- client.files.upload,
283
- file=file_path,
284
- 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)
285
286
  )
286
287
 
287
288
  # Clean up after successful upload
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: sunholo
3
- Version: 0.120.1
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=67CCG3F8yEjwl5zZx7SJeGjYMgsKJS5IrHoHEgA-YGc,12280
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.1.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
170
- sunholo-0.120.1.dist-info/METADATA,sha256=olBwCw5jEYkDy3wGlZwENl4-8Nsj5rQ8uZybI_EfgRQ,9808
171
- sunholo-0.120.1.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
172
- sunholo-0.120.1.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
173
- sunholo-0.120.1.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
174
- sunholo-0.120.1.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,,