Skip to main content

Module read

Module read 

Source
Expand description

read_file — return the (optionally sliced) contents of a file, or an image or PDF as inline data (spec 3.1 §10 D6).

Structs§

ReadFileTool
Reads a file from the workspace: UTF-8 text with line numbers, or a PNG, JPEG, GIF, WebP or PDF as an inline data part the model can look at (spec 3.1 §10 D6).

Constants§

DEFAULT_MAX_INLINE_BYTES
The largest image or PDF read_file returns as inline data by default: 4 MiB (spec 3.1 §10 D6). A larger file gets the text stub only.

Functions§

sniff_inline_mime
The MIME type of bytes when they start like a PNG, JPEG, GIF, WebP or PDF (spec 3.1 §10 D6: magic bytes, not the extension).