Could you explain how to use chatGPT to upload and analyze PDF?

Hi everyone,
I would like to know how to upload a PDF file into the GPT-4 platform for analysis. Specifically, I need the R script to use the gpt API which loads a pdf document and asks chatGPT for its contents. Could you kindly help me?
Thank you for your assistance.

Oof, not sure openai has a R package, only javascript and python. You’ll have to make RESTful requests manually.

POST
https://api.openai.com/v1/chat/completions

Some detail on the response object: Chat Completions Endpoint.

Python example of how to talk to PDFs:

How_to_call_functions_for_knowledge_retrieval.ipynb

I am not aware of a PDF upload facility for the API, could you elaborate further?