prompt_expander_agent
AI Agent Prompt Expander Agent Module This module provides the PromptExpanderAgent class for expanding short prompts into detailed, comprehensive prompts for better task execution. Unlike QueryRewriterAgent (which optimizes queries for search/retrieval), PromptExpanderAgent focuses on enriching prompts for task execution. Supported Expansion Strategies:- BASIC: Simple expansion with clarity improvements
- DETAILED: Rich expansion with context, constraints, and examples
- STRUCTURED: Expansion with clear structure (task, format, requirements)
- CREATIVE: Expansion with creative flair and vivid language
- AUTO: Automatically selects the best strategy based on prompt analysis
Basic expansion
result = agent.expand(“write a movie script in 3 lines”) print(result.expanded_prompt)Detailed expansion
result = agent.expand(“blog about AI”, strategy=ExpandStrategy.DETAILED) print(result.expanded_prompt)With tools for context gathering
from praisonaiagents.tools import internet_search agent = PromptExpanderAgent(tools=[internet_search]) result = agent.expand(“latest AI developments”)Import
Classes
ExpandStrategy
Enumeration of available prompt expansion strategies.
ExpandResult
Result of a prompt expansion operation.
PromptExpanderAgent
Agent for expanding short prompts into detailed, comprehensive prompts.

