ai_prompts
Creates, updates, deletes, gets or lists an ai_prompts resource.
Overview
| Name | ai_prompts |
| Type | Resource |
| Id | aws.qconnect.ai_prompts |
Fields
The following fields are returned by SELECT queries:
- get_ai_prompt
- list_ai_prompts
| Name | Datatype | Description |
|---|---|---|
ai_prompt | object | The data of the AI Prompt. |
version_number | integer (int64) | The version number of the AI Prompt version (returned if an AI Prompt version was specified via use of a qualifier for the aiPromptId on the request). |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the AI Prompt. (pattern: <code>[a-zA-Z0-9\s_.,-]+.*</code>) |
ai_prompt_arn | string | The Amazon Resource Name (ARN) of the AI Prompt. (pattern: <code>arn:[a-z-]?:wisdom:[a-z0-9-]?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}){0,2}</code>) |
ai_prompt_id | string | The identifier of the Amazon Q in Connect AI prompt. (pattern: <code>[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}</code>) |
api_format | string | The API format used for this AI Prompt. (ANTHROPIC_CLAUDE_MESSAGES, ANTHROPIC_CLAUDE_TEXT_COMPLETIONS, MESSAGES, TEXT_COMPLETIONS) |
assistant_arn | string | The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant. (pattern: <code>arn:[a-z-]?:wisdom:[a-z0-9-]?:[0-9]{12}:[a-z-]*?/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}){0,2}</code>) |
assistant_id | string | The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN. (pattern: <code>[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}</code>) |
description | string | The description of the AI Prompt. (pattern: <code>[a-zA-Z0-9\s_.,-]+.*</code>) |
model_id | string | The identifier of the model used for this AI Prompt. Model Ids supported are: anthropic.claude-3-haiku-20240307-v1:0. |
modified_time | string (date-time) | The time the AI Prompt was last modified. |
origin | string | The origin of the AI Prompt. SYSTEM for a default AI Prompt created by Q in Connect or CUSTOMER for an AI Prompt created by calling AI Prompt creation APIs. (SYSTEM, CUSTOMER) |
status | string | The status of the AI Prompt. (CREATE_IN_PROGRESS, CREATE_FAILED, ACTIVE, DELETE_IN_PROGRESS, DELETE_FAILED, DELETED) |
tags | object | The tags used to organize, track, or control access for this resource. |
template_type | string | The type of the prompt template for this AI Prompt. (TEXT) |
type_ | string | The type of this AI Prompt. (ANSWER_GENERATION, INTENT_LABELING_GENERATION, QUERY_REFORMULATION, SELF_SERVICE_PRE_PROCESSING, SELF_SERVICE_ANSWER_GENERATION, EMAIL_RESPONSE, EMAIL_OVERVIEW, EMAIL_GENERATIVE_ANSWER, EMAIL_QUERY_REFORMULATION, ORCHESTRATION, NOTE_TAKING, CASE_SUMMARIZATION) |
visibility_status | string | The visibility status of the AI Prompt. (SAVED, PUBLISHED) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_ai_prompt | select | assistant_id, ai_prompt_id, region | Gets and Amazon Q in Connect AI Prompt. | |
list_ai_prompts | select | assistant_id, region | nextToken, maxResults, origin | Lists the AI Prompts available on the Amazon Q in Connect assistant. |
create_ai_prompt | insert | assistant_id, region, name, type, templateConfiguration, visibilityStatus, templateType, modelId, apiFormat | Creates an Amazon Q in Connect AI Prompt. | |
update_ai_prompt | update | assistant_id, ai_prompt_id, region, visibilityStatus | Updates an AI Prompt. | |
delete_ai_prompt | delete | assistant_id, ai_prompt_id, region | Deletes an Amazon Q in Connect AI Prompt. |
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 |
|---|---|---|
ai_prompt_id | string | The identifier of the Amazon Q in Connect AI prompt. Can be either the ID or the ARN. URLs cannot contain the ARN. |
assistant_id | string | The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of results to return per page. |
nextToken | string | The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. |
origin | string | The origin of the AI Prompts to be listed. SYSTEM for a default AI Agent created by Q in Connect or CUSTOMER for an AI Agent created by calling AI Agent creation APIs. |
SELECT examples
- get_ai_prompt
- list_ai_prompts
Gets and Amazon Q in Connect AI Prompt.
SELECT
ai_prompt,
version_number
FROM aws.qconnect.ai_prompts
WHERE assistant_id = '{{ assistant_id }}' -- required
AND ai_prompt_id = '{{ ai_prompt_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists the AI Prompts available on the Amazon Q in Connect assistant.
SELECT
name,
ai_prompt_arn,
ai_prompt_id,
api_format,
assistant_arn,
assistant_id,
description,
model_id,
modified_time,
origin,
status,
tags,
template_type,
type_,
visibility_status
FROM aws.qconnect.ai_prompts
WHERE assistant_id = '{{ assistant_id }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
AND origin = '{{ origin }}'
;
INSERT examples
- create_ai_prompt
- Manifest
Creates an Amazon Q in Connect AI Prompt.
INSERT INTO aws.qconnect.ai_prompts (
clientToken,
name,
type,
templateConfiguration,
visibilityStatus,
templateType,
modelId,
apiFormat,
tags,
description,
inferenceConfiguration,
assistant_id,
region
)
SELECT
'{{ clientToken }}',
'{{ name }}' /* required */,
'{{ type }}' /* required */,
'{{ templateConfiguration }}' /* required */,
'{{ visibilityStatus }}' /* required */,
'{{ templateType }}' /* required */,
'{{ modelId }}' /* required */,
'{{ apiFormat }}' /* required */,
'{{ tags }}',
'{{ description }}',
'{{ inferenceConfiguration }}',
'{{ assistant_id }}',
'{{ region }}'
RETURNING
ai_prompt
;
# Description fields are for documentation purposes
- name: ai_prompts
props:
- name: assistant_id
value: "{{ assistant_id }}"
description: Required parameter for the ai_prompts resource.
- name: region
value: "{{ region }}"
description: Required parameter for the ai_prompts resource.
- name: clientToken
value: "{{ clientToken }}"
- name: name
value: "{{ name }}"
- name: type
value: "{{ type }}"
valid_values: ['ANSWER_GENERATION', 'INTENT_LABELING_GENERATION', 'QUERY_REFORMULATION', 'SELF_SERVICE_PRE_PROCESSING', 'SELF_SERVICE_ANSWER_GENERATION', 'EMAIL_RESPONSE', 'EMAIL_OVERVIEW', 'EMAIL_GENERATIVE_ANSWER', 'EMAIL_QUERY_REFORMULATION', 'ORCHESTRATION', 'NOTE_TAKING', 'CASE_SUMMARIZATION']
- name: templateConfiguration
description: |
A typed union that specifies the configuration for a prompt template based on its type.
value:
textFullAIPromptEditTemplateConfiguration:
text: "{{ text }}"
- name: visibilityStatus
value: "{{ visibilityStatus }}"
valid_values: ['SAVED', 'PUBLISHED']
- name: templateType
value: "{{ templateType }}"
valid_values: ['TEXT']
- name: modelId
value: "{{ modelId }}"
- name: apiFormat
value: "{{ apiFormat }}"
valid_values: ['ANTHROPIC_CLAUDE_MESSAGES', 'ANTHROPIC_CLAUDE_TEXT_COMPLETIONS', 'MESSAGES', 'TEXT_COMPLETIONS']
- name: tags
value: "{{ tags }}"
- name: description
value: "{{ description }}"
- name: inferenceConfiguration
description: |
The configuration for inference parameters when using AI Prompts.
value:
temperature: {{ temperature }}
topP: {{ topP }}
topK: {{ topK }}
maxTokensToSample: {{ maxTokensToSample }}
UPDATE examples
- update_ai_prompt
Updates an AI Prompt.
UPDATE aws.qconnect.ai_prompts
SET
clientToken = '{{ clientToken }}',
visibilityStatus = '{{ visibilityStatus }}',
templateConfiguration = '{{ templateConfiguration }}',
description = '{{ description }}',
modelId = '{{ modelId }}',
inferenceConfiguration = '{{ inferenceConfiguration }}'
WHERE
assistant_id = '{{ assistant_id }}' --required
AND ai_prompt_id = '{{ ai_prompt_id }}' --required
AND region = '{{ region }}' --required
AND visibilityStatus = '{{ visibilityStatus }}' --required
RETURNING
ai_prompt;
DELETE examples
- delete_ai_prompt
Deletes an Amazon Q in Connect AI Prompt.
DELETE FROM aws.qconnect.ai_prompts
WHERE assistant_id = '{{ assistant_id }}' --required
AND ai_prompt_id = '{{ ai_prompt_id }}' --required
AND region = '{{ region }}' --required
;