/** * VisionAgent - Image analysis and understanding agent * * Python parity with praisonaiagents/agent/vision_agent.py * Analyzes images using vision-capable LLMs. */ /** * Configuration for Vision settings. */ export interface VisionConfig { /** Maximum image size in pixels */ maxImageSize?: number; /** Image quality for processing */ quality?: 'low' | 'high' | 'auto'; /** Detail level for analysis */ detail?: 'low' | 'high' | 'auto'; /** Timeout in seconds */ timeout?: number; } /** * Result of vision analysis. */ export interface VisionResult { /** Analysis description */ description: string; /** Detected objects */ objects?: string[]; /** Detected text (if any) */ text?: string; /** Confidence score */ confidence?: number; /** Additional metadata */ metadata?: Record; } /** * Configuration for creating a VisionAgent. */ export interface VisionAgentConfig { /** Agent name */ name?: string; /** LLM model (must support vision) */ llm?: string; /** Vision configuration */ vision?: boolean | VisionConfig; /** System instructions */ instructions?: string; /** Enable verbose output */ verbose?: boolean; } /** * Agent for image analysis and understanding. * * Uses vision-capable LLMs to analyze images and answer questions about them. * * @example * ```typescript * import { VisionAgent } from 'praisonai'; * * const agent = new VisionAgent({ llm: 'gpt-4o' }); * * // Analyze an image * const result = await agent.analyze('https://example.com/image.jpg'); * console.log(result.description); * * // Ask a question about an image * const answer = await agent.ask('What objects are in this image?', 'https://example.com/image.jpg'); * ``` */ export declare class VisionAgent { static readonly DEFAULT_MODEL = "gpt-4o"; readonly name: string; private readonly llm; private readonly instructions?; private readonly verbose; private readonly visionConfig; private readonly agent; constructor(config: VisionAgentConfig); private buildSystemPrompt; private log; /** * Analyze an image and return a detailed description. * * @param imageUrl - URL of the image to analyze * @returns VisionResult with description and detected elements */ analyze(imageUrl: string): Promise; /** * Ask a question about an image. * * @param question - Question to ask about the image * @param imageUrl - URL of the image * @returns Answer to the question */ ask(question: string, imageUrl: string): Promise; /** * Describe the contents of an image. * * @param imageUrl - URL of the image * @returns Description of the image */ describe(imageUrl: string): Promise; /** * Detect objects in an image. * * @param imageUrl - URL of the image * @returns List of detected objects */ detectObjects(imageUrl: string): Promise; /** * Extract text from an image. * * @param imageUrl - URL of the image * @returns Extracted text */ extractText(imageUrl: string): Promise; } /** * Create a VisionAgent instance. */ export declare function createVisionAgent(config: VisionAgentConfig): VisionAgent;