2025/04/18 - Amazon Q Connect - 12 updated api methods
Changes This release adds support for the following capabilities: Chunking generative answer replies from Amazon Q in Connect. Integration support for the use of additional LLM models with Amazon Q in Connect.
{'apiFormat': {'MESSAGES', 'TEXT_COMPLETIONS'}}Response
{'aiPrompt': {'apiFormat': {'MESSAGES', 'TEXT_COMPLETIONS'}}}
Creates an Amazon Q in Connect AI Prompt.
See also: AWS API Documentation
Request Syntax
client.create_ai_prompt( clientToken='string', assistantId='string', name='string', type='ANSWER_GENERATION'|'INTENT_LABELING_GENERATION'|'QUERY_REFORMULATION'|'SELF_SERVICE_PRE_PROCESSING'|'SELF_SERVICE_ANSWER_GENERATION', templateConfiguration={ 'textFullAIPromptEditTemplateConfiguration': { 'text': 'string' } }, visibilityStatus='SAVED'|'PUBLISHED', templateType='TEXT', modelId='string', apiFormat='ANTHROPIC_CLAUDE_MESSAGES'|'ANTHROPIC_CLAUDE_TEXT_COMPLETIONS'|'MESSAGES'|'TEXT_COMPLETIONS', tags={ 'string': 'string' }, description='string' )
string
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs..
This field is autopopulated if not provided.
string
[REQUIRED]
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
string
[REQUIRED]
The name of the AI Prompt.
string
[REQUIRED]
The type of this AI Prompt.
dict
[REQUIRED]
The configuration of the prompt template for this AI Prompt.
textFullAIPromptEditTemplateConfiguration (dict) --
The configuration for a prompt template that supports full textual prompt configuration using a YAML prompt.
text (string) -- [REQUIRED]
The YAML text for the AI Prompt template.
string
[REQUIRED]
The visibility status of the AI Prompt.
string
[REQUIRED]
The type of the prompt template for this AI Prompt.
string
[REQUIRED]
The identifier of the model used for this AI Prompt.
string
[REQUIRED]
The API Format of the AI Prompt.
Recommended values: MESSAGES | TEXT_COMPLETIONS
dict
The tags used to organize, track, or control access for this resource.
(string) --
(string) --
string
The description of the AI Prompt.
dict
Response Syntax
{ 'aiPrompt': { 'assistantId': 'string', 'assistantArn': 'string', 'aiPromptId': 'string', 'aiPromptArn': 'string', 'name': 'string', 'type': 'ANSWER_GENERATION'|'INTENT_LABELING_GENERATION'|'QUERY_REFORMULATION'|'SELF_SERVICE_PRE_PROCESSING'|'SELF_SERVICE_ANSWER_GENERATION', 'templateType': 'TEXT', 'modelId': 'string', 'apiFormat': 'ANTHROPIC_CLAUDE_MESSAGES'|'ANTHROPIC_CLAUDE_TEXT_COMPLETIONS'|'MESSAGES'|'TEXT_COMPLETIONS', 'templateConfiguration': { 'textFullAIPromptEditTemplateConfiguration': { 'text': 'string' } }, 'modifiedTime': datetime(2015, 1, 1), 'description': 'string', 'visibilityStatus': 'SAVED'|'PUBLISHED', 'tags': { 'string': 'string' }, 'origin': 'SYSTEM'|'CUSTOMER', 'status': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'ACTIVE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETED' } }
Response Structure
(dict) --
aiPrompt (dict) --
The data of the AI Prompt.
assistantId (string) --
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
assistantArn (string) --
The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant.
aiPromptId (string) --
The identifier of the Amazon Q in Connect AI prompt.
aiPromptArn (string) --
The Amazon Resource Name (ARN) of the AI Prompt.
name (string) --
The name of the AI Prompt
type (string) --
The type of this AI Prompt.
templateType (string) --
The type of the prompt template for this AI Prompt.
modelId (string) --
The identifier of the model used for this AI Prompt. The following model Ids are supported:
anthropic.claude-3-haiku--v1:0
apac.amazon.nova-lite-v1:0
apac.amazon.nova-micro-v1:0
apac.amazon.nova-pro-v1:0
apac.anthropic.claude-3-5-sonnet--v2:0
apac.anthropic.claude-3-haiku-20240307-v1:0
eu.amazon.nova-lite-v1:0
eu.amazon.nova-micro-v1:0
eu.amazon.nova-pro-v1:0
eu.anthropic.claude-3-7-sonnet-20250219-v1:0
eu.anthropic.claude-3-haiku-20240307-v1:0
us.amazon.nova-lite-v1:0
us.amazon.nova-micro-v1:0
us.amazon.nova-pro-v1:0
us.anthropic.claude-3-5-haiku-20241022-v1:0
us.anthropic.claude-3-7-sonnet-20250219-v1:0
us.anthropic.claude-3-haiku-20240307-v1:0
apiFormat (string) --
The API format used for this AI Prompt.
templateConfiguration (dict) --
The configuration of the prompt template for this AI Prompt.
textFullAIPromptEditTemplateConfiguration (dict) --
The configuration for a prompt template that supports full textual prompt configuration using a YAML prompt.
text (string) --
The YAML text for the AI Prompt template.
modifiedTime (datetime) --
The time the AI Prompt was last modified.
description (string) --
The description of the AI Prompt.
visibilityStatus (string) --
The visibility status of the AI Prompt.
tags (dict) --
The tags used to organize, track, or control access for this resource.
(string) --
(string) --
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.
status (string) --
The status of the AI Prompt.
{'aiPrompt': {'apiFormat': {'MESSAGES', 'TEXT_COMPLETIONS'}}}
Creates an Amazon Q in Connect AI Prompt version.
See also: AWS API Documentation
Request Syntax
client.create_ai_prompt_version( assistantId='string', aiPromptId='string', modifiedTime=datetime(2015, 1, 1), clientToken='string' )
string
[REQUIRED]
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
string
[REQUIRED]
The identifier of the Amazon Q in Connect AI prompt.
datetime
The time the AI Prompt was last modified.
string
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs..
This field is autopopulated if not provided.
dict
Response Syntax
{ 'aiPrompt': { 'assistantId': 'string', 'assistantArn': 'string', 'aiPromptId': 'string', 'aiPromptArn': 'string', 'name': 'string', 'type': 'ANSWER_GENERATION'|'INTENT_LABELING_GENERATION'|'QUERY_REFORMULATION'|'SELF_SERVICE_PRE_PROCESSING'|'SELF_SERVICE_ANSWER_GENERATION', 'templateType': 'TEXT', 'modelId': 'string', 'apiFormat': 'ANTHROPIC_CLAUDE_MESSAGES'|'ANTHROPIC_CLAUDE_TEXT_COMPLETIONS'|'MESSAGES'|'TEXT_COMPLETIONS', 'templateConfiguration': { 'textFullAIPromptEditTemplateConfiguration': { 'text': 'string' } }, 'modifiedTime': datetime(2015, 1, 1), 'description': 'string', 'visibilityStatus': 'SAVED'|'PUBLISHED', 'tags': { 'string': 'string' }, 'origin': 'SYSTEM'|'CUSTOMER', 'status': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'ACTIVE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETED' }, 'versionNumber': 123 }
Response Structure
(dict) --
aiPrompt (dict) --
The data of the AI Prompt version.
assistantId (string) --
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
assistantArn (string) --
The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant.
aiPromptId (string) --
The identifier of the Amazon Q in Connect AI prompt.
aiPromptArn (string) --
The Amazon Resource Name (ARN) of the AI Prompt.
name (string) --
The name of the AI Prompt
type (string) --
The type of this AI Prompt.
templateType (string) --
The type of the prompt template for this AI Prompt.
modelId (string) --
The identifier of the model used for this AI Prompt. The following model Ids are supported:
anthropic.claude-3-haiku--v1:0
apac.amazon.nova-lite-v1:0
apac.amazon.nova-micro-v1:0
apac.amazon.nova-pro-v1:0
apac.anthropic.claude-3-5-sonnet--v2:0
apac.anthropic.claude-3-haiku-20240307-v1:0
eu.amazon.nova-lite-v1:0
eu.amazon.nova-micro-v1:0
eu.amazon.nova-pro-v1:0
eu.anthropic.claude-3-7-sonnet-20250219-v1:0
eu.anthropic.claude-3-haiku-20240307-v1:0
us.amazon.nova-lite-v1:0
us.amazon.nova-micro-v1:0
us.amazon.nova-pro-v1:0
us.anthropic.claude-3-5-haiku-20241022-v1:0
us.anthropic.claude-3-7-sonnet-20250219-v1:0
us.anthropic.claude-3-haiku-20240307-v1:0
apiFormat (string) --
The API format used for this AI Prompt.
templateConfiguration (dict) --
The configuration of the prompt template for this AI Prompt.
textFullAIPromptEditTemplateConfiguration (dict) --
The configuration for a prompt template that supports full textual prompt configuration using a YAML prompt.
text (string) --
The YAML text for the AI Prompt template.
modifiedTime (datetime) --
The time the AI Prompt was last modified.
description (string) --
The description of the AI Prompt.
visibilityStatus (string) --
The visibility status of the AI Prompt.
tags (dict) --
The tags used to organize, track, or control access for this resource.
(string) --
(string) --
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.
status (string) --
The status of the AI Prompt.
versionNumber (integer) --
The version number of the AI Prompt version.
{'session': {'origin': 'SYSTEM | CUSTOMER'}}
Creates a session. A session is a contextual container used for generating recommendations. Amazon Connect creates a new Amazon Q in Connect session for each contact on which Amazon Q in Connect is enabled.
See also: AWS API Documentation
Request Syntax
client.create_session( clientToken='string', assistantId='string', name='string', description='string', tags={ 'string': 'string' }, tagFilter={ 'tagCondition': { 'key': 'string', 'value': 'string' }, 'andConditions': [ { 'key': 'string', 'value': 'string' }, ], 'orConditions': [ { 'andConditions': [ { 'key': 'string', 'value': 'string' }, ], 'tagCondition': { 'key': 'string', 'value': 'string' } }, ] }, aiAgentConfiguration={ 'string': { 'aiAgentId': 'string' } } )
string
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.
This field is autopopulated if not provided.
string
[REQUIRED]
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
string
[REQUIRED]
The name of the session.
string
The description.
dict
The tags used to organize, track, or control access for this resource.
(string) --
(string) --
dict
An object that can be used to specify Tag conditions.
tagCondition (dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) -- [REQUIRED]
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
andConditions (list) --
A list of conditions which would be applied together with an AND condition.
(dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) -- [REQUIRED]
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
orConditions (list) --
A list of conditions which would be applied together with an OR condition.
(dict) --
A list of conditions which would be applied together with an OR condition.
andConditions (list) --
A list of conditions which would be applied together with an AND condition.
(dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) -- [REQUIRED]
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
tagCondition (dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) -- [REQUIRED]
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
dict
The configuration of the AI Agents (mapped by AI Agent Type to AI Agent version) that should be used by Amazon Q in Connect for this Session.
(string) --
(dict) --
A type that specifies the AI Agent ID configuration data when mapping an AI Agents to be used for an AI Agent type on a session or assistant.
aiAgentId (string) -- [REQUIRED]
The ID of the AI Agent to be configured.
dict
Response Syntax
{ 'session': { 'sessionArn': 'string', 'sessionId': 'string', 'name': 'string', 'description': 'string', 'tags': { 'string': 'string' }, 'integrationConfiguration': { 'topicIntegrationArn': 'string' }, 'tagFilter': { 'tagCondition': { 'key': 'string', 'value': 'string' }, 'andConditions': [ { 'key': 'string', 'value': 'string' }, ], 'orConditions': [ { 'andConditions': [ { 'key': 'string', 'value': 'string' }, ], 'tagCondition': { 'key': 'string', 'value': 'string' } }, ] }, 'aiAgentConfiguration': { 'string': { 'aiAgentId': 'string' } }, 'origin': 'SYSTEM'|'CUSTOMER' } }
Response Structure
(dict) --
session (dict) --
The session.
sessionArn (string) --
The Amazon Resource Name (ARN) of the session.
sessionId (string) --
The identifier of the session.
name (string) --
The name of the session.
description (string) --
The description of the session.
tags (dict) --
The tags used to organize, track, or control access for this resource.
(string) --
(string) --
integrationConfiguration (dict) --
The configuration information for the session integration.
topicIntegrationArn (string) --
The Amazon Resource Name (ARN) of the integrated Amazon SNS topic used for streaming chat messages.
tagFilter (dict) --
An object that can be used to specify Tag conditions.
tagCondition (dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) --
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
andConditions (list) --
A list of conditions which would be applied together with an AND condition.
(dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) --
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
orConditions (list) --
A list of conditions which would be applied together with an OR condition.
(dict) --
A list of conditions which would be applied together with an OR condition.
andConditions (list) --
A list of conditions which would be applied together with an AND condition.
(dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) --
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
tagCondition (dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) --
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
aiAgentConfiguration (dict) --
The configuration of the AI Agents (mapped by AI Agent Type to AI Agent version) that should be used by Amazon Q in Connect for this Session.
(string) --
(dict) --
A type that specifies the AI Agent ID configuration data when mapping an AI Agents to be used for an AI Agent type on a session or assistant.
aiAgentId (string) --
The ID of the AI Agent to be configured.
origin (string) --
The origin of the Session to be listed. SYSTEM for a default Session created by Amazon Q in Connect or CUSTOMER for a Session created by calling CreateSession API.
{'aiPrompt': {'apiFormat': {'MESSAGES', 'TEXT_COMPLETIONS'}}}
Gets and Amazon Q in Connect AI Prompt.
See also: AWS API Documentation
Request Syntax
client.get_ai_prompt( assistantId='string', aiPromptId='string' )
string
[REQUIRED]
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
string
[REQUIRED]
The identifier of the Amazon Q in Connect AI prompt.
dict
Response Syntax
{ 'aiPrompt': { 'assistantId': 'string', 'assistantArn': 'string', 'aiPromptId': 'string', 'aiPromptArn': 'string', 'name': 'string', 'type': 'ANSWER_GENERATION'|'INTENT_LABELING_GENERATION'|'QUERY_REFORMULATION'|'SELF_SERVICE_PRE_PROCESSING'|'SELF_SERVICE_ANSWER_GENERATION', 'templateType': 'TEXT', 'modelId': 'string', 'apiFormat': 'ANTHROPIC_CLAUDE_MESSAGES'|'ANTHROPIC_CLAUDE_TEXT_COMPLETIONS'|'MESSAGES'|'TEXT_COMPLETIONS', 'templateConfiguration': { 'textFullAIPromptEditTemplateConfiguration': { 'text': 'string' } }, 'modifiedTime': datetime(2015, 1, 1), 'description': 'string', 'visibilityStatus': 'SAVED'|'PUBLISHED', 'tags': { 'string': 'string' }, 'origin': 'SYSTEM'|'CUSTOMER', 'status': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'ACTIVE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETED' }, 'versionNumber': 123 }
Response Structure
(dict) --
aiPrompt (dict) --
The data of the AI Prompt.
assistantId (string) --
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
assistantArn (string) --
The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant.
aiPromptId (string) --
The identifier of the Amazon Q in Connect AI prompt.
aiPromptArn (string) --
The Amazon Resource Name (ARN) of the AI Prompt.
name (string) --
The name of the AI Prompt
type (string) --
The type of this AI Prompt.
templateType (string) --
The type of the prompt template for this AI Prompt.
modelId (string) --
The identifier of the model used for this AI Prompt. The following model Ids are supported:
anthropic.claude-3-haiku--v1:0
apac.amazon.nova-lite-v1:0
apac.amazon.nova-micro-v1:0
apac.amazon.nova-pro-v1:0
apac.anthropic.claude-3-5-sonnet--v2:0
apac.anthropic.claude-3-haiku-20240307-v1:0
eu.amazon.nova-lite-v1:0
eu.amazon.nova-micro-v1:0
eu.amazon.nova-pro-v1:0
eu.anthropic.claude-3-7-sonnet-20250219-v1:0
eu.anthropic.claude-3-haiku-20240307-v1:0
us.amazon.nova-lite-v1:0
us.amazon.nova-micro-v1:0
us.amazon.nova-pro-v1:0
us.anthropic.claude-3-5-haiku-20241022-v1:0
us.anthropic.claude-3-7-sonnet-20250219-v1:0
us.anthropic.claude-3-haiku-20240307-v1:0
apiFormat (string) --
The API format used for this AI Prompt.
templateConfiguration (dict) --
The configuration of the prompt template for this AI Prompt.
textFullAIPromptEditTemplateConfiguration (dict) --
The configuration for a prompt template that supports full textual prompt configuration using a YAML prompt.
text (string) --
The YAML text for the AI Prompt template.
modifiedTime (datetime) --
The time the AI Prompt was last modified.
description (string) --
The description of the AI Prompt.
visibilityStatus (string) --
The visibility status of the AI Prompt.
tags (dict) --
The tags used to organize, track, or control access for this resource.
(string) --
(string) --
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.
status (string) --
The status of the AI Prompt.
versionNumber (integer) --
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).
{'nextChunkToken': 'string'}Response
{'recommendations': {'data': {'details': {'generativeChunkData': {'completion': 'string', 'nextChunkToken': 'string', 'references': [{'details': {'contentData': {'rankingData': {'relevanceLevel': 'HIGH ' '| ' 'MEDIUM ' '| ' 'LOW', 'relevanceScore': 'double'}, 'textData': {'excerpt': {'highlights': [{'beginOffsetInclusive': 'integer', 'endOffsetExclusive': 'integer'}], 'text': 'string'}, 'title': {'highlights': [{'beginOffsetInclusive': 'integer', 'endOffsetExclusive': 'integer'}], 'text': 'string'}}}, 'generativeChunkData': (), 'generativeData': {'completion': 'string', 'rankingData': {'relevanceLevel': 'HIGH ' '| ' 'MEDIUM ' '| ' 'LOW', 'relevanceScore': 'double'}, 'references': ()}, 'intentDetectedData': {'intent': 'string', 'intentId': 'string'}, 'sourceContentData': {'citationSpan': {'beginOffsetInclusive': 'integer', 'endOffsetExclusive': 'integer'}, 'id': 'string', 'rankingData': {'relevanceLevel': 'HIGH ' '| ' 'MEDIUM ' '| ' 'LOW', 'relevanceScore': 'double'}, 'textData': {'excerpt': {'highlights': [{'beginOffsetInclusive': 'integer', 'endOffsetExclusive': 'integer'}], 'text': 'string'}, 'title': {'highlights': [{'beginOffsetInclusive': 'integer', 'endOffsetExclusive': 'integer'}], 'text': 'string'}}, 'type': 'KNOWLEDGE_CONTENT'}}, 'reference': {'contentReference': {'contentArn': 'string', 'contentId': 'string', 'knowledgeBaseArn': 'string', 'knowledgeBaseId': 'string', 'referenceType': 'WEB_CRAWLER ' '| ' 'KNOWLEDGE_BASE', 'sourceURL': 'string'}, 'generativeReference': {'generationId': 'string', 'modelId': 'string'}}}]}}}, 'type': {'BLOCKED_GENERATIVE_ANSWER_CHUNK', 'BLOCKED_INTENT_ANSWER_CHUNK', 'GENERATIVE_ANSWER_CHUNK', 'INTENT_ANSWER_CHUNK'}}}
Retrieves recommendations for the specified session. To avoid retrieving the same recommendations in subsequent calls, use NotifyRecommendationsReceived. This API supports long-polling behavior with the waitTimeSeconds parameter. Short poll is the default behavior and only returns recommendations already available. To perform a manual query against an assistant, use QueryAssistant.
See also: AWS API Documentation
Request Syntax
client.get_recommendations( assistantId='string', sessionId='string', maxResults=123, waitTimeSeconds=123, nextChunkToken='string' )
string
[REQUIRED]
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
string
[REQUIRED]
The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN.
integer
The maximum number of results to return per page.
integer
The duration (in seconds) for which the call waits for a recommendation to be made available before returning. If a recommendation is available, the call returns sooner than WaitTimeSeconds. If no messages are available and the wait time expires, the call returns successfully with an empty list.
string
The token for the next set of chunks. Use the value returned in the previous response in the next request to retrieve the next set of chunks.
dict
Response Syntax
{ 'recommendations': [ { 'recommendationId': 'string', 'document': { 'contentReference': { 'knowledgeBaseArn': 'string', 'knowledgeBaseId': 'string', 'contentArn': 'string', 'contentId': 'string', 'sourceURL': 'string', 'referenceType': 'WEB_CRAWLER'|'KNOWLEDGE_BASE' }, 'title': { 'text': 'string', 'highlights': [ { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 }, ] }, 'excerpt': { 'text': 'string', 'highlights': [ { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 }, ] } }, 'relevanceScore': 123.0, 'relevanceLevel': 'HIGH'|'MEDIUM'|'LOW', 'type': 'KNOWLEDGE_CONTENT'|'GENERATIVE_RESPONSE'|'GENERATIVE_ANSWER'|'DETECTED_INTENT'|'GENERATIVE_ANSWER_CHUNK'|'BLOCKED_GENERATIVE_ANSWER_CHUNK'|'INTENT_ANSWER_CHUNK'|'BLOCKED_INTENT_ANSWER_CHUNK', 'data': { 'reference': { 'contentReference': { 'knowledgeBaseArn': 'string', 'knowledgeBaseId': 'string', 'contentArn': 'string', 'contentId': 'string', 'sourceURL': 'string', 'referenceType': 'WEB_CRAWLER'|'KNOWLEDGE_BASE' }, 'generativeReference': { 'modelId': 'string', 'generationId': 'string' } }, 'details': { 'contentData': { 'textData': { 'title': { 'text': 'string', 'highlights': [ { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 }, ] }, 'excerpt': { 'text': 'string', 'highlights': [ { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 }, ] } }, 'rankingData': { 'relevanceScore': 123.0, 'relevanceLevel': 'HIGH'|'MEDIUM'|'LOW' } }, 'generativeData': { 'completion': 'string', 'references': [ {'... recursive ...'}, ], 'rankingData': { 'relevanceScore': 123.0, 'relevanceLevel': 'HIGH'|'MEDIUM'|'LOW' } }, 'intentDetectedData': { 'intent': 'string', 'intentId': 'string' }, 'sourceContentData': { 'id': 'string', 'type': 'KNOWLEDGE_CONTENT', 'textData': { 'title': { 'text': 'string', 'highlights': [ { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 }, ] }, 'excerpt': { 'text': 'string', 'highlights': [ { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 }, ] } }, 'rankingData': { 'relevanceScore': 123.0, 'relevanceLevel': 'HIGH'|'MEDIUM'|'LOW' }, 'citationSpan': { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 } }, 'generativeChunkData': { 'completion': 'string', 'references': [ {'... recursive ...'}, ], 'nextChunkToken': 'string' } } } }, ], 'triggers': [ { 'id': 'string', 'type': 'QUERY'|'GENERATIVE', 'source': 'ISSUE_DETECTION'|'RULE_EVALUATION'|'OTHER', 'data': { 'query': { 'text': 'string' } }, 'recommendationIds': [ 'string', ] }, ] }
Response Structure
(dict) --
recommendations (list) --
The recommendations.
(dict) --
Information about the recommendation.
recommendationId (string) --
The identifier of the recommendation.
document (dict) --
The recommended document.
contentReference (dict) --
A reference to the content resource.
knowledgeBaseArn (string) --
The Amazon Resource Name (ARN) of the knowledge base.
knowledgeBaseId (string) --
The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base.
contentArn (string) --
The Amazon Resource Name (ARN) of the content.
contentId (string) --
The identifier of the content.
sourceURL (string) --
The web URL of the source content.
referenceType (string) --
The type of reference content.
title (dict) --
The title of the document.
text (string) --
Text in the document.
highlights (list) --
Highlights in the document text.
(dict) --
Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.
beginOffsetInclusive (integer) --
The offset for the start of the highlight.
endOffsetExclusive (integer) --
The offset for the end of the highlight.
excerpt (dict) --
The excerpt from the document.
text (string) --
Text in the document.
highlights (list) --
Highlights in the document text.
(dict) --
Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.
beginOffsetInclusive (integer) --
The offset for the start of the highlight.
endOffsetExclusive (integer) --
The offset for the end of the highlight.
relevanceScore (float) --
The relevance score of the recommendation.
relevanceLevel (string) --
The relevance level of the recommendation.
type (string) --
The type of recommendation.
data (dict) --
Summary of the recommended content.
reference (dict) --
Reference information about the content.
contentReference (dict) --
Reference information about the content.
knowledgeBaseArn (string) --
The Amazon Resource Name (ARN) of the knowledge base.
knowledgeBaseId (string) --
The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base.
contentArn (string) --
The Amazon Resource Name (ARN) of the content.
contentId (string) --
The identifier of the content.
sourceURL (string) --
The web URL of the source content.
referenceType (string) --
The type of reference content.
generativeReference (dict) --
Reference information about the generative content.
modelId (string) --
The identifier of the LLM model.
generationId (string) --
The identifier of the LLM model.
details (dict) --
Details about the data.
contentData (dict) --
Details about the content data.
textData (dict) --
Details about the content text data.
title (dict) --
The text of the document.
text (string) --
Text in the document.
highlights (list) --
Highlights in the document text.
(dict) --
Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.
beginOffsetInclusive (integer) --
The offset for the start of the highlight.
endOffsetExclusive (integer) --
The offset for the end of the highlight.
excerpt (dict) --
The text of the document.
text (string) --
Text in the document.
highlights (list) --
Highlights in the document text.
(dict) --
Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.
beginOffsetInclusive (integer) --
The offset for the start of the highlight.
endOffsetExclusive (integer) --
The offset for the end of the highlight.
rankingData (dict) --
Details about the content ranking data.
relevanceScore (float) --
The relevance level of the recommendation.
relevanceLevel (string) --
The relevance score of the content.
generativeData (dict) --
Details about the generative data.
completion (string) --
The LLM response.
references (list) --
The references used to generative the LLM response.
(dict) --
Summary of the data.
rankingData (dict) --
Details about the generative content ranking data.
relevanceScore (float) --
The relevance level of the recommendation.
relevanceLevel (string) --
The relevance score of the content.
intentDetectedData (dict) --
Details about the intent data.
intent (string) --
The detected intent.
intentId (string) --
The identifier of the detected intent.
sourceContentData (dict) --
Details about the content data.
id (string) --
The identifier of the source content.
type (string) --
The type of the source content.
textData (dict) --
Details about the source content text data.
title (dict) --
The text of the document.
text (string) --
Text in the document.
highlights (list) --
Highlights in the document text.
(dict) --
Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.
beginOffsetInclusive (integer) --
The offset for the start of the highlight.
endOffsetExclusive (integer) --
The offset for the end of the highlight.
excerpt (dict) --
The text of the document.
text (string) --
Text in the document.
highlights (list) --
Highlights in the document text.
(dict) --
Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.
beginOffsetInclusive (integer) --
The offset for the start of the highlight.
endOffsetExclusive (integer) --
The offset for the end of the highlight.
rankingData (dict) --
Details about the source content ranking data.
relevanceScore (float) --
The relevance level of the recommendation.
relevanceLevel (string) --
The relevance score of the content.
citationSpan (dict) --
Contains information about where the text with a citation begins and ends in the generated output.
beginOffsetInclusive (integer) --
Where the text with a citation starts in the generated output.
endOffsetExclusive (integer) --
Where the text with a citation ends in the generated output.
generativeChunkData (dict) --
Details about the generative chunk data.
completion (string) --
A chunk of the LLM response.
references (list) --
The references used to generate the LLM response.
(dict) --
Summary of the data.
nextChunkToken (string) --
The token for the next set of chunks. Use the value returned in the previous response in the next request to retrieve the next set of chunks.
triggers (list) --
The triggers corresponding to recommendations.
(dict) --
A recommendation trigger provides context on the event that produced the referenced recommendations. Recommendations are only referenced in recommendationIds by a single RecommendationTrigger.
id (string) --
The identifier of the recommendation trigger.
type (string) --
The type of recommendation trigger.
source (string) --
The source of the recommendation trigger.
ISSUE_DETECTION: The corresponding recommendations were triggered by a Contact Lens issue.
RULE_EVALUATION: The corresponding recommendations were triggered by a Contact Lens rule.
data (dict) --
A union type containing information related to the trigger.
query (dict) --
Data associated with the QUERY RecommendationTriggerType.
text (string) --
The text associated with the recommendation trigger.
recommendationIds (list) --
The identifiers of the recommendations.
(string) --
{'session': {'origin': 'SYSTEM | CUSTOMER'}}
Retrieves information for a specified session.
See also: AWS API Documentation
Request Syntax
client.get_session( assistantId='string', sessionId='string' )
string
[REQUIRED]
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
string
[REQUIRED]
The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN.
dict
Response Syntax
{ 'session': { 'sessionArn': 'string', 'sessionId': 'string', 'name': 'string', 'description': 'string', 'tags': { 'string': 'string' }, 'integrationConfiguration': { 'topicIntegrationArn': 'string' }, 'tagFilter': { 'tagCondition': { 'key': 'string', 'value': 'string' }, 'andConditions': [ { 'key': 'string', 'value': 'string' }, ], 'orConditions': [ { 'andConditions': [ { 'key': 'string', 'value': 'string' }, ], 'tagCondition': { 'key': 'string', 'value': 'string' } }, ] }, 'aiAgentConfiguration': { 'string': { 'aiAgentId': 'string' } }, 'origin': 'SYSTEM'|'CUSTOMER' } }
Response Structure
(dict) --
session (dict) --
The session.
sessionArn (string) --
The Amazon Resource Name (ARN) of the session.
sessionId (string) --
The identifier of the session.
name (string) --
The name of the session.
description (string) --
The description of the session.
tags (dict) --
The tags used to organize, track, or control access for this resource.
(string) --
(string) --
integrationConfiguration (dict) --
The configuration information for the session integration.
topicIntegrationArn (string) --
The Amazon Resource Name (ARN) of the integrated Amazon SNS topic used for streaming chat messages.
tagFilter (dict) --
An object that can be used to specify Tag conditions.
tagCondition (dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) --
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
andConditions (list) --
A list of conditions which would be applied together with an AND condition.
(dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) --
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
orConditions (list) --
A list of conditions which would be applied together with an OR condition.
(dict) --
A list of conditions which would be applied together with an OR condition.
andConditions (list) --
A list of conditions which would be applied together with an AND condition.
(dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) --
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
tagCondition (dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) --
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
aiAgentConfiguration (dict) --
The configuration of the AI Agents (mapped by AI Agent Type to AI Agent version) that should be used by Amazon Q in Connect for this Session.
(string) --
(dict) --
A type that specifies the AI Agent ID configuration data when mapping an AI Agents to be used for an AI Agent type on a session or assistant.
aiAgentId (string) --
The ID of the AI Agent to be configured.
origin (string) --
The origin of the Session to be listed. SYSTEM for a default Session created by Amazon Q in Connect or CUSTOMER for a Session created by calling CreateSession API.
{'aiPromptVersionSummaries': {'aiPromptSummary': {'apiFormat': {'MESSAGES', 'TEXT_COMPLETIONS'}}}}
Lists AI Prompt versions.
See also: AWS API Documentation
Request Syntax
client.list_ai_prompt_versions( assistantId='string', aiPromptId='string', nextToken='string', maxResults=123, origin='SYSTEM'|'CUSTOMER' )
string
[REQUIRED]
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
string
[REQUIRED]
The identifier of the Amazon Q in Connect AI prompt for which versions are to be listed.
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.
integer
The maximum number of results to return per page.
string
The origin of the AI Prompt versions 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.
dict
Response Syntax
{ 'aiPromptVersionSummaries': [ { 'aiPromptSummary': { 'name': 'string', 'assistantId': 'string', 'assistantArn': 'string', 'aiPromptId': 'string', 'type': 'ANSWER_GENERATION'|'INTENT_LABELING_GENERATION'|'QUERY_REFORMULATION'|'SELF_SERVICE_PRE_PROCESSING'|'SELF_SERVICE_ANSWER_GENERATION', 'aiPromptArn': 'string', 'modifiedTime': datetime(2015, 1, 1), 'templateType': 'TEXT', 'modelId': 'string', 'apiFormat': 'ANTHROPIC_CLAUDE_MESSAGES'|'ANTHROPIC_CLAUDE_TEXT_COMPLETIONS'|'MESSAGES'|'TEXT_COMPLETIONS', 'visibilityStatus': 'SAVED'|'PUBLISHED', 'origin': 'SYSTEM'|'CUSTOMER', 'description': 'string', 'status': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'ACTIVE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETED', 'tags': { 'string': 'string' } }, 'versionNumber': 123 }, ], 'nextToken': 'string' }
Response Structure
(dict) --
aiPromptVersionSummaries (list) --
The summaries of the AI Prompt versions.
(dict) --
The summary of the AI Prompt version.
aiPromptSummary (dict) --
The date for the summary of the AI Prompt version.
name (string) --
The name of the AI Prompt.
assistantId (string) --
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
assistantArn (string) --
The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant.
aiPromptId (string) --
The identifier of the Amazon Q in Connect AI prompt.
type (string) --
The type of this AI Prompt.
aiPromptArn (string) --
The Amazon Resource Name (ARN) of the AI Prompt.
modifiedTime (datetime) --
The time the AI Prompt was last modified.
templateType (string) --
The type of the prompt template for this AI Prompt.
modelId (string) --
The identifier of the model used for this AI Prompt. Model Ids supported are: anthropic.claude-3-haiku-20240307-v1:0.
apiFormat (string) --
The API format used for this AI Prompt.
visibilityStatus (string) --
The visibility status of the AI Prompt.
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.
description (string) --
The description of the AI Prompt.
status (string) --
The status of the AI Prompt.
tags (dict) --
The tags used to organize, track, or control access for this resource.
(string) --
(string) --
versionNumber (integer) --
The version number for this AI Prompt version.
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.
{'aiPromptSummaries': {'apiFormat': {'MESSAGES', 'TEXT_COMPLETIONS'}}}
Lists the AI Prompts available on the Amazon Q in Connect assistant.
See also: AWS API Documentation
Request Syntax
client.list_ai_prompts( assistantId='string', nextToken='string', maxResults=123, origin='SYSTEM'|'CUSTOMER' )
string
[REQUIRED]
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
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.
integer
The maximum number of results to return per page.
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.
dict
Response Syntax
{ 'aiPromptSummaries': [ { 'name': 'string', 'assistantId': 'string', 'assistantArn': 'string', 'aiPromptId': 'string', 'type': 'ANSWER_GENERATION'|'INTENT_LABELING_GENERATION'|'QUERY_REFORMULATION'|'SELF_SERVICE_PRE_PROCESSING'|'SELF_SERVICE_ANSWER_GENERATION', 'aiPromptArn': 'string', 'modifiedTime': datetime(2015, 1, 1), 'templateType': 'TEXT', 'modelId': 'string', 'apiFormat': 'ANTHROPIC_CLAUDE_MESSAGES'|'ANTHROPIC_CLAUDE_TEXT_COMPLETIONS'|'MESSAGES'|'TEXT_COMPLETIONS', 'visibilityStatus': 'SAVED'|'PUBLISHED', 'origin': 'SYSTEM'|'CUSTOMER', 'description': 'string', 'status': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'ACTIVE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETED', 'tags': { 'string': 'string' } }, ], 'nextToken': 'string' }
Response Structure
(dict) --
aiPromptSummaries (list) --
The summaries of the AI Prompts.
(dict) --
The summary of the AI Prompt.
name (string) --
The name of the AI Prompt.
assistantId (string) --
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
assistantArn (string) --
The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant.
aiPromptId (string) --
The identifier of the Amazon Q in Connect AI prompt.
type (string) --
The type of this AI Prompt.
aiPromptArn (string) --
The Amazon Resource Name (ARN) of the AI Prompt.
modifiedTime (datetime) --
The time the AI Prompt was last modified.
templateType (string) --
The type of the prompt template for this AI Prompt.
modelId (string) --
The identifier of the model used for this AI Prompt. Model Ids supported are: anthropic.claude-3-haiku-20240307-v1:0.
apiFormat (string) --
The API format used for this AI Prompt.
visibilityStatus (string) --
The visibility status of the AI Prompt.
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.
description (string) --
The description of the AI Prompt.
status (string) --
The status of the AI Prompt.
tags (dict) --
The tags used to organize, track, or control access for this resource.
(string) --
(string) --
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.
{'results': {'data': {'details': {'generativeChunkData': {'completion': 'string', 'nextChunkToken': 'string', 'references': [{'details': {'contentData': {'rankingData': {'relevanceLevel': 'HIGH ' '| ' 'MEDIUM ' '| ' 'LOW', 'relevanceScore': 'double'}, 'textData': {'excerpt': {'highlights': [{'beginOffsetInclusive': 'integer', 'endOffsetExclusive': 'integer'}], 'text': 'string'}, 'title': {'highlights': [{'beginOffsetInclusive': 'integer', 'endOffsetExclusive': 'integer'}], 'text': 'string'}}}, 'generativeChunkData': (), 'generativeData': {'completion': 'string', 'rankingData': {'relevanceLevel': 'HIGH ' '| ' 'MEDIUM ' '| ' 'LOW', 'relevanceScore': 'double'}, 'references': ()}, 'intentDetectedData': {'intent': 'string', 'intentId': 'string'}, 'sourceContentData': {'citationSpan': {'beginOffsetInclusive': 'integer', 'endOffsetExclusive': 'integer'}, 'id': 'string', 'rankingData': {'relevanceLevel': 'HIGH ' '| ' 'MEDIUM ' '| ' 'LOW', 'relevanceScore': 'double'}, 'textData': {'excerpt': {'highlights': [{'beginOffsetInclusive': 'integer', 'endOffsetExclusive': 'integer'}], 'text': 'string'}, 'title': {'highlights': [{'beginOffsetInclusive': 'integer', 'endOffsetExclusive': 'integer'}], 'text': 'string'}}, 'type': 'KNOWLEDGE_CONTENT'}}, 'reference': {'contentReference': {'contentArn': 'string', 'contentId': 'string', 'knowledgeBaseArn': 'string', 'knowledgeBaseId': 'string', 'referenceType': 'WEB_CRAWLER ' '| ' 'KNOWLEDGE_BASE', 'sourceURL': 'string'}, 'generativeReference': {'generationId': 'string', 'modelId': 'string'}}}]}}}, 'type': {'BLOCKED_GENERATIVE_ANSWER_CHUNK', 'BLOCKED_INTENT_ANSWER_CHUNK', 'GENERATIVE_ANSWER_CHUNK', 'INTENT_ANSWER_CHUNK'}}}
Performs a manual search against the specified assistant. To retrieve recommendations for an assistant, use GetRecommendations.
See also: AWS API Documentation
Request Syntax
client.query_assistant( assistantId='string', queryText='string', nextToken='string', maxResults=123, sessionId='string', queryCondition=[ { 'single': { 'field': 'RESULT_TYPE', 'comparator': 'EQUALS', 'value': 'string' } }, ], queryInputData={ 'queryTextInputData': { 'text': 'string' }, 'intentInputData': { 'intentId': 'string' } }, overrideKnowledgeBaseSearchType='HYBRID'|'SEMANTIC' )
string
[REQUIRED]
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
string
The text to search for.
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.
integer
The maximum number of results to return per page.
string
The identifier of the Amazon Q in Connect session. Can be either the ID or the ARN. URLs cannot contain the ARN.
list
Information about how to query content.
(dict) --
Information about how to query content.
single (dict) --
The condition for the query.
field (string) -- [REQUIRED]
The name of the field for query condition to query on.
comparator (string) -- [REQUIRED]
The comparison operator for query condition to query on.
value (string) -- [REQUIRED]
The value for the query condition to query on.
dict
Information about the query.
queryTextInputData (dict) --
Input information for the query.
text (string) -- [REQUIRED]
The text to search for.
intentInputData (dict) --
Input information for the intent.
intentId (string) -- [REQUIRED]
The identifier of the Amazon Q intent.
string
The search type to be used against the Knowledge Base for this request. The values can be SEMANTIC which uses vector embeddings or HYBRID which use vector embeddings and raw text.
dict
Response Syntax
{ 'results': [ { 'resultId': 'string', 'document': { 'contentReference': { 'knowledgeBaseArn': 'string', 'knowledgeBaseId': 'string', 'contentArn': 'string', 'contentId': 'string', 'sourceURL': 'string', 'referenceType': 'WEB_CRAWLER'|'KNOWLEDGE_BASE' }, 'title': { 'text': 'string', 'highlights': [ { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 }, ] }, 'excerpt': { 'text': 'string', 'highlights': [ { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 }, ] } }, 'relevanceScore': 123.0, 'data': { 'reference': { 'contentReference': { 'knowledgeBaseArn': 'string', 'knowledgeBaseId': 'string', 'contentArn': 'string', 'contentId': 'string', 'sourceURL': 'string', 'referenceType': 'WEB_CRAWLER'|'KNOWLEDGE_BASE' }, 'generativeReference': { 'modelId': 'string', 'generationId': 'string' } }, 'details': { 'contentData': { 'textData': { 'title': { 'text': 'string', 'highlights': [ { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 }, ] }, 'excerpt': { 'text': 'string', 'highlights': [ { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 }, ] } }, 'rankingData': { 'relevanceScore': 123.0, 'relevanceLevel': 'HIGH'|'MEDIUM'|'LOW' } }, 'generativeData': { 'completion': 'string', 'references': [ {'... recursive ...'}, ], 'rankingData': { 'relevanceScore': 123.0, 'relevanceLevel': 'HIGH'|'MEDIUM'|'LOW' } }, 'intentDetectedData': { 'intent': 'string', 'intentId': 'string' }, 'sourceContentData': { 'id': 'string', 'type': 'KNOWLEDGE_CONTENT', 'textData': { 'title': { 'text': 'string', 'highlights': [ { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 }, ] }, 'excerpt': { 'text': 'string', 'highlights': [ { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 }, ] } }, 'rankingData': { 'relevanceScore': 123.0, 'relevanceLevel': 'HIGH'|'MEDIUM'|'LOW' }, 'citationSpan': { 'beginOffsetInclusive': 123, 'endOffsetExclusive': 123 } }, 'generativeChunkData': { 'completion': 'string', 'references': [ {'... recursive ...'}, ], 'nextChunkToken': 'string' } } }, 'type': 'KNOWLEDGE_CONTENT'|'INTENT_ANSWER'|'GENERATIVE_ANSWER'|'GENERATIVE_ANSWER_CHUNK'|'BLOCKED_GENERATIVE_ANSWER_CHUNK'|'INTENT_ANSWER_CHUNK'|'BLOCKED_INTENT_ANSWER_CHUNK' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
results (list) --
The results of the query.
(dict) --
Information about the result.
resultId (string) --
The identifier of the result data.
document (dict) --
The document.
contentReference (dict) --
A reference to the content resource.
knowledgeBaseArn (string) --
The Amazon Resource Name (ARN) of the knowledge base.
knowledgeBaseId (string) --
The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base.
contentArn (string) --
The Amazon Resource Name (ARN) of the content.
contentId (string) --
The identifier of the content.
sourceURL (string) --
The web URL of the source content.
referenceType (string) --
The type of reference content.
title (dict) --
The title of the document.
text (string) --
Text in the document.
highlights (list) --
Highlights in the document text.
(dict) --
Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.
beginOffsetInclusive (integer) --
The offset for the start of the highlight.
endOffsetExclusive (integer) --
The offset for the end of the highlight.
excerpt (dict) --
The excerpt from the document.
text (string) --
Text in the document.
highlights (list) --
Highlights in the document text.
(dict) --
Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.
beginOffsetInclusive (integer) --
The offset for the start of the highlight.
endOffsetExclusive (integer) --
The offset for the end of the highlight.
relevanceScore (float) --
The relevance score of the results.
data (dict) --
Summary of the recommended content.
reference (dict) --
Reference information about the content.
contentReference (dict) --
Reference information about the content.
knowledgeBaseArn (string) --
The Amazon Resource Name (ARN) of the knowledge base.
knowledgeBaseId (string) --
The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base.
contentArn (string) --
The Amazon Resource Name (ARN) of the content.
contentId (string) --
The identifier of the content.
sourceURL (string) --
The web URL of the source content.
referenceType (string) --
The type of reference content.
generativeReference (dict) --
Reference information about the generative content.
modelId (string) --
The identifier of the LLM model.
generationId (string) --
The identifier of the LLM model.
details (dict) --
Details about the data.
contentData (dict) --
Details about the content data.
textData (dict) --
Details about the content text data.
title (dict) --
The text of the document.
text (string) --
Text in the document.
highlights (list) --
Highlights in the document text.
(dict) --
Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.
beginOffsetInclusive (integer) --
The offset for the start of the highlight.
endOffsetExclusive (integer) --
The offset for the end of the highlight.
excerpt (dict) --
The text of the document.
text (string) --
Text in the document.
highlights (list) --
Highlights in the document text.
(dict) --
Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.
beginOffsetInclusive (integer) --
The offset for the start of the highlight.
endOffsetExclusive (integer) --
The offset for the end of the highlight.
rankingData (dict) --
Details about the content ranking data.
relevanceScore (float) --
The relevance level of the recommendation.
relevanceLevel (string) --
The relevance score of the content.
generativeData (dict) --
Details about the generative data.
completion (string) --
The LLM response.
references (list) --
The references used to generative the LLM response.
(dict) --
Summary of the data.
rankingData (dict) --
Details about the generative content ranking data.
relevanceScore (float) --
The relevance level of the recommendation.
relevanceLevel (string) --
The relevance score of the content.
intentDetectedData (dict) --
Details about the intent data.
intent (string) --
The detected intent.
intentId (string) --
The identifier of the detected intent.
sourceContentData (dict) --
Details about the content data.
id (string) --
The identifier of the source content.
type (string) --
The type of the source content.
textData (dict) --
Details about the source content text data.
title (dict) --
The text of the document.
text (string) --
Text in the document.
highlights (list) --
Highlights in the document text.
(dict) --
Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.
beginOffsetInclusive (integer) --
The offset for the start of the highlight.
endOffsetExclusive (integer) --
The offset for the end of the highlight.
excerpt (dict) --
The text of the document.
text (string) --
Text in the document.
highlights (list) --
Highlights in the document text.
(dict) --
Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.
beginOffsetInclusive (integer) --
The offset for the start of the highlight.
endOffsetExclusive (integer) --
The offset for the end of the highlight.
rankingData (dict) --
Details about the source content ranking data.
relevanceScore (float) --
The relevance level of the recommendation.
relevanceLevel (string) --
The relevance score of the content.
citationSpan (dict) --
Contains information about where the text with a citation begins and ends in the generated output.
beginOffsetInclusive (integer) --
Where the text with a citation starts in the generated output.
endOffsetExclusive (integer) --
Where the text with a citation ends in the generated output.
generativeChunkData (dict) --
Details about the generative chunk data.
completion (string) --
A chunk of the LLM response.
references (list) --
The references used to generate the LLM response.
(dict) --
Summary of the data.
nextChunkToken (string) --
The token for the next set of chunks. Use the value returned in the previous response in the next request to retrieve the next set of chunks.
type (string) --
The type of the query result.
nextToken (string) --
If there are additional results, this is the token for the next set of results.
{'configuration': {'generateFillerMessage': 'boolean'}}
Submits a message to the Amazon Q in Connect session.
See also: AWS API Documentation
Request Syntax
client.send_message( assistantId='string', sessionId='string', type='TEXT', message={ 'value': { 'text': { 'value': 'string' } } }, conversationContext={ 'selfServiceConversationHistory': [ { 'turnNumber': 123, 'inputTranscript': 'string', 'botResponse': 'string' }, ] }, configuration={ 'generateFillerMessage': True|False }, clientToken='string' )
string
[REQUIRED]
The identifier of the Amazon Q in Connect assistant.
string
[REQUIRED]
The identifier of the Amazon Q in Connect session.
string
[REQUIRED]
The message type.
dict
[REQUIRED]
The message data to submit to the Amazon Q in Connect session.
value (dict) -- [REQUIRED]
The message input value.
text (dict) --
The message data in text type.
value (string) --
The value of the message data in text type.
dict
The conversation context before the Amazon Q in Connect session.
selfServiceConversationHistory (list) -- [REQUIRED]
The self service conversation history before the Amazon Q in Connect session.
(dict) --
The conversation history data to included in conversation context data before the Amazon Q in Connect session.
turnNumber (integer) -- [REQUIRED]
The number of turn of the conversation history data.
inputTranscript (string) --
The input transcript of the conversation history data.
botResponse (string) --
The bot response of the conversation history data.
dict
The configuration of the SendMessage request.
generateFillerMessage (boolean) --
Generates a filler response when tool selection is QUESTION.
string
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field.For more information about idempotency, see Making retries safe with idempotent APIs.
This field is autopopulated if not provided.
dict
Response Syntax
{ 'requestMessageId': 'string', 'configuration': { 'generateFillerMessage': True|False }, 'nextMessageToken': 'string' }
Response Structure
(dict) --
requestMessageId (string) --
The identifier of the submitted message.
configuration (dict) --
The configuration of the SendMessage request.
generateFillerMessage (boolean) --
Generates a filler response when tool selection is QUESTION.
nextMessageToken (string) --
The token for the next message, used by GetNextMessage.
{'aiPrompt': {'apiFormat': {'MESSAGES', 'TEXT_COMPLETIONS'}}}
Updates an AI Prompt.
See also: AWS API Documentation
Request Syntax
client.update_ai_prompt( clientToken='string', assistantId='string', aiPromptId='string', visibilityStatus='SAVED'|'PUBLISHED', templateConfiguration={ 'textFullAIPromptEditTemplateConfiguration': { 'text': 'string' } }, description='string' )
string
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs..
This field is autopopulated if not provided.
string
[REQUIRED]
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
string
[REQUIRED]
The identifier of the Amazon Q in Connect AI Prompt.
string
[REQUIRED]
The visibility status of the Amazon Q in Connect AI prompt.
dict
The configuration of the prompt template for this AI Prompt.
textFullAIPromptEditTemplateConfiguration (dict) --
The configuration for a prompt template that supports full textual prompt configuration using a YAML prompt.
text (string) -- [REQUIRED]
The YAML text for the AI Prompt template.
string
The description of the Amazon Q in Connect AI Prompt.
dict
Response Syntax
{ 'aiPrompt': { 'assistantId': 'string', 'assistantArn': 'string', 'aiPromptId': 'string', 'aiPromptArn': 'string', 'name': 'string', 'type': 'ANSWER_GENERATION'|'INTENT_LABELING_GENERATION'|'QUERY_REFORMULATION'|'SELF_SERVICE_PRE_PROCESSING'|'SELF_SERVICE_ANSWER_GENERATION', 'templateType': 'TEXT', 'modelId': 'string', 'apiFormat': 'ANTHROPIC_CLAUDE_MESSAGES'|'ANTHROPIC_CLAUDE_TEXT_COMPLETIONS'|'MESSAGES'|'TEXT_COMPLETIONS', 'templateConfiguration': { 'textFullAIPromptEditTemplateConfiguration': { 'text': 'string' } }, 'modifiedTime': datetime(2015, 1, 1), 'description': 'string', 'visibilityStatus': 'SAVED'|'PUBLISHED', 'tags': { 'string': 'string' }, 'origin': 'SYSTEM'|'CUSTOMER', 'status': 'CREATE_IN_PROGRESS'|'CREATE_FAILED'|'ACTIVE'|'DELETE_IN_PROGRESS'|'DELETE_FAILED'|'DELETED' } }
Response Structure
(dict) --
aiPrompt (dict) --
The data of the updated Amazon Q in Connect AI Prompt.
assistantId (string) --
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
assistantArn (string) --
The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant.
aiPromptId (string) --
The identifier of the Amazon Q in Connect AI prompt.
aiPromptArn (string) --
The Amazon Resource Name (ARN) of the AI Prompt.
name (string) --
The name of the AI Prompt
type (string) --
The type of this AI Prompt.
templateType (string) --
The type of the prompt template for this AI Prompt.
modelId (string) --
The identifier of the model used for this AI Prompt. The following model Ids are supported:
anthropic.claude-3-haiku--v1:0
apac.amazon.nova-lite-v1:0
apac.amazon.nova-micro-v1:0
apac.amazon.nova-pro-v1:0
apac.anthropic.claude-3-5-sonnet--v2:0
apac.anthropic.claude-3-haiku-20240307-v1:0
eu.amazon.nova-lite-v1:0
eu.amazon.nova-micro-v1:0
eu.amazon.nova-pro-v1:0
eu.anthropic.claude-3-7-sonnet-20250219-v1:0
eu.anthropic.claude-3-haiku-20240307-v1:0
us.amazon.nova-lite-v1:0
us.amazon.nova-micro-v1:0
us.amazon.nova-pro-v1:0
us.anthropic.claude-3-5-haiku-20241022-v1:0
us.anthropic.claude-3-7-sonnet-20250219-v1:0
us.anthropic.claude-3-haiku-20240307-v1:0
apiFormat (string) --
The API format used for this AI Prompt.
templateConfiguration (dict) --
The configuration of the prompt template for this AI Prompt.
textFullAIPromptEditTemplateConfiguration (dict) --
The configuration for a prompt template that supports full textual prompt configuration using a YAML prompt.
text (string) --
The YAML text for the AI Prompt template.
modifiedTime (datetime) --
The time the AI Prompt was last modified.
description (string) --
The description of the AI Prompt.
visibilityStatus (string) --
The visibility status of the AI Prompt.
tags (dict) --
The tags used to organize, track, or control access for this resource.
(string) --
(string) --
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.
status (string) --
The status of the AI Prompt.
{'session': {'origin': 'SYSTEM | CUSTOMER'}}
Updates a session. A session is a contextual container used for generating recommendations. Amazon Connect updates the existing Amazon Q in Connect session for each contact on which Amazon Q in Connect is enabled.
See also: AWS API Documentation
Request Syntax
client.update_session( assistantId='string', sessionId='string', description='string', tagFilter={ 'tagCondition': { 'key': 'string', 'value': 'string' }, 'andConditions': [ { 'key': 'string', 'value': 'string' }, ], 'orConditions': [ { 'andConditions': [ { 'key': 'string', 'value': 'string' }, ], 'tagCondition': { 'key': 'string', 'value': 'string' } }, ] }, aiAgentConfiguration={ 'string': { 'aiAgentId': 'string' } } )
string
[REQUIRED]
The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.
string
[REQUIRED]
The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN.
string
The description.
dict
An object that can be used to specify Tag conditions.
tagCondition (dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) -- [REQUIRED]
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
andConditions (list) --
A list of conditions which would be applied together with an AND condition.
(dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) -- [REQUIRED]
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
orConditions (list) --
A list of conditions which would be applied together with an OR condition.
(dict) --
A list of conditions which would be applied together with an OR condition.
andConditions (list) --
A list of conditions which would be applied together with an AND condition.
(dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) -- [REQUIRED]
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
tagCondition (dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) -- [REQUIRED]
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
dict
The configuration of the AI Agents (mapped by AI Agent Type to AI Agent version) that should be used by Amazon Q in Connect for this Session.
(string) --
(dict) --
A type that specifies the AI Agent ID configuration data when mapping an AI Agents to be used for an AI Agent type on a session or assistant.
aiAgentId (string) -- [REQUIRED]
The ID of the AI Agent to be configured.
dict
Response Syntax
{ 'session': { 'sessionArn': 'string', 'sessionId': 'string', 'name': 'string', 'description': 'string', 'tags': { 'string': 'string' }, 'integrationConfiguration': { 'topicIntegrationArn': 'string' }, 'tagFilter': { 'tagCondition': { 'key': 'string', 'value': 'string' }, 'andConditions': [ { 'key': 'string', 'value': 'string' }, ], 'orConditions': [ { 'andConditions': [ { 'key': 'string', 'value': 'string' }, ], 'tagCondition': { 'key': 'string', 'value': 'string' } }, ] }, 'aiAgentConfiguration': { 'string': { 'aiAgentId': 'string' } }, 'origin': 'SYSTEM'|'CUSTOMER' } }
Response Structure
(dict) --
session (dict) --
Information about the session.
sessionArn (string) --
The Amazon Resource Name (ARN) of the session.
sessionId (string) --
The identifier of the session.
name (string) --
The name of the session.
description (string) --
The description of the session.
tags (dict) --
The tags used to organize, track, or control access for this resource.
(string) --
(string) --
integrationConfiguration (dict) --
The configuration information for the session integration.
topicIntegrationArn (string) --
The Amazon Resource Name (ARN) of the integrated Amazon SNS topic used for streaming chat messages.
tagFilter (dict) --
An object that can be used to specify Tag conditions.
tagCondition (dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) --
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
andConditions (list) --
A list of conditions which would be applied together with an AND condition.
(dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) --
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
orConditions (list) --
A list of conditions which would be applied together with an OR condition.
(dict) --
A list of conditions which would be applied together with an OR condition.
andConditions (list) --
A list of conditions which would be applied together with an AND condition.
(dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) --
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
tagCondition (dict) --
A leaf node condition which can be used to specify a tag condition.
key (string) --
The tag key in the tag condition.
value (string) --
The tag value in the tag condition.
aiAgentConfiguration (dict) --
The configuration of the AI Agents (mapped by AI Agent Type to AI Agent version) that should be used by Amazon Q in Connect for this Session.
(string) --
(dict) --
A type that specifies the AI Agent ID configuration data when mapping an AI Agents to be used for an AI Agent type on a session or assistant.
aiAgentId (string) --
The ID of the AI Agent to be configured.
origin (string) --
The origin of the Session to be listed. SYSTEM for a default Session created by Amazon Q in Connect or CUSTOMER for a Session created by calling CreateSession API.