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.
PromptExpanderAgent
PromptExpanderAgent expands prompts with more detail and context.
Quick Start
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
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 |
interface ExpandResult {
original: string;
expanded: string;
strategy: ExpandStrategy;
additions: string[];
}
Example
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
praisonai-ts prompt-expand "write a story"
praisonai-ts prompt-expand "create an app" --strategy detail --json