Expand description
Image-attachment wire-shape types + validation, shared between forge-agent and a view.
Re-exportsΒ§
use serde::Deserialize;πuse serde::Deserialize;πuse serde::Serialize;πuse serde::Serialize;πuse crate::content::ContentBlock;πuse crate::messages::Extras;π
StructsΒ§
- Image
Attachment - A pending image attachment: base64-encoded data and its MIME type.
ConstantsΒ§
- SUPPORTED_
IMAGE_ MIME_ TYPES - MIME types the Anthropic Vision API accepts as image attachments.
FunctionsΒ§
- display_
blocks - The image blocks a promptβs attachments draw as: the ones the sender would keep, in the order they were sent, each carrying the mime and the measured size rather than its payload.
- is_
supported_ image_ type - Returns
trueifmime_typeis a supported image MIME type. - is_
valid_ base64 - Returns
trueifdatais non-empty, correctly padded, and decodes as valid standard base64. - payload_
bytes - The bytes a base64 payload stands for: four characters carry three, and padding is not a byte.
- validate_
image - Validate an image attachment before sending to the API.