Interface: ImageToBufferOptions
Defined in: packages/agentos/src/io/media/images/imageToBuffer.ts:20
Options for imageToBuffer.
Properties
maxBytes?
optionalmaxBytes:number
Defined in: packages/agentos/src/io/media/images/imageToBuffer.ts:36
For untrusted input: the most bytes the image may have, whether it is fetched or decoded from the string (default 50 MiB).
timeoutMs?
optionaltimeoutMs:number
Defined in: packages/agentos/src/io/media/images/imageToBuffer.ts:38
For an untrusted http(s) URL: how long the fetch may take in milliseconds, redirects and body included (default 30 seconds).
untrusted?
optionaluntrusted:boolean
Defined in: packages/agentos/src/io/media/images/imageToBuffer.ts:31
The input comes from an untrusted source, such as a model's tool call or
a user. A local file path or a file: URL is refused instead of read,
and an http(s) URL is fetched only from a public network address: each
connection's address is checked when the connection is made, so a host
name that resolves to this machine or a private network is refused, and
every redirect is checked the same way. The fetch stops at maxBytes
and timeoutMs, and an image given in the string itself (a data URL,
raw base64) is held to maxBytes too. Default false.