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§
- Read
File Tool - 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_filereturns 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
byteswhen they start like a PNG, JPEG, GIF, WebP or PDF (spec 3.1 §10 D6: magic bytes, not the extension).