you are sending the image in base64.
The Conversation api directly accepts the file content in the format you specify.
"messages": [
{
"content": [
{"text": "What is this document?"},
{"image": {"format": "jpeg", "source": {"bytes": image_content}}}
],
"role": "user"
}
]
where for example if you take your image from aws S3
file_obj = s3.get_object(Bucket=bucket, Key=key)
image_content = file_obj['Body'].read()