Arcana::AI::Chat::ImagePart
An image in a chat message: a URL for the provider to fetch (https, or a data URL), or the bytes themselves.
Message.user("What does this picture show?", images: [ ImagePart.file("room.webp", detail: "low"), ImagePart.url("https://bucket.example/room.webp"), ])
Providers take them differently: OpenAI gets a URL (bytes as a data
URL) and is the only one to use detail; Anthropic gets the bytes,
or fetches an https URL itself; Gemini needs the bytes and can't
fetch an https URL.
Constructors
Read an image file; the media type comes from its extension.
Instance methods
data
Sourcedetail
Sourceinline
The image as {media_type, base64 data}: the bytes, or the payload of a data URL. Nil for a URL the provider has to fetch.
media_type
Sourceurl
Source