@@ -494,10 +494,10 @@ def _format_request_message_content(self, content: ContentBlock) -> dict[str, An
494494 source = document ["source" ]
495495 if "s3Location" in source :
496496 s3_loc = source ["s3Location" ]
497- formatted_s3 : dict [str , Any ] = {"uri" : s3_loc ["uri" ]}
497+ formatted_document_s3 : dict [str , Any ] = {"uri" : s3_loc ["uri" ]}
498498 if "bucketOwner" in s3_loc :
499- formatted_s3 ["bucketOwner" ] = s3_loc ["bucketOwner" ]
500- result ["source" ] = {"s3Location" : formatted_s3 }
499+ formatted_document_s3 ["bucketOwner" ] = s3_loc ["bucketOwner" ]
500+ result ["source" ] = {"s3Location" : formatted_document_s3 }
501501 elif "bytes" in source :
502502 result ["source" ] = {"bytes" : source ["bytes" ]}
503503
@@ -520,16 +520,16 @@ def _format_request_message_content(self, content: ContentBlock) -> dict[str, An
520520 if "image" in content :
521521 image = content ["image" ]
522522 source = image ["source" ]
523- formatted_source : dict [str , Any ] = {}
523+ formatted_image_source : dict [str , Any ] = {}
524524 if "s3Location" in source :
525525 s3_loc = source ["s3Location" ]
526- formatted_s3 : dict [str , Any ] = {"uri" : s3_loc ["uri" ]}
526+ formatted_image_s3 : dict [str , Any ] = {"uri" : s3_loc ["uri" ]}
527527 if "bucketOwner" in s3_loc :
528- formatted_s3 ["bucketOwner" ] = s3_loc ["bucketOwner" ]
529- formatted_source = {"s3Location" : formatted_s3 }
528+ formatted_image_s3 ["bucketOwner" ] = s3_loc ["bucketOwner" ]
529+ formatted_image_source = {"s3Location" : formatted_image_s3 }
530530 elif "bytes" in source :
531- formatted_source = {"bytes" : source ["bytes" ]}
532- result = {"format" : image ["format" ], "source" : formatted_source }
531+ formatted_image_source = {"bytes" : source ["bytes" ]}
532+ result = {"format" : image ["format" ], "source" : formatted_image_source }
533533 return {"image" : result }
534534
535535 # https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ReasoningContentBlock.html
@@ -591,16 +591,16 @@ def _format_request_message_content(self, content: ContentBlock) -> dict[str, An
591591 if "video" in content :
592592 video = content ["video" ]
593593 source = video ["source" ]
594- formatted_source : dict [str , Any ] = {}
594+ formatted_video_source : dict [str , Any ] = {}
595595 if "s3Location" in source :
596596 s3_loc = source ["s3Location" ]
597- formatted_s3 : dict [str , Any ] = {"uri" : s3_loc ["uri" ]}
597+ formatted_video_s3 : dict [str , Any ] = {"uri" : s3_loc ["uri" ]}
598598 if "bucketOwner" in s3_loc :
599- formatted_s3 ["bucketOwner" ] = s3_loc ["bucketOwner" ]
600- formatted_source = {"s3Location" : formatted_s3 }
599+ formatted_video_s3 ["bucketOwner" ] = s3_loc ["bucketOwner" ]
600+ formatted_video_source = {"s3Location" : formatted_video_s3 }
601601 elif "bytes" in source :
602- formatted_source = {"bytes" : source ["bytes" ]}
603- result = {"format" : video ["format" ], "source" : formatted_source }
602+ formatted_video_source = {"bytes" : source ["bytes" ]}
603+ result = {"format" : video ["format" ], "source" : formatted_video_source }
604604 return {"video" : result }
605605
606606 # https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_CitationsContentBlock.html
0 commit comments