Use this file to discover all available pages before exploring further.
The Prompt Expander Agent transforms short, brief prompts into detailed, comprehensive prompts for better task execution. Unlike the Query Rewriter (which optimizes for search/retrieval), the Prompt Expander focuses on enriching prompts for task execution.Agents: 1 — Specialized agent for prompt enhancement.
from praisonaiagents import PromptExpanderAgentagent = PromptExpanderAgent()result = agent.expand("write a movie script in 3 lines")print(result.expanded_prompt)
# Expand a short promptpraisonai "write a movie script in 3 lines" --expand-prompt# With verbose outputpraisonai "blog about AI" --expand-prompt -v# With tools for context gatheringpraisonai "latest AI trends" --expand-prompt --expand-tools tools.py
framework: praisonaitopic: Prompt Expansionroles: expander: role: Prompt Expander goal: Transform short prompts into detailed prompts backstory: You are an expert at prompt engineering tasks: expand: description: Expand "write a movie script" into a detailed prompt expected_output: Detailed, actionable prompt
from praisonaiagents import PromptExpanderAgentagent = PromptExpanderAgent()# Note: PromptExpanderAgent uses .expand() method# For API serving, integrate with standard agent
from praisonaiagents import PromptExpanderAgentdef search_tool(query: str) -> str: """Search for context.""" # Your search implementation return "Latest AI trends: LLMs, multimodal, agents"agent = PromptExpanderAgent(tools=[search_tool])result = agent.expand("write about AI trends")print(result.expanded_prompt)
result = agent.expand("write a poem")# Access propertiesprint(result.original_prompt) # Original inputprint(result.expanded_prompt) # Expanded outputprint(result.strategy_used) # Strategy that was usedprint(result.metadata) # Additional metadata
Craft a captivating movie script distilled into just three powerful lines, each word infused with vivid imagery and emotional weight. Your lines should ignite the spark of adventure and intrigue, capturing a moment that hints at a grand journey ahead—one that resonates deeply with the audience's hearts and imaginations. Use poignant dialogue, evocative descriptions, and a tantalizing glimpse of conflict that will leave viewers breathless.