Manage prompts using Prompt management - Amazon Bedrock

Manage prompts using Prompt management

Note

Prompt management is in preview and is subject to change.

You can view information about prompts using Prompt management, edit them, or delete them.

View information about prompts using Prompt management

To learn how to view information about prompts using Prompt management, select the tab corresponding to your method of choice and follow the steps.

Console
To view information about a prompt
  1. Sign in to the AWS Management Console using an IAM role with Amazon Bedrock permissions, and open the Amazon Bedrock console at Getting Started with the AWS Management Console.

  2. Select Prompt management from the left navigation pane. Then, choose a prompt in the Prompts section.

  3. The Prompt details page includes the following sections:

    • Overview – Contains general information about the prompt and when it was created and last updated.

    • Prompt draft – Contains the prompt message and configurations for the latest saved draft version of the prompt.

    • Prompt versions – A list of all versions of the prompt that have been created. For more information about prompt versions, see Deploy prompts using Prompt management by creating versions.

API

To get information about a prompt, send a GetPrompt request (see link for request and response formats and field details) with an Agents for Amazon Bedrock build-time endpoint and specify the ARN or ID of the prompt as the promptIdentifier. To get information about a specific version of the prompt, specify DRAFT or the version number in the promptVersion field.

To list information about your agents, send a ListPrompts request (see link for request and response formats and field details) with an Agents for Amazon Bedrock build-time endpoint. You can specify the following optional parameters:

Field Short description
maxResults The maximum number of results to return in a response.
nextToken If there are more results than the number you specified in the maxResults field, the response returns a nextToken value. To see the next batch of results, send the nextToken value in another request.

Edit a prompt using Prompt management

To learn how to edit prompts using Prompt management, select the tab corresponding to your method of choice and follow the steps.

Console
To edit a prompt
  1. Sign in to the AWS Management Console using an IAM role with Amazon Bedrock permissions, and open the Amazon Bedrock console at Getting Started with the AWS Management Console.

  2. Select Prompt management from the left navigation pane. Then, choose a prompt in the Prompts section.

  3. To edit the Name or Description of the prompt, choose Edit in the Overview section. After you make your edits, choose Save.

  4. To edit the prompt and its configurations, choose Edit in prompt builder

  5. In the Prompt pane, enter a prompt in the Message box. You can use double curly braces to include variables (as in {{variable}}). Note the following about prompt variables:

    • Each variable that you include appears in the Test variables section.

    • You can replace these variables with actual values when testing the prompt or when configuring the prompt in a prompt flow.

  6. (Optional) You can modify your prompt in the following ways:

    • In the Configurations pane, choose a Model for running inference and set the Inference parameters.

    • To compare different variants of your prompt, choose Actions and select Compare prompt variants. You can do the following on the comparison page:

      • To add a variant, choose the plus sign. You can add up to three variants.

      • After you specify the details of a variant, you can specify any Test variables and choose Run to test the output of the variant.

      • To delete a variant, choose the three dots and select Remove from compare.

      • To replace the working draft and leave the comparison mode, choose Save as draft. All the other variants will be deleted.

      • To leave the comparison mode, choose Exit compare mode.

  7. You have the following options when you're finished configuring the prompt:

API

To edit a prompt, send an UpdatePrompt request (see link for request and response formats and field details) with an Agents for Amazon Bedrock build-time endpoint. Include both fields that you want to maintain and fields that you want to change.

Delete a prompt using Prompt management

To learn how to delete a prompt using Prompt management, select the tab corresponding to your method of choice and follow the steps.

Console

If you're in the Prompt details page for a prompt or in the prompt builder, choose Delete to delete a prompt.

Note

If you delete a prompt, all its versions will also be deleted. Any resources using your prompt might experience runtime errors. Remember to disassociate the prompt from any resources using it.

To delete a prompt
  1. Sign in to the AWS Management Console using an IAM role with Amazon Bedrock permissions, and open the Amazon Bedrock console at Getting Started with the AWS Management Console.

  2. Select Prompt management from the left navigation pane.

  3. Select a prompt and choose Delete.

  4. Review the warning that appears, type confirm, and then choose Delete.

API

To delete a prompt, send a DeletePrompt request (see link for request and response formats and field details) with an Agents for Amazon Bedrock build-time endpoint and specify the ARN or ID of the prompt as the promptIdentifier. To delete a specific version of the prompt, specify the version number in the promptVersion field.