Type Alias: ImageSource
@providerprotocol/ai / @providerprotocol/ai / ImageSource
Type Alias: ImageSource
Section titled “Type Alias: ImageSource”ImageSource = {
data:string;type:"base64"; } | {type:"url";url:string; } | {data:Uint8Array;type:"bytes"; }
Defined in: src/types/content.ts:107
Image source variants for ImageBlock.
Images can be provided as base64-encoded strings, URLs, or raw bytes.
Example
Section titled “Example”// Base64 encoded imageconst base64Source: ImageSource = { type: 'base64', data: 'iVBORw0KGgo...'};
// URL referenceconst urlSource: ImageSource = { type: 'url', url: 'https://example.com/image.png'};
// Raw bytesconst bytesSource: ImageSource = { type: 'bytes', data: new Uint8Array([...])};