@@ -291,10 +291,10 @@ def _extract_part_content(part: "Any") -> "Optional[dict[str, Any]]":
291291 if "function_response" in part :
292292 return _extract_tool_message_from_part (part )
293293
294- if "text" in part :
294+ if part . get ( "text" ) :
295295 return {"text" : part ["text" ], "type" : "text" }
296296
297- if "file_data" in part :
297+ if part . get ( "file_data" ) :
298298 file_data = part ["file_data" ]
299299 if isinstance (file_data , dict ):
300300 return {
@@ -303,7 +303,7 @@ def _extract_part_content(part: "Any") -> "Optional[dict[str, Any]]":
303303 "file_uri" : file_data .get ("file_uri" ),
304304 }
305305
306- if "inline_data" in part :
306+ if part . get ( "inline_data" ) :
307307 inline_data = part ["inline_data" ]
308308 if isinstance (inline_data , dict ):
309309 data = inline_data .get ("data" )
@@ -384,7 +384,7 @@ def _extract_tool_message_from_part(part: "Any") -> "Optional[dict[str, Any]]":
384384 if isinstance (function_response , dict ):
385385 tool_call_id = function_response .get ("id" )
386386 tool_name = function_response .get ("name" )
387- response_dict = function_response .get ("response" , {})
387+ response_dict = function_response .get ("response" ) or {}
388388 # Prefer "output" key if present, otherwise use entire response
389389 output = response_dict .get ("output" , response_dict )
390390 else :
@@ -763,8 +763,6 @@ def set_span_data_for_request(
763763 messages .extend (contents_messages )
764764
765765 if messages :
766- # Redact blob message parts
767- messages = redact_blob_message_parts (messages )
768766 normalized_messages = normalize_message_roles (messages )
769767 scope = sentry_sdk .get_current_scope ()
770768 messages_data = truncate_and_annotate_messages (
0 commit comments