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

python
def expand(prompt: str, strategy: ExpandStrategy, context: Optional[str]) -> ExpandResult

Parameters

ParamField str

The original user prompt

ParamField ExpandStrategy

Expansion strategy to use

ParamField Optional[str]

Additional context to help with expansion

Returns

ResponseField ExpandResult

ExpandResult containing the expanded prompt

Uses

  • debug
  • strftime
  • datetime.now
  • ExpandResult

Used By

Source

View on GitHub

praisonaiagents/agent/prompt_expander_agent.py at line 301