An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
Hi Scott Smith,
The reason you're getting a 500 Internal Server Error when sending a PDF to the /responses endpoint is because the Azure OpenAI service does not currently support PDFs as a valid input_file type. The /responses endpoint only accepts certain file types, mainly images like PNG and JPEG, but not PDFs. That’s why sending an image works, but sending a PDF causes the server to crash. To work around this, you should first extract the text content from the PDF using a Python library such as PyMuPDF, PyPDF2, or pdfplumber. Once you have the extracted text, you can send it to the /responses endpoint as input_text instead of input_file. This way, the model can read and analyze the contents of the PDF properly. In short, PDFs must be converted into plain text before sending, because direct PDF uploads are not supported in the /responses API.
I hope this information helps. Thank you!