Test a prompt using Prompt management - Amazon Bedrock

Test a prompt using Prompt management

Note

Prompt management is in preview and is subject to change.

To learn how to test a prompt in your Prompt Library, select the tab corresponding to your method of choice and follow the steps:

Console
To test 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. Choose Edit in Prompt builder in the Prompt draft section, or choose a version of the prompt in the Versions section.

  4. (Optional) To provide values for variables in your prompt, you need to first select a model in the Configurations pane. Then, enter a Test value for each variable in the Test variables pane.

    Note

    These test values are temporary and aren't saved if you save your prompt.

  5. To test your prompt, choose Run in the Test window pane.

  6. Modify your prompt or its configurations and then run your prompt again as necessary. If you're satisfied with your prompt, you can choose Create version to create a snapshot of your prompt that can be used in production. For more information, see Deploy a prompt to your application using versions in Prompt management.

API

To test your prompt through the Amazon Bedrock API, do the following:

  1. Create or edit a flow by sending a CreateFlow or UpdateFlow Agents for Amazon Bedrock build-time endpoint. Include a prompt node configured to call the prompt by including a SDK for JavaScript in Node.js object of the following format in the nodes list:

    { "config": { "promptNodeConfig": { "libraryPromptConfig": { "promptArn": "string", } } }, "description": "string", "inputs": [ { "expression": "string", "name": "string", "type": "string" } ], "name": "string", "outputs": [ { "name": "string", "type": "string" } ], "type": "PromptNode" }

    Specify the type as PromptNode and input the ARN of the prompt using Prompt management in the promptArn field.

  2. Send an InvokeFlow request (see link for request and response formats and field details) with an Agents for Amazon Bedrock runtime endpoint. For more information, see LINK TO FLOWS.