sunholo 0.118.8__py3-none-any.whl → 0.118.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/genai/file_handling.py +7 -9
- {sunholo-0.118.8.dist-info → sunholo-0.118.10.dist-info}/METADATA +1 -1
- {sunholo-0.118.8.dist-info → sunholo-0.118.10.dist-info}/RECORD +7 -7
- {sunholo-0.118.8.dist-info → sunholo-0.118.10.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.118.8.dist-info → sunholo-0.118.10.dist-info}/WHEEL +0 -0
- {sunholo-0.118.8.dist-info → sunholo-0.118.10.dist-info}/entry_points.txt +0 -0
- {sunholo-0.118.8.dist-info → sunholo-0.118.10.dist-info}/top_level.txt +0 -0
sunholo/genai/file_handling.py
CHANGED
|
@@ -94,6 +94,7 @@ async def construct_file_content(gs_list, bucket:str, genai_lib=False):
|
|
|
94
94
|
- contentType: The content type of the file on GCS
|
|
95
95
|
- storagePath: The path in the bucket
|
|
96
96
|
- name: The name of the file
|
|
97
|
+
- url: The URL of the file that can be used to display the contents
|
|
97
98
|
- bucket: The bucket the files are in
|
|
98
99
|
- genai: whether its using the genai SDK
|
|
99
100
|
|
|
@@ -131,14 +132,9 @@ async def construct_file_content(gs_list, bucket:str, genai_lib=False):
|
|
|
131
132
|
myfile = genai.get_file(name)
|
|
132
133
|
else:
|
|
133
134
|
client = genaiv2.Client()
|
|
134
|
-
myfile = client.files.get(name)
|
|
135
|
-
|
|
136
|
-
content.append(
|
|
137
|
-
{"role": "user", "parts": [
|
|
138
|
-
{"file_data": myfile},
|
|
139
|
-
{"text": f"You have been given the ability to work with file {display_name=} with {mime_type=} {display_url=}"}
|
|
140
|
-
]
|
|
141
|
-
})
|
|
135
|
+
myfile = client.files.get(name=name)
|
|
136
|
+
content.append(myfile)
|
|
137
|
+
content.append(f"You have been given the ability to work with file {display_name=} with {mime_type=} {display_url=}")
|
|
142
138
|
log.info(f"Found existing genai.get_file {name=}")
|
|
143
139
|
except Exception as e:
|
|
144
140
|
log.info(f"Not found checking genai.get_file: '{name}' {str(e)}")
|
|
@@ -241,7 +237,9 @@ async def download_gcs_upload_genai(img_url,
|
|
|
241
237
|
file=sanitized_file,
|
|
242
238
|
config=dict(mime_type=mime_type, display_name=display_name)
|
|
243
239
|
)
|
|
244
|
-
return downloaded_content
|
|
240
|
+
return [downloaded_content,
|
|
241
|
+
f"You have been given the ability to read and work with filename '{display_name=}' with {mime_type=} {display_url=}"]
|
|
242
|
+
|
|
245
243
|
except Exception as err:
|
|
246
244
|
msg = f"Could not upload {sanitized_file} to genaiv2.client.files.upload: {str(err)} {traceback.format_exc()} {display_url=}"
|
|
247
245
|
log.error(msg)
|
|
@@ -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=
|
|
90
|
+
sunholo/genai/file_handling.py,sha256=5wN8ynrrLLiY4JRRCCWLcqnxXVeYjgw26IH4itTrFCc,9564
|
|
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.
|
|
168
|
-
sunholo-0.118.
|
|
169
|
-
sunholo-0.118.
|
|
170
|
-
sunholo-0.118.
|
|
171
|
-
sunholo-0.118.
|
|
172
|
-
sunholo-0.118.
|
|
167
|
+
sunholo-0.118.10.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
168
|
+
sunholo-0.118.10.dist-info/METADATA,sha256=prYJcbvo8lNaYqKHCeNC-I2_9ObUb8hr_AZHt6YMRRY,9639
|
|
169
|
+
sunholo-0.118.10.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
170
|
+
sunholo-0.118.10.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
171
|
+
sunholo-0.118.10.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
172
|
+
sunholo-0.118.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|