AWS lexv2 documentation change
Summary
Updated QnAIntent documentation to remove model-specific references, add support for additional context via session attributes, and expand locale support beyond US English
Security assessment
The changes are feature enhancements adding new capabilities (additional context support, locale expansion) and updating model references from specific Anthropic Claude models to generic 'Selected Bedrock Model'. No security vulnerabilities, patches, or security incidents are mentioned. The change to remove the requirement to sign up for Anthropic Claude model access appears to be a simplification of prerequisites rather than a security fix.
Diff
diff --git a/lexv2/latest/dg/built-in-intent-qna.md b/lexv2/latest/dg/built-in-intent-qna.md index 4c0fac6d8..2d68b3068 100644 --- a//lexv2/latest/dg/built-in-intent-qna.md +++ b//lexv2/latest/dg/built-in-intent-qna.md @@ -11 +11 @@ Before you can take advantage of the generative AI features, you must fulfill th - 1. Navigate to the [Amazon Bedrock console](https://console.aws.amazon.com/bedrock) and sign up for access to the Anthropic Claude model you intend to use (for more information, see [Model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html)). For information about pricing for using Amazon Bedrock, see [Amazon Bedrock pricing](https://aws.amazon.com/bedrock/pricing/). + 1. For information about pricing for using Amazon Bedrock, see [Amazon Bedrock pricing](https://aws.amazon.com/bedrock/pricing/). @@ -18 +18 @@ Before you can take advantage of the generative AI features, you must fulfill th -Responds to customer questions by using an Amazon Bedrock FM to search and summarize FAQ responses. Available in US English only. This intent is activated when an utterance is not classified into any of the other intents present in the bot. Note that this intent will not be activated for missed utterances when eliciting a slot value. Once recognized, the `AMAZON.QnAIntent`, uses the specified Amazon Bedrock model to search the configured Amazon Bedrock Knowledge Base and respond to the customer question. +Responds to customer questions by using an Amazon Bedrock FM to search and summarize FAQ responses. This intent is activated when an utterance is not classified into any of the other intents present in the bot. Note that this intent will not be activated for missed utterances when eliciting a slot value. Once recognized, the `AMAZON.QnAIntent`, uses the specified Amazon Bedrock model to search the configured Amazon Bedrock Knowledge Base and respond to the customer question. @@ -83,0 +84,2 @@ The responses from the QnAIntent will be stored into the request attributes as s + * `x-amz-lex:qna-additional-context` – The additional context used by the QnAIntent to generate the response. + @@ -97,2 +99,4 @@ Variable | Replaced by | Model | Required? -$query_results$ | The retrieved results for the user query from the Knowledge Store | Anthropic Claude Haiku, Anthropic Claude Sonnet | Yes -$output_instruction$ | Underlying instructions for formatting the response generation and citations. Differs by model. If you define your own formatting instructions, we suggest that you remove this placeholder. | Anthropic Claude Haiku, Anthropic Claude Sonnet | No +$query_results$ | The retrieved results for the user query from the Knowledge Store | Selected Bedrock Model | Yes +$output_instruction$ | Underlying instructions for formatting the response generation and citations. Differs by model. If you define your own formatting instructions, we suggest that you remove this placeholder. | Selected Bedrock Model | No +$additional_context$ | The additional context used by the QnAIntent to generate the response | Selected Bedrock Model | No +$locale$ | The language in which the bot will answer customer queries | Selected Bedrock Model | No @@ -104,0 +109,2 @@ $output_instruction$ | Underlying instructions for formatting the response gener + $additional_context$ + @@ -107 +113 @@ $output_instruction$ | Underlying instructions for formatting the response gener - Given the conversation history, and <Context>: + Given the conversation history, <additional_context> and <Context>: @@ -110 +116 @@ $output_instruction$ | Underlying instructions for formatting the response gener - (3) then, generate a concise, to-the-point FAQ-style response ONLY USING the grounding content in <Context>; or output CANNOTANSWER if the user query/request cannot be directly answered with the grounding content. DO NOT mention about the grounding passages such as ids or other meta data; do not create new content not presented in <Context>. Do NOT respond to query that is ill-intented or off-topic; + (3) then, generate a concise, to-the-point FAQ-style response in $locale$ locale ONLY USING the grounding content in <Context> and <additional_context>; or output CANNOTANSWER if the user query/request cannot be directly answered with the grounding content. DO NOT mention about the grounding passages such as ids or other meta data; do not create new content not presented in <Context>. Do NOT respond to query that is ill-intented or off-topic; @@ -134,0 +141,10 @@ The output instructions need to contain <text></text> and <passageId></passageId +**Additional context support through session attributes** + +You can pass additional context to the `AMAZON.QnAIntent` at runtime through the session attribute `x-amz-lex:qna-additional-context`. This allows you to provide supplementary information that the model can use alongside the knowledge store results when generating a response. The additional context is inserted into the prompt template through the `$additional_context$` placeholder. + +**Example:** + + + {"sessionAttributes": {"x-amz-lex:qna-additional-context":"Our support hours are Monday through Friday, 8AM-8PM EST"}} + +