Skip to main content

PromptExpanderAgent

Defined in the prompt_expander_agent module.
Agent for expanding short prompts into detailed, comprehensive prompts. This agent transforms brief task descriptions into rich, detailed prompts that provide better context and guidance for task execution. Key difference from QueryRewriterAgent:
  • QueryRewriterAgent: Optimizes queries for search/retrieval (RAG)
  • PromptExpanderAgent: Expands prompts for detailed task execution
Attributes: name: Name of the agent model: LLM model to use for expansion (alias for llm=) temperature: Temperature for LLM generation (higher = more creative) tools: Optional tools for context gathering

Constructor

name
str
default:"'PromptExpanderAgent'"
No description available.
model
str
default:"'gpt-4o-mini'"
No description available.
instructions
Optional
No description available.
verbose
bool
default:"False"
No description available.
temperature
float
default:"0.7"
No description available.
max_tokens
int
default:"1000"
No description available.
tools
Optional
No description available.

Methods

Usage

agent = PromptExpanderAgent(model="gpt-4o-mini")
    result = agent.expand("write a poem", strategy=ExpandStrategy.CREATIVE)
    print(result.expanded_prompt)