Expand description
The item image shape every model-batch role shares, its validation, and its canonical form.
An image is a data: URL string or {content_type, base64}. Remote URLs
are never accepted. Validation decodes the base64, so an image a module
admits is one the provider can read, and sizes are the decoded bytes.
The canonical form, {content_type, base64} with the decoded bytes
re-encoded as standard padded base64, is what batch identity hashes: one
image sent in either spelling is the same batch (RULES.md §2, §13).
Modules§
- content_
types - Image content types a provider accepts.
Structs§
- Decoded
Image - An image’s content type and decoded bytes.
- Image
Limits - A model’s image limits per item, as an extractor
role.describeentry states them:{max, max_bytes_each, max_bytes_total, formats}. - Inline
Image - An image in its object form:
{content_type, base64}.
Enums§
- Image
- An image: a
data:URL string, or{content_type, base64}. Remote URLs are never accepted.
Constants§
- IMAGES_
MAX_ TOTAL_ BYTES - Largest total of an item’s images, in decoded bytes (8 MiB).
- IMAGE_
MAX_ BYTES - Largest image, in decoded bytes (4 MiB), as Cloudflare Workers AI states it for its image-taking batch models.
- IMAGE_
MAX_ PIXELS - Largest image, in pixels (16 megapixels). The role crates do not decode
image formats, so this is a runner’s check, not
check_image’s.
Functions§
- check_
image - Check one image against Workers AI’s limits (
ImageLimits::workers_ai). - check_
image_ with - Check one image’s form, content type, base64 and decoded size against
limits, returning its decoded size. The error says why it is refused. - check_
images - Check an item’s images: their count against
limits.max(Nonewhen the model takes no images), each image (check_image_with), and their decoded total.fieldis the item’simagespath (items[i].images); a refusal names it, orfield[j]for one image.