File tree 1 file changed +10
-21
lines changed
src/lmnr/openllmetry_sdk/opentelemetry/instrumentation/google_genai
1 file changed +10
-21
lines changed Original file line number Diff line number Diff line change @@ -203,25 +203,14 @@ def _process_image_item(
203
203
message_index : int ,
204
204
content_index : int ,
205
205
):
206
-
207
- if not Config .upload_base64_image :
208
- # Convert to openai format, so backends can handle it
209
- return (
210
- {
211
- "type" : "image_url" ,
212
- "image_url" : {
213
- "url" : f"data:image/{ blob .get ('mime_type' ).split ('/' )[1 ]} ;base64,{ blob .get ('data' )} " ,
214
- },
215
- }
216
- if Config .convert_image_to_openai_format
217
- else blob
218
- )
219
-
220
- image_format = blob .get ("mime_type" ).split ("/" )[1 ]
221
- image_name = f"message_{ message_index } _content_{ content_index } .{ image_format } "
222
- base64_string = blob .get ("data" )
223
- url = _run_async (
224
- Config .upload_base64_image (trace_id , span_id , image_name , base64_string )
206
+ # Convert to openai format, so backends can handle it
207
+ return (
208
+ {
209
+ "type" : "image_url" ,
210
+ "image_url" : {
211
+ "url" : f"data:image/{ blob .get ('mime_type' ).split ('/' )[1 ]} ;base64,{ blob .get ('data' )} " ,
212
+ },
213
+ }
214
+ if Config .convert_image_to_openai_format
215
+ else blob
225
216
)
226
-
227
- return {"type" : "image_url" , "image_url" : {"url" : url }}
You can’t perform that action at this time.
0 commit comments