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
-
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.
-
Select Prompt management from the left navigation pane. Then, choose a prompt in the Prompts section.
-
Choose Edit in Prompt builder in the Prompt draft section, or choose a version of the prompt in the Versions section.
-
(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.
-
To test your prompt, choose Run in the Test window pane.
-
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:
-
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
asPromptNode
and input the ARN of the prompt using Prompt management in thepromptArn
field. -
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.
-