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

# PromptExpanderAgent

> Expand and enhance prompts

# PromptExpanderAgent

PromptExpanderAgent expands prompts with more detail and context.

## Quick Start

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

const agent = createPromptExpanderAgent({
  llm: 'openai/gpt-4o-mini'
});

const result = await agent.expand('write a story');
console.log(result.expanded);
```

## Configuration

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
interface PromptExpanderConfig {
  name?: string;
  llm?: string;
  defaultStrategy?: ExpandStrategy;
  verbose?: boolean;
}

type ExpandStrategy = 'detail' | 'context' | 'examples' | 'constraints' | 'auto';
```

## Strategies

| Strategy      | Description                        |
| ------------- | ---------------------------------- |
| `detail`      | Add specific details               |
| `context`     | Add background context             |
| `examples`    | Add example outputs                |
| `constraints` | Add requirements and constraints   |
| `auto`        | Automatically detect best strategy |

## Response Format

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
interface ExpandResult {
  original: string;
  expanded: string;
  strategy: ExpandStrategy;
  additions: string[];
}
```

## Example

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

const agent = createPromptExpanderAgent({
  llm: 'openai/gpt-4o-mini',
  defaultStrategy: 'detail'
});

const result = await agent.expand('write a story');
// Result contains a detailed prompt with:
// - Genre requirements
// - Length specifications
// - Character development guidelines
// - Plot structure
// - Theme requirements
```

## CLI Usage

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts prompt-expand "write a story"
praisonai-ts prompt-expand "create an app" --strategy detail --json
```
