Skip to content

openAI API not supporting Image processing #1562

Closed as not planned
Closed as not planned
@AhzamHassan

Description

@AhzamHassan

I am trying to upload an image to get response from the openAI using its API but the response says, i am unable to process images.
my code:

const completion = await openai.chat.completions.create({
      model: "gpt-4o",
messages: [
        {
          role: "system",
          content: "You are a helpful assistant, i am sharing an image with you please give me the solution for this math problem.",
        },
        {
          role: "user",
          content: JSON.stringify({
            type: "image_url",
            image_url: "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
          }),
        },
      ],
    });

Response (Postman):

{
    "data": {
        "role": "assistant",
        "content": "I'm sorry, but as a text-based AI, I'm unable to view or interpret images. However, if you describe the math problem to me or type it out, I'd be more than happy to assist you in solving it.",
        "refusal": null
    },
    "message": "Success",
    "success": true
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalesupportQuestions about how to do something

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions