pdf_input_file_upload.py
Run the Example
1
Set up your virtual environment
2
Install dependencies
3
Export your OpenAI API key
4
Download the sample PDF
Download
ThaiRecipes.pdf next to the saved script:5
Update the model
Replace
OpenAIChat(id="gpt-4o") with OpenAIChat(id="gpt-5.4-mini") in the saved file.6
Run the example
Save the code above as
pdf_input_file_upload.py, then run: