prompts
Creates, updates, deletes, gets or lists a prompts resource.
Overview
| Name | prompts |
| Type | Resource |
| Id | aws.bedrock_agent.prompts |
Fields
The following fields are returned by SELECT queries:
- get_prompt
- list_prompts
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the prompt. (pattern: <code>[0-9a-zA-Z]{10}</code>) |
name | string | The name of the prompt. (pattern: <code>([0-9a-zA-Z][_-]?){1,100}</code>) |
arn | string | The Amazon Resource Name (ARN) of the prompt or the prompt version (if you specified a version in the request). (pattern: <code>(arn:aws:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:prompt/[0-9a-zA-Z]{10}(?::[0-9]{1,5})?)</code>) |
created_at | string (date-time) | The time at which the prompt was created. |
customer_encryption_key_arn | string | The Amazon Resource Name (ARN) of the KMS key that the prompt is encrypted with. (pattern: <code>arn:aws(|-cn|-us-gov):kms:[a-zA-Z0-9-]*:[0-9]{12}:key/[a-zA-Z0-9-]{36}</code>) |
default_variant | string | The name of the default variant for the prompt. This value must match the name field in the relevant PromptVariant object. (pattern: <code>([0-9a-zA-Z][_-]?){1,100}</code>) |
description | string | The descriptino of the prompt. |
updated_at | string (date-time) | The time at which the prompt was last updated. |
variants | array | A list of objects, each containing details about a variant of the prompt. |
version | string | The version of the prompt. (pattern: <code>(DRAFT|[0-9]{0,4}[1-9][0-9]{0,4})</code>) |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the prompt. (pattern: <code>[0-9a-zA-Z]{10}</code>) |
name | string | The name of the prompt. (pattern: <code>([0-9a-zA-Z][_-]?){1,100}</code>) |
arn | string | The Amazon Resource Name (ARN) of the prompt or the prompt version (if you specified a version in the request). (pattern: <code>(arn:aws:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:prompt/[0-9a-zA-Z]{10}(?::[0-9]{1,5})?)</code>) |
created_at | string (date-time) | The time at which the prompt was created. |
description | string | The description of the prompt. |
updated_at | string (date-time) | The time at which the prompt was last updated. |
version | string | The version of the prompt that this summary applies to. (pattern: <code>(DRAFT|[0-9]{0,4}[1-9][0-9]{0,4})</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_prompt | select | prompt_identifier, region | promptVersion, includedData | Retrieves information about the working draft (DRAFT version) of a prompt or a version of it, depending on whether you include the promptVersion field or not. For more information, see View information about prompts using Prompt management and View information about a version of your prompt in the Amazon Bedrock User Guide. |
list_prompts | select | region | promptIdentifier, maxResults, nextToken | Returns either information about the working draft (DRAFT version) of each prompt in an account, or information about of all versions of a prompt, depending on whether you include the promptIdentifier field or not. For more information, see View information about prompts using Prompt management in the Amazon Bedrock User Guide. |
create_prompt | insert | region, name | Creates a prompt in your prompt library that you can add to a flow. For more information, see Prompt management in Amazon Bedrock, Create a prompt using Prompt management and Prompt flows in Amazon Bedrock in the Amazon Bedrock User Guide. | |
create_prompt_version | insert | prompt_identifier, region | Creates a static snapshot of your prompt that can be deployed to production. For more information, see Deploy prompts using Prompt management by creating versions in the Amazon Bedrock User Guide. | |
update_prompt | update | prompt_identifier, region, name | Modifies a prompt in your prompt library. Include both fields that you want to keep and fields that you want to replace. For more information, see Prompt management in Amazon Bedrock and Edit prompts in your prompt library in the Amazon Bedrock User Guide. | |
delete_prompt | delete | prompt_identifier, region | promptVersion | Deletes a prompt or a version of it, depending on whether you include the promptVersion field or not. For more information, see Delete prompts from the Prompt management tool and Delete a version of a prompt from the Prompt management tool in the Amazon Bedrock User Guide. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
prompt_identifier | string | The unique identifier of the prompt. |
region | string | AWS region (default: us-east-1) |
includedData | string | Controls the scope of data returned. Set to METADATA_ONLY to return only resource metadata. Set to ALL_DATA or omit this field to return the full response. |
maxResults | integer | The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results. |
nextToken | string | If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results. |
promptIdentifier | string | The unique identifier of the prompt for whose versions you want to return information. Omit this field to list information about all prompts in an account. |
promptVersion | string | The version of the prompt to delete. To delete the prompt, omit this field. |
SELECT examples
- get_prompt
- list_prompts
Retrieves information about the working draft (DRAFT version) of a prompt or a version of it, depending on whether you include the promptVersion field or not. For more information, see View information about prompts using Prompt management and View information about a version of your prompt in the Amazon Bedrock User Guide.
SELECT
id,
name,
arn,
created_at,
customer_encryption_key_arn,
default_variant,
description,
updated_at,
variants,
version
FROM aws.bedrock_agent.prompts
WHERE prompt_identifier = '{{ prompt_identifier }}' -- required
AND region = '{{ region }}' -- required
AND promptVersion = '{{ promptVersion }}'
AND includedData = '{{ includedData }}'
;
Returns either information about the working draft (DRAFT version) of each prompt in an account, or information about of all versions of a prompt, depending on whether you include the promptIdentifier field or not. For more information, see View information about prompts using Prompt management in the Amazon Bedrock User Guide.
SELECT
id,
name,
arn,
created_at,
description,
updated_at,
version
FROM aws.bedrock_agent.prompts
WHERE region = '{{ region }}' -- required
AND promptIdentifier = '{{ promptIdentifier }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_prompt
- create_prompt_version
- Manifest
Creates a prompt in your prompt library that you can add to a flow. For more information, see Prompt management in Amazon Bedrock, Create a prompt using Prompt management and Prompt flows in Amazon Bedrock in the Amazon Bedrock User Guide.
INSERT INTO aws.bedrock_agent.prompts (
name,
description,
customerEncryptionKeyArn,
defaultVariant,
variants,
clientToken,
tags,
region
)
SELECT
'{{ name }}' /* required */,
'{{ description }}',
'{{ customerEncryptionKeyArn }}',
'{{ defaultVariant }}',
'{{ variants }}',
'{{ clientToken }}',
'{{ tags }}',
'{{ region }}'
RETURNING
id,
name,
arn,
created_at,
customer_encryption_key_arn,
default_variant,
description,
updated_at,
variants,
version
;
Creates a static snapshot of your prompt that can be deployed to production. For more information, see Deploy prompts using Prompt management by creating versions in the Amazon Bedrock User Guide.
INSERT INTO aws.bedrock_agent.prompts (
description,
clientToken,
tags,
prompt_identifier,
region
)
SELECT
'{{ description }}',
'{{ clientToken }}',
'{{ tags }}',
'{{ prompt_identifier }}',
'{{ region }}'
RETURNING
id,
name,
arn,
created_at,
customer_encryption_key_arn,
default_variant,
description,
updated_at,
variants,
version
;
# Description fields are for documentation purposes
- name: prompts
props:
- name: region
value: "{{ region }}"
description: Required parameter for the prompts resource.
- name: prompt_identifier
value: "{{ prompt_identifier }}"
description: Required parameter for the prompts resource.
- name: name
value: "{{ name }}"
- name: description
value: "{{ description }}"
- name: customerEncryptionKeyArn
value: "{{ customerEncryptionKeyArn }}"
- name: defaultVariant
value: "{{ defaultVariant }}"
- name: variants
value:
- name: "{{ name }}"
templateType: "{{ templateType }}"
templateConfiguration:
text:
text: "{{ text }}"
cachePoint:
type_: "{{ type_ }}"
inputVariables:
- name: "{{ name }}"
chat:
messages:
- role: "{{ role }}"
content: "{{ content }}"
system:
- text: "{{ text }}"
cachePoint:
type_: "{{ type_ }}"
inputVariables:
- name: "{{ name }}"
toolConfiguration:
tools:
- toolSpec:
name: "{{ name }}"
description: "{{ description }}"
inputSchema: "{{ inputSchema }}"
strict: {{ strict }}
cachePoint:
type_: "{{ type_ }}"
toolChoice:
auto: "{{ auto }}"
any: "{{ any }}"
tool: "{{ tool }}"
modelId: "{{ modelId }}"
inferenceConfiguration:
text:
temperature: {{ temperature }}
topP: {{ topP }}
maxTokens: {{ maxTokens }}
stopSequences:
- "{{ stopSequences }}"
metadata: "{{ metadata }}"
additionalModelRequestFields: "{{ additionalModelRequestFields }}"
genAiResource:
agent:
agentIdentifier: "{{ agentIdentifier }}"
- name: clientToken
value: "{{ clientToken }}"
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_prompt
Modifies a prompt in your prompt library. Include both fields that you want to keep and fields that you want to replace. For more information, see Prompt management in Amazon Bedrock and Edit prompts in your prompt library in the Amazon Bedrock User Guide.
UPDATE aws.bedrock_agent.prompts
SET
name = '{{ name }}',
description = '{{ description }}',
customerEncryptionKeyArn = '{{ customerEncryptionKeyArn }}',
defaultVariant = '{{ defaultVariant }}',
variants = '{{ variants }}'
WHERE
prompt_identifier = '{{ prompt_identifier }}' --required
AND region = '{{ region }}' --required
AND name = '{{ name }}' --required
RETURNING
id,
name,
arn,
created_at,
customer_encryption_key_arn,
default_variant,
description,
updated_at,
variants,
version;
DELETE examples
- delete_prompt
Deletes a prompt or a version of it, depending on whether you include the promptVersion field or not. For more information, see Delete prompts from the Prompt management tool and Delete a version of a prompt from the Prompt management tool in the Amazon Bedrock User Guide.
DELETE FROM aws.bedrock_agent.prompts
WHERE prompt_identifier = '{{ prompt_identifier }}' --required
AND region = '{{ region }}' --required
AND promptVersion = '{{ promptVersion }}'
;