I am a beginner. I purchased tokens to use GPT-4 and finally figured out how to import the GPT-4 model into my Jupyter Notebook.
%env OPENAI_API_KEY= (my key goes here)
!pip install --upgrade openai wandb
from openai import OpenAI
LLM = OpenAI()
response = LLM.chat.completions.create(
model='gpt-4',
messages=[{'role': 'user', 'content': 'What is 1+1?'}],)
response
Now, I would like to upload a PDF document and prompt GPT-4 to extract important headings from the document. Can you provide the code for how to do this? Specifically the part where you upload the PDF, and prompt GPT-4 with an example instruction.
If I'm not mistaken, I don't need to process the PDF into text format because GPT-4 can work directly with PDFs? That's why I wanted to use GPT-4, because when I was converting the PDF to text, it was very messy due to tables, headers, footers, etc.