Gemini OCR
Gemini OCR reads the text in images and PDF documents with a Google Gemini model that can see. Besides copying the text, it can follow your instructions, for example returning only the fields you care about.
When to use it
- Reading scanned invoices or delivery notes to record their data.
- Getting the text from photos of documents that arrive on WhatsApp or by email.
- Extracting specific fields from a form, such as the name and the amount.
Configuration
You need a Google Gemini credential with your Google AI key. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Google Gemini credential. |
| Model Name (required) | The Gemini model. Press the refresh button to see those available. |
| OCR Prompt (required) | What the model must do with the document. Default: “Read all the text in the image.”. You can ask, for example, for only certain fields. |
| Image/PDF Input | The image or PDF to read, for example the output of Binary or of a component that loads files. |
Advanced options
| Field | What it does |
|---|---|
| Max Output Tokens | Maximum length of the answer. Default: 8192. |
| Temperature | How creative the model is, from 0 to 1. Default: 0.1, to copy the text faithfully. |
Output
The OCR Results output holds the text read from each image or page.
In tool mode, an agent can use the component by itself. See Tool Mode.
Example
An advisory firm receives scanned invoices by email.
- Connect the attachment to Image/PDF Input.
- Write in OCR Prompt: “Return the invoice number, date, issuer tax ID and total”.
- Save OCR Results to a spreadsheet.
Related components
- Text Extractor: pulls names, dates or amounts out of the text read.