Test a prompt using Prompt management (original) (raw)

To learn how to test a prompt you created in Prompt management, choose the tab for your preferred method, and then follow the steps:

Console

To test a prompt in Prompt management
  1. Sign in to the AWS Management Console with an IAM identity that has permissions to use the Amazon Bedrock console. Then, open the Amazon Bedrock console athttps://console.aws.amazon.com/bedrock.
  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.

You can also test the prompt in the following ways:

API

You can test your prompt in the following ways:

response = bedrock_runtime.converse(  
    modelId="arn:aws:bedrock:us-east-1:123456789012:prompt/PROMPT_ID:VERSION",  
    promptVariables={  
        "variable_name": {"text": "value"}  
    }  
)  

When invoking a managed prompt, you don't need to specify messages or system fields — these are defined in the prompt template. You only need to provide values for the variables defined in the prompt. For a complete example, see Run Prompt management code samples.

Note

The following restrictions apply when you use a Prompt management prompt with Converse or ConverseStream:

Modify a prompt

Optimize a prompt

Did this page help you? - Yes

Thanks for letting us know we're doing a good job!

If you've got a moment, please tell us what we did right so we can do more of it.

Did this page help you? - No

Thanks for letting us know this page needs work. We're sorry we let you down.

If you've got a moment, please tell us how we can make the documentation better.