Test file and document workflows
Some agents need to read files, for example an invoice, a prescription or a filled-in form. An OCR tool lets an agent read the text in an image or a PDF from a link.
In the Playground chat you can attach a file to a message, and the agent gets a link to it.
Before you start
-
Add an OCR tool to the project and connect it to the agent. See OCR.
-
Tell the agent in its system prompt when to read a file, for example:
When the customer sends an invoice, read it with the OCR tool
and confirm the invoice number, date and total with them.
Test it
- Open the Playground and choose the Chat tab.
- Select the paperclip (Attach an image or PDF) next to the message box and pick a file. Use test data, not real customer documents.
- Optionally type a message to go with it, for example "What is the total on this invoice?". If you leave it empty, the message is "Please read this file:".
- Select Send. The file is uploaded to the project and your message is sent with the file's link. An image shows in the chat.
- Open Tool logs to check that the agent called the OCR tool with the right link, and see the text it got back.
If the upload fails, the file stays attached so you can send it again.
You need edit access to the project to attach files. Viewers don't see the paperclip.
You can also send a link to a file that is already online, for example: "Please check this invoice: https://example.com/samples/invoice-1042.pdf".
Supported files
| Type | Formats |
|---|---|
| Images | JPEG, PNG, WebP, GIF |
| Documents |
Files can be up to 20 MB.
Anyone with the link to an uploaded or public file can open it. Don't use real personal or customer data for testing.