PDF Question Assistant

Recipe details

Create recipe image

Here we use three macros Add PDF, user input and generate.

Add PDF displays a button which the user can use to upload a PDF. The macro will automatically handle the uploading and extract all the text inside the PDF.

user input displays a text area where the user can specify their question. Note that we specified the instructions for the text area when creating the recipe.

generate is used to ask an LLM to answer the user’s question about the PDF. Since it is nested underneath Add PDF and user input, it has access to both the PDF’s text and the user’s question. All of this gets passed as context, which the LLM uses to answer the user’s question.