sunholo 0.101.8__py3-none-any.whl → 0.101.10__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.
sunholo/gcs/add_file.py CHANGED
@@ -24,40 +24,7 @@ except ImportError:
24
24
 
25
25
  from ..custom_logging import log
26
26
  from ..utils import ConfigManager
27
-
28
- def guess_image_type(file_path: str) -> str:
29
- """
30
- Guess the image type based on the file extension.
31
-
32
- Args:
33
- file_path (str): The path or URL of the image file.
34
-
35
- Returns:
36
- str: The guessed image type (e.g., "jpeg", "png", "gif", etc.)
37
- or None if the extension is not recognized.
38
- """
39
- # Extract the file extension
40
- _, ext = os.path.splitext(file_path)
41
-
42
- # Normalize and remove the leading dot
43
- ext = ext.lower().strip('.')
44
-
45
- # Mapping of common file extensions to image types
46
- extension_to_type = {
47
- "jpg": "image/jpeg",
48
- "jpeg": "image/jpeg",
49
- "png": "image/png",
50
- "gif": "image/gif",
51
- "bmp": "image/bmp",
52
- "tiff": "image/tiff",
53
- "tif": "image/tiff",
54
- "webp": "image/webp",
55
- "ico": "image/ico",
56
- "svg": "image/svg",
57
- "pdf": "application/pdf",
58
- }
59
-
60
- return extension_to_type.get(ext.lower(), None)
27
+ from ..utils.mime import guess_mime_type
61
28
 
62
29
 
63
30
  def handle_base64_image(base64_data: str, vector_name: str, extension: str):
@@ -92,7 +59,7 @@ def handle_base64_image(base64_data: str, vector_name: str, extension: str):
92
59
  os.remove(filename) # Clean up the saved file
93
60
 
94
61
  # Determine MIME type based on extension
95
- mime_type = guess_image_type(extension) or "application/octet-stream"
62
+ mime_type = guess_mime_type(extension) or "application/octet-stream"
96
63
 
97
64
  return image_uri, mime_type
98
65
  except Exception as e:
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.101.8
3
+ Version: 0.101.10
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.101.8.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.101.10.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -80,7 +80,7 @@ sunholo/embedder/embed_chunk.py,sha256=_FdO4-9frUJlDPqXv2Ai49ejUrrMTMGti3D7bfJGf
80
80
  sunholo/excel/__init__.py,sha256=AqTMN9K4qJYi4maEgoORc5oxDVGO_eqmwzDaVP37JgY,56
81
81
  sunholo/excel/plugin.py,sha256=rl3FoECZ6Ts8KKExPrbPwr3u3CegZfsevmcjgUXAlhE,4033
82
82
  sunholo/gcs/__init__.py,sha256=SZvbsMFDko40sIRHTHppA37IijvJTae54vrhooEF5-4,90
83
- sunholo/gcs/add_file.py,sha256=vqgt71BodjVWKb-slr24lE0b12_ipFIbFyiSuPCVHGA,9081
83
+ sunholo/gcs/add_file.py,sha256=OAKEtLWPu5IK5XNxuPSBhbIlSSytIln-Evz2VbZ6O-4,8170
84
84
  sunholo/gcs/download_folder.py,sha256=ijJTnS595JqZhBH8iHFErQilMbkuKgL-bnTCMLGuvlA,1614
85
85
  sunholo/gcs/download_url.py,sha256=Ul81n1rklr8WogPsuxWWD1Nr8RHU451LzHPMJNhAKzw,6416
86
86
  sunholo/gcs/extract_and_sign.py,sha256=paRrTCvCN5vkQwCB7OSkxWi-pfOgOtZ0bwdXE08c3Ps,1546
@@ -147,9 +147,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
147
147
  sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
148
148
  sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
149
149
  sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
150
- sunholo-0.101.8.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
151
- sunholo-0.101.8.dist-info/METADATA,sha256=ebKNiCxn5C0tp2_i76J48-qN7Uf7R83EvJDY6aLJOPI,8312
152
- sunholo-0.101.8.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
153
- sunholo-0.101.8.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
154
- sunholo-0.101.8.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
155
- sunholo-0.101.8.dist-info/RECORD,,
150
+ sunholo-0.101.10.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
151
+ sunholo-0.101.10.dist-info/METADATA,sha256=v2uIK5DbDPSat2qFF6pyAnJC0ZcU0Wgq7d_50YT919o,8314
152
+ sunholo-0.101.10.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
153
+ sunholo-0.101.10.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
154
+ sunholo-0.101.10.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
155
+ sunholo-0.101.10.dist-info/RECORD,,