OpenAI: Generating prompts to answer questions about a document

First, always love this community and everything you guys share.

I’ve been using the OpenAI integration across many apps. I saw the brief Glide ad video where a claim is made that you can answer questions about the contents of a document. I didn’t think this was yet possible with OpenAI.

So as a test, I built an app where a PDF file is uploaded and then an action that triggers OpenAI to answer a question. The question is formulated using a template column that simply says “You are an analyst. Review this document (replaced with the PDF link) and tell me what company the report is referencing.”

The good news is this works! The data returned and makes sense. The bad news is that it is completely wrong. It doesn’t appear that OpenAI is even reviewing the document. All of the answers it gives me, I can’t find the info in the document. Every time I run this action, it provides new, wildly different answers.

Has anyone else tried this? Is this just an OpenAI issue? Is there a better way to get this to work in Glide? I get the feeling it’s not really reading the document.

You might need to use a combination of integrations. Perhaps using the Azure integration to OCR the document first and then use OpenAI integration to review the OCR data.

Yep Ive uploaded a PDF and asked it to build a table from that document and it gave data that was irrelevant to the PDF itself.

I did get the Google Cloud Vision integration to work where it will convert a PDF to Text. OpenAI seemed to like that data feed better than the PDF file. While the data was now correct, it still gave me an incorrect prompt, most likely due to formatting issues.

There’s a high chance that the attempt to browse the PDF file was unsuccessful. I think you have more chance of doing that when “browsing” becomes a thing with the OpenAI API.

For now, as Bob and Joe said, you might have to convert the PDF file to text first, but that may not work in some cases if your document contains too much text, and it exceeds the token limit.

For this specific use case, I think the “code interpreter” mode in the web version of ChatGPT works best, as you can upload a file, but again, it’s not available through the API.


Thank you everyone. I will continue to work on this and report any updates. @Robert_Petitto Loved your video and learned a few things that are helping.

I am looking at and the documentation and feedback on the OpenAI forums from the guys who built ChatPDF. To be honest, I haven’t had a lot of success using their product either for my use case.

Glide makes a pretty solid claim here on this video (14 second mark) that this is possible using the OpenAI API.

I would be curious for feedback from the Glide team on how they did this.


Hi @centerline,

Any update or findings since the last mentions in this thread? I’m also trying to do something similar.


1 Like


The “native” Glide AI columns work really well for this use case now. When we posted this, that option was not available.

One issue I am having that you may run into. I can point the native Glide AI column to a document url and have it OCR the document. This works fantastic. But then if I want to complete another AI prompt from this text, I often get the token limit. So there is no token limit for Glide AI to OCR the document, but answering prompts by passing the entire document does run up against token limitations. I am getting around this in some ways by using the Truncate Text column. You can split the document to text column up into two or three columns, then ask Glide AI to summarize each, then try to combine those into another single prompt. This may be nuts, but it is working for us in some special use cases. Hope this helps.

1 Like