prompt
Send a prompt to the AI and get a response.
Note: for document types covered by the specialized parsers (parse_nfe,
parse_boleto, parse_bank_statement, ...), prefer those. For other text-heavy
documents (contracts, reports, official letters), prefer extracting the text
first with extract_text and passing the resulting string — more reliable than
passing the document Path directly. Pass file Paths directly only for visual
content (photos, screenshots, layouts).
Image limit: a PDF is rendered to one image per page before being sent, so
page count is image count. Requests carrying more than 50 images are rejected
by some providers (Azure allows at most 50) and only succeed on a provider
that accepts them, which costs a wasted attempt and extra latency. For
documents longer than ~50 pages use extract_text and pass the text, or send
the pages in batches.
Raises:
ValueError: If temperature is not between 0.0 and 2.0.
Parameters
| Name | Description | Type | Default |
|---|---|---|---|
| prompt (required) | The prompt(s) to send to the AI model. A PDF Path is expanded to one image per page, so a document over 50 pages exceeds what some providers accept. | Union[Prompt, List[Prompt]] | None |
| instructions | Additional instructions for the AI. Defaults to []. | Union[str, List[str]] | [] |
| format | The expected format for the AI response. Defaults to None. | Format | None |
| temperature | Deprecated — our most capable models run at a fixed temperature and ignore this value. Range 0.0 to 2.0; defaults to 1.0. | float | 1.0 |
Return Value
Any