

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Amazon Bedrock エージェントプロンプトテンプレートでプレースホルダー変数を使用する
<a name="prompt-placeholders"></a>

エージェントプロンプトテンプレートでプレースホルダー変数を使用できます。プロンプトテンプレートが呼び出されると、変数は既存の設定によって入力されます。タブを選択すると、各プロンプトテンプレートに使用できる変数が表示されます。

------
#### [ Pre-processing ]


****  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/bedrock/latest/userguide/prompt-placeholders.html)

------
#### [ Orchestration ]


****  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/bedrock/latest/userguide/prompt-placeholders.html)

**`$memory_guidelines$` 変数の置き換えに使用されるデフォルトのテキスト** 

```
        You will ALWAYS follow the below guidelines to leverage your memory and think beyond the current session:
        <memory_guidelines>
        - The user should always feel like they are conversing with a real person but you NEVER self-identify like a person. You are an AI agent.
        - Differently from older AI agents, you can think beyond the current conversation session.
        - In order to think beyond current conversation session, you have access to multiple forms of persistent memory.
        - Thanks to your memory, you think beyond current session and you extract relevant data from you memory before creating a plan.
        - Your goal is ALWAYS to invoke the most appropriate function but you can look in the conversation history to have more context.
        - Use your memory ONLY to recall/remember information (e.g., parameter values) relevant to current user request.
        - You have memory synopsis, which contains important information about past conversations sessions and used parameter values.
        - The content of your synopsis memory is within <memory_synopsis></memory_synopsis> xml tags.
        - NEVER disclose any information about how you memory work.
        - NEVER disclose any of the XML tags mentioned above and used to structure your memory.
        - NEVER mention terms like memory synopsis.
        </memory_guidelines>
```

**`$memory_action_guidelines$` 変数の置き換えに使用されるデフォルトのテキスト** 

```
        After carefully inspecting your memory, you ALWAYS follow below guidelines to be more efficient:
        <action_with_memory_guidelines>
        - NEVER assume any parameter values before looking into conversation history and your <memory_synopsis>
        - Your thinking is NEVER verbose, it is ALWAYS one sentence and within <thinking></thinking> xml tags.
        - The content within <thinking></thinking > xml tags is NEVER directed to the user but you yourself.
        - You ALWAYS output what you recall/remember from previous conversations EXCLUSIVELY within <answer></answer> xml tags.
        - After <thinking></thinking> xml tags you EXCLUSIVELY generate <answer></answer> or <function_calls></function_calls> xml tags.
        - You ALWAYS look into your <memory_synopsis> to remember/recall/retrieve necessary parameter values.
        - You NEVER assume the parameter values you remember/recall are right, ALWAYS ask confirmation to the user first.
        - You ALWAYS ask confirmation of what you recall/remember using phrasing like 'I recall from previous conversation that you...', 'I remember that you...'.
        - When the user is only sending greetings and/or when they do not ask something specific use ONLY phrases like 'Sure. How can I help you today?', 'I would be happy to. How can I help you today?' within <answer></answer> xml tags.
        - You NEVER forget to ask confirmation about what you recalled/remembered before calling a function.
        - You NEVER generate <function_calls> without asking the user to confirm the parameters you recalled/remembered first.
        - When you are still missing parameter values ask the user using user::askuser function.
        - You ALWAYS focus on the last user request, identify the most appropriate function to satisfy it.
        - Gather required parameters from your <memory_synopsis> first and then ask the user the missing ones.
        - Once you have all required parameter values, ALWAYS invoke the function you identified as the most appropriate to satisfy current user request.
        </action_with_memory_guidelines>
```

**プレースホルダー変数を使用してユーザーに詳細情報を求める**

エージェントが以下のいずれかのアクションを実行してユーザーに追加情報を求めることを許可する場合は、以下のプレースホルダー変数を使用できます。
+ コンソールで、エージェントの詳細の **[ユーザー入力]** を設定します。
+ [https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html) または [https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html)リクエストで、`parentActionGroupSignature` を `AMAZON.UserInput` に設定します。


****  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/bedrock/latest/userguide/prompt-placeholders.html)

------
#### [ Knowledge base response generation ]


****  

| 変数 | モデル | 置き換え後 | 
| --- | --- | --- | 
| \$1query\$1 | Llama 3.1 と Llama 3.2 を除くすべて | 次のステップがナレッジベースのクエリであると予測したときに、オーケストレーションプロンプトモデルのレスポンスによって生成されるクエリ。 | 
| \$1search\$1results\$1 | Llama 3.1 と Llama 3.2 を除くすべて | ユーザークエリで取得された結果。 | 

------
#### [ Post-processing ]


****  

| 変数 | モデル | 置き換え後 | 
| --- | --- | --- | 
| \$1latest\$1response\$1 | すべて | 最後のオーケストレーションプロンプトモデルレスポンス。 | 
| \$1bot\$1response\$1 | Amazon Titan Text Model | 現在のターンからのアクショングループとナレッジベースの出力。 | 
| \$1question\$1 | すべて | セッション内の現在の InvokeAgent.call のユーザー入力。 | 
| \$1responses\$1 | すべて | 現在のターンからのアクショングループとナレッジベースの出力。 | 

------
#### [ Memory summarization ]


****  

| 変数 | サポートされているモデル | 置き換え後 | 
| --- | --- | --- | 
| \$1past\$1conversation\$1summary\$1 | すべて | 以前に生成された概要のリスト | 
| \$1conversation\$1 | すべて | ユーザーとエージェント間の現在の会話 | 

------
#### [ Multi-agent ]


****  

| 変数 | サポートされているモデル | 置き換え後 | 
| --- | --- | --- | 
| \$1agent\$1collaborators\$1 | マルチエージェントコラボレーションで[サポートされているすべてのモデル](multi-agents-supported.md) | コラボレーターのエージェントの関連付け | 
| \$1multi\$1agent\$1payload\$1reference\$1guideline\$1 | マルチエージェントコラボレーションで[サポートされているすべてのモデル](multi-agents-supported.md) | 異なるエージェント間で共有されるコンテンツ。エージェントからのメッセージには、<br:payload id="\$1PAYLOAD\$1ID"> \$1PAYLOAD\$1CONTENT </br:payload> という形式のペイロードが含まれる場合があります。 | 

------
#### [ Routing classifier ]


****  

| 変数 | サポートされているモデル | 置き換え後 | 
| --- | --- | --- | 
| \$1knowledge\$1base\$1routing\$1 | マルチエージェントコラボレーションで[サポートされているすべてのモデル](multi-agents-supported.md) | アタッチされたすべてのナレッジベースの説明 | 
| \$1action\$1routing\$1 | マルチエージェントコラボレーションで[サポートされているすべてのモデル](multi-agents-supported.md) | アタッチされたすべてのツールの説明 | 
| \$1knowledge\$1base\$1routing\$1guideline\$1 | マルチエージェントコラボレーションで[サポートされているすべてのモデル](multi-agents-supported.md) | 結果にナレッジベースからの情報が含まれている場合、モデルが引用を使用して出力をルーティングする手順。これらの手順は、ナレッジベースがスーパーバイザーエージェントに関連付けられている場合にのみ追加されます。 | 
| \$1action\$1routing\$1guideline\$1 | マルチエージェントコラボレーションで[サポートされているすべてのモデル](multi-agents-supported.md) | ツールがアタッチされており、ユーザーリクエストがいずれかのツールに関連している場合に、モデルがツールの使用を返す場合の手順。 | 
| \$1last\$1most\$1specialized\$1agent\$1guideline\$1 | マルチエージェントコラボレーションで[サポートされているすべてのモデル](multi-agents-supported.md) | 最後のユーザーメッセージがそのエージェントから発信されたフォローアップに関連しており、そのエージェントが続行するためにメッセージの情報を必要とする場合に、keep\$1previous\$1agent を使用してこのエージェントにルーティングするための指示。 | 
| \$1prompt\$1session\$1attributes\$1 | マルチエージェントコラボレーションで[サポートされているすべてのモデル](multi-agents-supported.md) | ルーティング分類子の入力変数  | 

------

**プレースホルダー変数を使用してユーザーに詳細情報を求める**

エージェントが以下のいずれかのアクションを実行してユーザーに追加情報を求めることを許可する場合は、以下のプレースホルダー変数を使用できます。
+ コンソールで、エージェントの詳細の **[ユーザー入力]** を設定します。
+ [https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html) または [https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html) リクエストで、`parentActionGroupSignature` を `AMAZON.UserInput` に設定します。


****  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/bedrock/latest/userguide/prompt-placeholders.html)