> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Image Agent

> Agent for image analysis and generation

## Installation

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
npm install praisonai
```

## Basic Usage

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { ImageAgent } from 'praisonai';

const agent = new ImageAgent();

const analysis = await agent.analyze({
  imageUrl: 'https://example.com/image.jpg',
  prompt: 'Describe this image in detail'
});

console.log(analysis);
```

## With Configuration

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { ImageAgent } from 'praisonai';

const agent = new ImageAgent({
  name: 'VisionAgent',
  llm: 'openai/gpt-4o',
  verbose: true
});
```

## Analyze Image

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { ImageAgent } from 'praisonai';

const agent = new ImageAgent();

const result = await agent.analyze({
  imageUrl: 'https://example.com/photo.jpg',
  prompt: 'What objects are in this image?',
  detail: 'high'
});

console.log(result);
```

## Chat with Image Context

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { ImageAgent } from 'praisonai';

const agent = new ImageAgent();

// Chat with image
const response = await agent.chat(
  'What colors are prominent in this image?',
  'https://example.com/image.jpg'
);

// Chat without image
const textResponse = await agent.chat('What is machine learning?');
```

## Compare Images

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { ImageAgent } from 'praisonai';

const agent = new ImageAgent();

const comparison = await agent.compare(
  'https://example.com/image1.jpg',
  'https://example.com/image2.jpg',
  'What are the differences between these images?'
);

console.log(comparison);
```

## Detail Levels

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { ImageAgent } from 'praisonai';

const agent = new ImageAgent();

// Low detail - faster, less tokens
await agent.analyze({
  imageUrl: 'https://example.com/image.jpg',
  detail: 'low'
});

// High detail - more accurate
await agent.analyze({
  imageUrl: 'https://example.com/image.jpg',
  detail: 'high'
});

// Auto - let the model decide
await agent.analyze({
  imageUrl: 'https://example.com/image.jpg',
  detail: 'auto'
});
```

## Factory Function

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { createImageAgent } from 'praisonai';

const agent = createImageAgent({
  name: 'MyImageAgent',
  verbose: true
});
```
