Use placeholder variables in Amazon Bedrock agent prompt templates
You can use placeholder variables in agent prompt templates. The variables will be populated by pre-existing configurations when the prompt template is called. Select a tab to see variables that you can use for each prompt template.
Tip
To see what a placeholder variable resolves to for your specific agent, open the agent in the Amazon Bedrock console, navigate to the Advanced prompts section, and enable the prompt template you want to inspect. The console displays the resolved prompt with all placeholders filled in based on your agent's current configuration (action groups, knowledge bases, collaborators, etc.).
Variables in the Routing classifier tab (such as $action_routing$ and $knowledge_base_routing$) apply only to agents that use multi-agent collaboration. Variables in the Orchestration tab apply to all agents.
Using place holder variables to ask user for more information
You can use the following placeholder variables if you allow the agent to ask the user for more information by doing one of the following actions:
-
In the console, set in the User input in the agent details.
-
Set the
parentActionGroupSignaturetoAMAZON.UserInputwith a CreateAgentActionGroup or UpdateAgentActionGroup request.
| Variable | Models supported | Replaced by |
|---|---|---|
| $ask_user_missing_parameters$ | Anthropic Claude Instant, Claude v2.0 | Instructions for the model to ask the user to provide required missing information. |
| $ask_user_missing_information$ | Anthropic Claude v2.1, Claude 3 Sonnet, Claude 3 Haiku, Claude 3 Opus | |
| $ask_user_confirm_parameters$ | Anthropic Claude Instant, Anthropic Claude v2.0 | Instructions for the model to ask the user to confirm parameters that the agent hasn't yet received or is unsure of. |
| $ask_user_function$ | Anthropic Claude Instant, Anthropic Claude v2.0 | A function to ask the user a question. |
| $ask_user_function_format$ | Anthropic Claude Instant, Anthropic Claude v2.0 | The format of the function to ask the user a question. |
| $ask_user_input_examples$ | Anthropic Claude Instant, Anthropic Claude v2.0 | Few-shot examples to inform the model how to predict when it should ask the user a question. |