💬 Chat with PDF
Drop a PDF or paste its text, then ask a question about the document.
A question, a text slice, a completion
Chat requires a question. The page extracts text from the file you dropped, then POSTs {task:"chat", text, question} to /api/ai. The Worker prompt tells the model to use only that document and to say when the answer is not in it. Temperature is 0.3 and the completion budget is about 1,800 tokens. The text cap is 30,000 characters. A long contract is silently shortened before the model sees it, which is why a careful question on the wrong half of the file sounds specific and is about something else.
The call is HTTPS. There is no transcript database in the Worker. Clear the page when you are done; the tab still holds the text until you do. Do not paste a second client’s file into a box that still contains the first.
| Chat | |
|---|---|
| Required | A question. The button errors without one |
| Grounding | Instructed to stay inside the supplied text |
| Caps | 30,000 characters of text, 4,000 of question |
| Images | Not read unless you OCR them first |
Questions with a page number
A renewal date
Ask for the date and the clause label. Then open that page. A date that is “typically” twelve months is not a date from the file.
A defined term used twice
Ask where it is defined, not what it “usually” means. If the answer cites two clauses, read both. The second may override the first.
A missing exhibit
Ask whether exhibit C is in the text. A correct “not in the supplied text” is a useful answer. An invented exhibit C is a failure of the test you should have run first.
A scan of a signed page
Chat will not see the signature image. OCR is a different task. Do not ask chat to “read the signature” on a text extract that never included it.
Split, ask, search
- Confirm you can highlight text. Split to the section the question is about.
- Type a question that names the fact, not “summarize this.”
- Generate. Search the PDF for a distinctive word from the answer.
- If the word is missing, discard the answer. Clear the box before the next document.
Chat with a contract is the clause that was not in the paste.
A question you already know the answer to
Before you trust a clause, ask for a heading that is not in the file. The prompt tells the model to say the document does not contain the answer. If it invents a heading, stop. Then ask the real question on a split that fits in 30,000 characters. A precise answer about the wrong half of a contract is the failure mode this page is built to allow if you skip the split.
Frequently asked questions
Will it admit when the clause is not in the file?
The prompt says: answer using only the supplied document, and if the document does not contain the answer, say so. Test it. Ask for a term you know is absent. If it invents one, do not trust the next answer either. The instruction is real. Compliance is not guaranteed on every completion.
Why does a question about page 90 fail on a long contract?
Text is sliced at 30,000 characters and the question at 4,000. Page 90 may never have been sent. Split to the section that contains the clause, then ask again. A question about “the agreement” against a truncated paste answers a different document.
Does chat see images and stamps?
It sees extracted text, plus anything you typed. A stamp that is only ink is invisible. OCR that page if the stamp is the fact you need, and say in the question that the line came from OCR.
Is this legal advice?
No. It is a completion constrained, imperfectly, to the text you sent. A definition of “material” in clause 2 may not be the definition a later clause uses. Read the clause. Do not forward the chat line as counsel’s view.
Where does the contract go?
To /api/ai as JSON, task chat, with the question. The Worker does not store it. You still transmitted it. Redact account numbers you do not need for the question.
The answer quoted a sentence I cannot find.
Search the PDF for a rare word from the quote. If it is not there, the model wrote it. Ask again on a shorter excerpt, or stop using that answer.