Prompt Expander Agent • AI Agent SDK

PromptExpanderAgent: Agent for expanding short prompts into detailed, comprehensive prompts.

PromptExpanderAgent

Defined in the Prompt Expander Agent module.

AI Agent

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

Diagram

Input Data

Agent: PromptExpanderAgent

Output Result

Constructor

ParamField str

No description available.

ParamField str

No description available.

ParamField Optional[str]

No description available.

ParamField bool

No description available.

ParamField float

No description available.

ParamField int

No description available.

ParamField Optional

No description available.

Methods

Usage

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

Source

View on GitHub

praisonaiagents/agent/prompt_expander_agent.py at line 62


Related Documentation