image-agent.ts
1 /** 2 * Image Agent Example 3 * Demonstrates image analysis capabilities 4 */ 5 6 import { ImageAgent, createImageAgent } from 'praisonai'; 7 8 async function main() { 9 const agent = createImageAgent({ 10 name: 'VisionAgent', 11 llm: 'openai/gpt-4o-mini', 12 verbose: true 13 }); 14 15 console.log('Image Agent created:', agent.name); 16 17 // Note: For actual image analysis, provide a real image URL 18 // const analysis = await agent.analyze({ 19 // imageUrl: 'https://example.com/image.jpg', 20 // prompt: 'Describe this image in detail' 21 // }); 22 // console.log('Analysis:', analysis); 23 24 // Chat without image 25 const response = await agent.chat('What types of images can you analyze?'); 26 console.log('Response:', response); 27 } 28 29 main().catch(console.error);