PDF Parser
Last updated
Last updated
x
x
x
In Open WebUI download the mistral:7b model
Let's create a new Chain. Click on: '+ Add New' blue button in top right.
Save as: 'PDF Parser'.
Add a Tool Agent. Click on the blue + sign and select Chains > LLM Chain.
Drag & drop onto the canvas.
Next add a Chat Model. Again, Click on the blue + sign and select Chat Models > ChatOllama.
Connect the ChatOllama to the LLM Chain, by dragging a connector from ChatOllama to LLM Chain.
Configure the model as illustrated.
Let's add a Prompt Template: Prompts > Prompt Template, and connect to LLM Chain.
Before we progress any further, lets Save.
In the Prompt Template, expand the Template. Were going to add some instructions based on the PDF.
In the Template lets add some instructions.
Save .. now we need to associate the PDF with the {invoice} variable. Click on Format Prompt Values.
Save .. To enable the file to be uploaded into the chat: Settings > Configuration.
Enable File Upload .. and Save.
Let's give it a go ..!
Add the Structured Output Parser: Output Parsers > Structured Output Parser
Enable Autofix and click on: 'Additional Parameters'.
Double-click in the Property / Type / description field to edit and select the type.
invoice_id
string
Invoice Number
order_id
number
Order Number
service_type
string
Service
due_date
string
Due Date
total
number
Total
And finally ..