/** * Multimodal - AI SDK Wrapper * * Provides utilities for multimodal inputs (images, files, PDFs). */ export type InputPart = TextPart | ImagePart | FilePart | PdfPart; export interface TextPart { type: 'text'; text: string; } export interface ImagePart { type: 'image'; /** Image data as URL, base64 string, or Uint8Array */ image: string | Uint8Array | URL; /** MIME type (auto-detected if not provided) */ mimeType?: string; } export interface FilePart { type: 'file'; /** File data as URL, base64 string, or Uint8Array */ data: string | Uint8Array | URL; /** MIME type (required) */ mimeType: string; /** File name (optional) */ name?: string; } export interface PdfPart { type: 'pdf'; /** PDF data as URL, base64 string, or Uint8Array */ data: string | Uint8Array | URL; /** Page range to extract (optional) */ pages?: { start?: number; end?: number; }; /** Extract text only (default: false) */ textOnly?: boolean; } /** * Create a text part. */ export declare function createTextPart(text: string): TextPart; /** * Create an image part from various sources. * * @example From URL * ```typescript * const imagePart = createImagePart('https://example.com/image.png'); * ``` * * @example From base64 * ```typescript * const imagePart = createImagePart('data:image/png;base64,...'); * ``` * * @example From file path * ```typescript * const imagePart = await createImagePart('./image.png'); * ``` */ export declare function createImagePart(source: string | Uint8Array | URL, mimeType?: string): ImagePart; /** * Create a file part from various sources. * * @example * ```typescript * const filePart = createFilePart('./document.txt', 'text/plain'); * ``` */ export declare function createFilePart(source: string | Uint8Array | URL, mimeType: string, name?: string): FilePart; /** * Create a PDF part from various sources. * * @example * ```typescript * const pdfPart = createPdfPart('./document.pdf'); * ``` * * @example With page range * ```typescript * const pdfPart = createPdfPart('./document.pdf', { pages: { start: 1, end: 5 } }); * ``` */ export declare function createPdfPart(source: string | Uint8Array | URL, options?: { pages?: { start?: number; end?: number; }; textOnly?: boolean; }): PdfPart; /** * Convert input parts to AI SDK message content format. */ export declare function toMessageContent(parts: InputPart[]): any[]; /** * Create a multimodal message with text and images. * * @example * ```typescript * const message = createMultimodalMessage( * 'What is in this image?', * ['https://example.com/image.png'] * ); * ``` */ export declare function createMultimodalMessage(text: string, images: (string | Uint8Array | URL)[], role?: 'user' | 'assistant'): { role: string; content: any[]; }; /** * Convert a base64 string to Uint8Array. */ export declare function base64ToUint8Array(base64: string): Uint8Array; /** * Convert Uint8Array to base64 string. */ export declare function uint8ArrayToBase64(bytes: Uint8Array): string; /** * Check if a string is a valid URL. */ export declare function isUrl(str: string): boolean; /** * Check if a string is a data URL. */ export declare function isDataUrl(str: string): boolean;