Amazon Bedrock Studio is in preview release and is subject to change.
Create a prompt with Prompt Management
When you create a prompt, you select a model for it and can modify inference parameters. To adjust the prompt for different use cases, you can include up to 5 variables.
You define variables in a prompt by surrounding them in double curly braces
{{
. For example, the following prompt defines
two variables, variable
}}topic
and location
.
Generate a playlist of songs about {{topic
}}. Make sure each song is
by artists from {{location
}}.
When you run the prompt, you supply values for the variables. Bedrock Studio fills the prompt
with the variable values and then passes the prompt to the model. For example, if you supply a
topic
value of castle and a location
value of
Wales, the model generates a playlist of songs about castles by Welsh artists.
You initially create a draft of your prompt. You can then test your prompt by inputing test values for the variables and running the prompt. These values are only for temporary testing and aren't saved to your prompt.
When you are ready, you can create a version of your prompt for use in a Prompt Flows app. You can create multiple versions of a prompt, but you can only edit the latest version. When you delete a prompt, it deletes all versions of the prompt.
Warning
The name and description of a prompt are visible to all members of the Amazon Bedrock workspace. We recommend that you don't store sensitive data in these two fields. Project-based access control ensures only authorized members of a project can edit the name, description, and other fields in the project.
To create a prompt
-
Open your Amazon Bedrock Studio workspace.
-
Make sure that you are in Build mode, by choosing Build at the top right of the page.
-
In the Project dropdown list, choose the project that you want to use or create a new project.
-
Open the navigation pane by choosing the menu at the top left of the page.
-
In Project details choose Prompts.
-
Choose Create prompt to start creating a prompt.
-
Choose the prompt name (Untitled Prompt-nnnn) and enter a name for the prompt.
-
In the Configs section, do the following:
-
For Model, select the model that you want to use.
-
(Optional) In Parameters, set the inference parameters values that you want to use. If you don't make changes, the prompt uses the default values for the model. For more information, see Influence model responses with inference parameters.
-
(Optional) In Prompt details enter a description for your prompt.
-
-
In the center pane, enter
Generate a playlist of songs about {{topic}}. Make sure each song is by artists from {{location}}.
in the Prompt message text box. -
(Optional) Choose Save draft to save a draft of your prompt.
-
Test your prompt in the right pane by doing the following:
-
For Test variable values, enter the following values for your prompt variables.
-
topic– Enter
castles
. -
location– Enter
Wales
.
-
-
Choose Run to test your prompt. You should see your prompt, with populated variables, in the Test section. Bedrock Studio displays the response from the model underneath your prompt.
-
(Optional) Choose Reset to clear previously shown test results.
-
Continue to make changes to the prompt and variables until you are satisfied with the results. You can choose Reset to clear previously shown test results.
-
-
When you are ready, choose Create version to create a version of your prompt. If the button is disabled, wait until Bedrock Studio completes saving the prompt, which should take up to a minute.
-
Add your prompt to a Prompt Flows app.