expand • AI Agent SDK
expand: Expand a prompt using the specified strategy.
expand
Method
</div>
This is a method of the PromptExpanderAgent class in the prompt_expander_agent module.
Expand a prompt using the specified strategy.
All operations go through an internal Agent which automatically handles tool calling when tools are provided. The agent decides when to use tools based on the prompt context.
Signature
def expand(prompt: str, strategy: ExpandStrategy, context: Optional[str]) -> ExpandResultParameters
ParamField
strThe original user prompt
ParamField
ExpandStrategyExpansion strategy to use
ParamField
Optional[str]Additional context to help with expansion
Returns
ResponseField
ExpandResultExpandResult containing the expanded prompt
Uses
debugstrftimedatetime.nowExpandResult
Used By
PromptExpanderAgent.expand_basicPromptExpanderAgent.expand_detailedPromptExpanderAgent.expand_structuredPromptExpanderAgent.expand_creative
Source
View on GitHubpraisonaiagents/agent/prompt_expander_agent.py at line 301