Unable to directly analyze or view the content of files like (local) images

What you are attempting to send is significantly wrong.

You tag this “assistants”, but assistants does not support uploading of files in messages, even if encoded to base64.

Yet you make a requestBody with model and messages, giving hint that you are using chat.completions and not Assistants.

Besides not encoding an image properly and sending it as part of contents of a message, you are trying to put simply an image into a system message where it is not permitted, where instead you should be putting instructions that the AI CAN look at images.

This previous forum post has simple application code showing how to makes a system message for a task, and how a user provides the images, and how they must be encoded.

Or how to create the user message alone

Or how those messages would individually appear as content, with the user providing instructions

So the fault is not “gpt-4o API unable to directly analyze”, but rather “user unable to directly analyze API reference documentation.” Hopefully the links I provided serve as a better documentation.

1 Like