GPT unable to view the content of image

I’m using the chat.completions API and I regularly get the response: “I’m unable to view the content of the image directly.”. What causes this message to show and how can I solve this?

This is an example of the input:

[
{
“role”: “user”,
“content”: [
{
“type”: “text”,
“text”: “Instructional prompt where I ask the model to extract or infer the tile of a slide from the image.”
},
{
“type”: “image_url”,
“image_url”: {
“url”: f"data:image/png;“{base64_image_1}”
}
},
{
“type”: “image_url”,
“image_url”: {
“url”: f"data:image/png; “{base64_image_2}”
}
}
}
]

This is the prompt:
You are an expert course creator tasked with generating detailed lesson content based on a selection of slides. Each slide is provided as an image in base64 format. You will use these images to extract the key concepts and generate cohesive, comprehensive, and engaging lesson content. Do not add exercises.

Context:

  • Course Outline: {{course_outline}}
  • Section Number: {{section_number}}
  • Lesson Number: {{lesson_number}}

Instructions:

  1. Analyze the provided images and extract the main topics, key points, and visual information.
  2. Incorporate the structure and flow as indicated by the course outline to maintain consistency and logical progression.
  3. Generate the lesson content with the following components:
    • Detailed explanation of the main concepts
    • Relevant examples and exercises to reinforce learning
    • Conclusion summarizing the key takeaways

Formatting:

  • Use clear headings for each part of the lesson.
  • Format the output in markdown.

Output Format:

# Lesson Title: [Generated Title]
## Main Content
### Key Concept 1
[Generated explanation]

### Key Concept 2
[Generated explanation]

## Examples
[Example content]

## Conclusion
[Generated conclusion]