/** * Vision LLM processing for images. * * Uses Cloudflare Workers AI vision models to generate * descriptions of images for embedding. */ import type { ExtractedImage } from './images.js'; import type { ImageCache } from './image-cache.js'; import type { PageTypeConfig } from './config.js'; import { type PromptType } from './vision-prompts.js'; /** * Processed image with description. */ export interface ProcessedImage { /** Image URL */ src: string; /** Alt text from HTML */ alt: string; /** Generated description from vision LLM */ description: string; /** Prompt type used for generation */ promptType: PromptType; } /** * Vision processing options. */ export interface VisionProcessingOptions { /** Cloudflare account ID */ accountId: string; /** Cloudflare API token */ apiToken: string; /** Vision model to use (default: @cf/meta/llama-3.2-11b-vision-instruct) */ model?: string; /** Page URL for context */ pageUrl?: string; /** Page-type specific configurations */ pageTypes?: PageTypeConfig[]; /** Image cache instance */ cache?: ImageCache; /** Enable verbose logging */ verbose?: boolean; /** Request timeout in ms (default: 60000) */ timeout?: number; } /** * Page context for vision processing. */ export interface PageContext { /** Page title */ title: string; /** Page URL */ url: string; } /** * Process images with vision LLM. * * @param images - Images to process * @param pageContext - Context about the page * @param options - Processing options * @returns Processed images with descriptions */ export declare function processImagesWithVision(images: ExtractedImage[], pageContext: PageContext, options: VisionProcessingOptions): Promise; /** * Format processed images as content for embedding. * * Creates a structured text representation of image descriptions * that can be appended to page content. */ export declare function formatImageDescriptions(images: ProcessedImage[]): string; //# sourceMappingURL=vision.d.ts.map