AWS
docs.aws.amazon.com › amazon bedrock › user guide › prompt engineering concepts › prompt templates and examples for amazon bedrock text models
Prompt templates and examples for Amazon Bedrock text models - Amazon Bedrock
Collection of prompt templates to us with Amazon Bedrock.
AWS
docs.aws.amazon.com › amazon bedrock › user guide › automate tasks in your application using ai agents › customize agent for your use case › customize agent orchestration strategy › enhance agent's accuracy using advanced prompt templates in amazon bedrock › advanced prompt templates
Advanced prompt templates - Amazon Bedrock
If you are using Llama 3.1 or Llama 3.2, see the following example prompt template: { "anthropic_version": "bedrock-2023-05-31", "system": " $instruction$ You are a helpful assistant with tool calling capabilities. Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.
Videos
10:30
Amazon Bedrock Prompt Optimization Demo | Amazon Web Services - ...
Amazon Bedrock Prompt Flows Demo - AWS
14:11
Demo - Amazon Bedrock Prompt Flows | Amazon Web Services - YouTube
Amazon Bedrock Prompt Management | programmatic ...
39:36
AWS Summit Berlin 2024 - Prompt engineering best practices for ...
AWS
docs.aws.amazon.com › amazon bedrock › api reference › amazon bedrock api reference › data types › agents for amazon bedrock runtime › prompttemplate
PromptTemplate - Amazon Bedrock
Contains the template for the prompt that's sent to the model for response generation. For more information, see Knowledge base prompt templates .
AWS
docs.aws.amazon.com › amazon bedrock › user guide › automate tasks in your application using ai agents › customize agent for your use case › customize agent orchestration strategy › enhance agent's accuracy using advanced prompt templates in amazon bedrock
Enhance agent's accuracy using advanced prompt templates in Amazon Bedrock - Amazon Bedrock
The template consists of placeholders that are filled in with user input, the agent configuration, and context at runtime to create a prompt for the foundation model to process when the agent reaches that step. For more information about these placeholders, see Use placeholder variables in Amazon Bedrock agent prompt templates.
AWS
docs.aws.amazon.com › amazon bedrock › user guide › prompt engineering concepts
Prompt engineering concepts - Amazon Bedrock
Users can copy and paste this template, filling in their own text and few-shot examples to complete prompts when using LLMs on Amazon Bedrock.
GitHub
github.com › aws-samples › amazon-bedrock-prompting
GitHub - aws-samples/amazon-bedrock-prompting
This repo has a set of prompt engineering examples and prompting tools for working with Amazon Bedrock.
Starred by 70 users
Forked by 17 users
Languages Jupyter Notebook 92.5% | Python 7.4% | Shell 0.1%
AWS
docs.aws.amazon.com › aws cloudformation › template reference › amazon bedrock › aws::bedrock::prompt
AWS::Bedrock::Prompt - AWS CloudFormation
To declare this entity in your CloudFormation template, use the following syntax: { "Type" : "AWS::Bedrock::Prompt", "Properties" : { "CustomerEncryptionKeyArn" : String, "DefaultVariant" : String, "Description" : String, "Name" : String, "Tags" : {Key: Value, ...}, "Variants" : [ PromptVariant, ...
AWS
docs.aws.amazon.com › amazon bedrock › user guide › automate tasks in your application using conversational agents › customize agent for your use case › enhance agent's accuracy using advanced prompt templates in amazon bedrock › configure advanced prompt templates
Configure advanced prompt templates - Amazon Bedrock
If you're using Anthropic Claude 3 Sonnet, Claude 3 Haiku, or Claude 3 Opus, the knowledge base response generation prompt template must be raw text, but the pre-processing, orchestration, and post-processing prompt templates must match the JSON format outlined in the Anthropic Claude Messages API. For an example, see the following prompt template: { "anthropic_version": "bedrock-2023-05-31", "system": " $instruction$ You have been provided with a set of functions to answer the user's question.
GitHub
github.com › aws-samples › amazon-bedrock-samples › blob › main › articles-guides › prompt-engineering › Prompt_Management_Flows › Prompts_evaluation_with_Prompt_Management_Flows.ipynb
amazon-bedrock-samples/articles-guides/prompt-engineering/Prompt_Management_Flows/Prompts_evaluation_with_Prompt_Management_Flows.ipynb at main · aws-samples/amazon-bedrock-samples
"Let's create our sample evaluation prompt by leveraging on Prompt Management for Amazon Bedrock. Here, you can adjust the sample prompt template and evaluation criteria provided according to your specific needs."
Author aws-samples
AWS
docs.aws.amazon.com › amazon bedrock › user guide › prompt engineering concepts › what is a prompt?
What is a prompt? - Amazon Bedrock
Users can copy and paste this template, filling in their own text and few-shot examples to complete prompts when using LLMs on Amazon Bedrock.
AWS
docs.aws.amazon.com › amazon bedrock › user guide › construct and store reusable prompts with prompt management in amazon bedrock › create a prompt using prompt management
Create a prompt using Prompt management - Amazon Bedrock
If you include the genAiResource field, you can only test the prompt in the console. To test a prompt with an agent in the API, you must enter the text of the prompt directly into the inputText field of the InvokeAgent request. templateType – Enter TEXT or CHAT.
Runebook.dev
runebook.dev › english › aws › amazon bedrock
Mastering Prompt Engineering with Amazon Bedrock's PromptTemplates
import boto3 def generate_text(prompt_template, model_id): client = boto3.client('bedrock') response = client.invoke_model( ModelId=model_id, Body=prompt_template ) return response['body'].read().decode('utf-8') # Prompt template prompt_template = """ Translate the following text from English to Spanish: "Hello, how are you today?" """ model_id = "amazon.titan-fx-large" # Replace with your desired model ID response = generate_text(prompt_template, model_id) print(response) ... Import the Boto3 Library This library allows you to interact with AWS services, including Bedrock.
AWS
docs.aws.amazon.com › amazon bedrock › user guide › prompt engineering concepts › design a prompt
Design a prompt - Amazon Bedrock
(Source: Prompt written by AWS) The following content provides guidance on how to create successful prompts. Provide simple, clear, and complete instructions · Place the question or instruction at the end of the prompt for best results · Use separator characters for API calls · Use output indicators · Best practices for good generalization · Optimize prompts for text models on Amazon Bedrock—when the basics aren't good enough ·
AWS
docs.aws.amazon.com › amazon bedrock › user guide › automate tasks in your application using ai agents › customize agent for your use case › customize agent orchestration strategy › enhance agent's accuracy using advanced prompt templates in amazon bedrock › configure advanced prompts
Configure advanced prompts - Amazon Bedrock
If you turn off Override template defaults or change the model, the default Amazon Bedrock template is used and your template will be immediately deleted. To confirm, enter confirm in the text box to confirm the message that appears. To allow the agent to use the template when generating responses, turn on Activate template. If this configuration is turned off, the agent doesn't use the template. To modify the example prompt template, use the Prompt template editor.
AWS
docs.aws.amazon.com › amazon bedrock › user guide › construct and store reusable prompts with prompt management in amazon bedrock › run prompt management code samples
Run Prompt management code samples - Amazon Bedrock
Run the following code snippet to load the AWS SDK for Python (Boto3), create a client, and create a prompt that creates a music playlist using two variables (genre and number) by making a CreatePrompt Agents for Amazon Bedrock build-time endpoint:
AWS
aws.amazon.com › blogs › machine-learning › knowledge-bases-for-amazon-bedrock-now-supports-custom-prompts-for-the-retrieveandgenerate-api-and-configuration-of-the-maximum-number-of-retrieved-results
Amazon Bedrock Knowledge Bases now supports custom prompts for the RetrieveAndGenerate API and configuration of the maximum number of retrieved results | Artificial Intelligence
October 7, 2024 - With our custom prompt template, we get the following response. The ‘promptTemplate‘ option in ‘generationConfiguration‘ allows you to customize the prompt for better control over answer generation. In this post, we introduced two new features in Amazon Bedrock Knowledge Bases: adjusting the maximum number of search results and customizing the default prompt template for the RetrieveAndGenerate API.
AWS
docs.aws.amazon.com › amazon bedrock › api reference › amazon bedrock api reference › data types › agents for amazon bedrock › promptconfiguration
PromptConfiguration - Amazon Bedrock
For more information, see Configure the prompt templates. Type: String · Length Constraints: Minimum length of 1. Maximum length of 100000. Required: No · foundationModel · The agent's foundation model. Type: String · Length Constraints: Minimum length of 1. Maximum length of 2048. Pattern: (arn:aws(-[^:]{1,12})?:(bedrock|sagemaker):[a-z0-9-]{1,20}:([0-9]{12})?:([a-z-]+/)?)?([a-zA-Z0-9.-]{1,63}){0,2}(([:][a-z0-9-]{1,63}){0,2})?(/[a-z0-9]{1,12})?
AWS
docs.aws.amazon.com › amazon bedrock › user guide › construct and store reusable prompts with prompt management in amazon bedrock
Construct and store reusable prompts with Prompt management in Amazon Bedrock - Amazon Bedrock
Prompt builder – A tool in the Amazon Bedrock console that lets you create, edit, and test prompts and their variants in a visual interface.
AWS
docs.aws.amazon.com › amazon bedrock › user guide › automate tasks in your application using ai agents › customize agent for your use case › customize agent orchestration strategy › enhance agent's accuracy using advanced prompt templates in amazon bedrock › use placeholder variables in amazon bedrock agent prompt templates
Use placeholder variables in Amazon Bedrock agent prompt templates - Amazon Bedrock
You can use placeholder variables in agent prompt templates. The variables will be populated by pre-existing configurations when the prompt template is called. Select a tab to see variables that you can use for each prompt template.