diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/LexV2Event.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/LexV2Event.java new file mode 100644 index 00000000..0202c8ed --- /dev/null +++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/LexV2Event.java @@ -0,0 +1,310 @@ +/* + * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.amazonaws.services.lambda.runtime.events; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Map; + +/** + * Class to represent an Amazon Lex V2 event. + * + * @see Using + * an AWS Lambda function + */ +@Data +@Builder(setterPrefix = "with") +@NoArgsConstructor +@AllArgsConstructor +public class LexV2Event implements Serializable { + private String messageVersion; + private String invocationSource; + private String inputMode; + private String responseContentType; + private String sessionId; + private String inputTranscript; + private Bot bot; + private Interpretation[] interpretations; + private ProposedNextState proposedNextState; + private Map requestAttributes; + private SessionState sessionState; + private Transcription[] transcriptions; + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class Bot implements Serializable { + private String id; + private String name; + private String aliasId; + private String aliasName; + private String localeId; + private String version; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class Interpretation implements Serializable { + private Intent intent; + private Double nluConfidence; + private SentimentResponse sentimentResponse; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class Intent implements Serializable { + private String confirmationState; + private String name; + private Map slots; + private String state; + private KendraResponse kendraResponse; + + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + public Map getSlots() { + return this.slots; + } + + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + public void setSlots(Map slots) { + this.slots = slots; + } + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class Slot implements Serializable { + private String shape; + private SlotValue value; + private Slot[] values; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class SlotValue implements Serializable { + private String interpretedValue; + private String originalValue; + private String[] resolvedValues; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class KendraResponse implements Serializable { + private String queryId; + private KendraResponseResultItem[] resultItems; + private Object[] facetResults; + private Integer totalNumberOfResults; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class KendraResponseResultItem implements Serializable { + private String id; + private String type; + private Object[] additionalAttributes; + private String documentId; + private KendraResponseDocumentInfo documentTitle; + private KendraResponseDocumentInfo documentExcerpt; + private String documentURI; + private KendraResponseDocumentAttribute[] documentAttributes; + private KendraResponseScoreAttributes scoreAttributes; + private String feedbackToken; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class KendraResponseDocumentInfo implements Serializable { + private String text; + private KendraResponseDocumentHighlights[] highlights; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class KendraResponseDocumentHighlights implements Serializable { + private Integer beginOffset; + private Integer endOffset; + private boolean topAnswer; + private String type; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class KendraResponseDocumentAttribute implements Serializable { + private String key; + private Map value; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class KendraResponseScoreAttributes implements Serializable { + private String scoreConfidence; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class NluConfidence implements Serializable { + private Double score; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class SentimentResponse implements Serializable { + private String sentiment; + private SentimentScore sentimentScore; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class SentimentScore implements Serializable { + private Double mixed; + private Double negative; + private Double neutral; + private Double positive; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class ProposedNextState implements Serializable { + private DialogAction dialogAction; + private Intent intent; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class DialogAction implements Serializable { + private String slotToElicit; + private String type; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class SessionState implements Serializable { + private ActiveContext[] activeContexts; + private Map sessionAttributes; + private RuntimeHints runtimeHints; + private DialogAction dialogAction; + private Intent intent; + private String originatingRequestId; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class ActiveContext implements Serializable { + private String name; + private Map contextAttributes; + private TimeToLive timeToLive; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class TimeToLive implements Serializable { + private Integer timeToLiveInSeconds; + private Integer turnsToLive; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class RuntimeHints implements Serializable { + private Map> slotHints; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class Hint implements Serializable { + private RuntimeHintValue[] runtimeHintValues; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class RuntimeHintValue implements Serializable { + private String phrase; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class Transcription implements Serializable { + private String transcription; + private Double transcriptionConfidence; + private ResolvedContext resolvedContext; + private Map resolvedSlots; + + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + public Map getResolvedSlots() { + return this.resolvedSlots; + } + + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + public void setResolvedSlots(Map resolvedSlots) { + this.resolvedSlots = resolvedSlots; + } + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class ResolvedContext implements Serializable { + private String intent; + } +} diff --git a/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/LexV2Response.java b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/LexV2Response.java new file mode 100644 index 00000000..f6b09d60 --- /dev/null +++ b/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/LexV2Response.java @@ -0,0 +1,70 @@ +/* + * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ +package com.amazonaws.services.lambda.runtime.events; + +import com.amazonaws.services.lambda.runtime.events.LexV2Event.SessionState; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Map; + +/** + * Class to represent an Amazon Lex V2 response. + * + * @see Using + * an AWS Lambda function + */ +@Data +@Builder(setterPrefix = "with") +@NoArgsConstructor +@AllArgsConstructor +public class LexV2Response implements Serializable { + private SessionState sessionState; + private Message[] messages; + private Map requestAttributes; + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class Message implements Serializable { + private String contentType; + private String content; + private ImageResponseCard imageResponseCard; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class ImageResponseCard implements Serializable { + private String title; + private String subtitle; + private String imageUrl; + private Button[] buttons; + } + + @Data + @Builder(setterPrefix = "with") + @NoArgsConstructor + @AllArgsConstructor + public static class Button implements Serializable { + private String text; + private String value; + } +} diff --git a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/LambdaEventSerializersTest.java b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/LambdaEventSerializersTest.java index 67012557..fe772d55 100644 --- a/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/LambdaEventSerializersTest.java +++ b/aws-lambda-java-events/src/test/java/com/amazonaws/services/lambda/runtime/events/LambdaEventSerializersTest.java @@ -108,7 +108,7 @@ public void testAPIGatewayV2WebSocketEvent() throws IOException, JSONException { assertEquals(expected, actual, STRICT); } - @Test + @Test public void testAPIGatewayV2WebSocketResponse() throws IOException, JSONException { String expected = EventUtils.readEvent("api_gateway_v2_web_socket_response.json"); String actual = deserializeSerializeJsonToString(expected, APIGatewayV2WebSocketResponse.class); @@ -263,7 +263,8 @@ public void testCognitoUserPoolPreTokenGenerationEvent() throws IOException, JSO @Test public void testCognitoUserPoolVerifyAuthChallengeResponseEvent() throws IOException, JSONException { String expected = EventUtils.readEvent("cognito_user_pool_verify_auth_challenge_response_event.json"); - String actual = deserializeSerializeJsonToString(expected, CognitoUserPoolVerifyAuthChallengeResponseEvent.class); + String actual = deserializeSerializeJsonToString(expected, + CognitoUserPoolVerifyAuthChallengeResponseEvent.class); assertEquals(expected, actual, STRICT); } @@ -343,7 +344,8 @@ public void testKafkaEvent() throws IOException, JSONException { @Test public void testKinesisAnalyticsFirehoseInputPreprocessingEvent() throws IOException, JSONException { String expected = EventUtils.readEvent("kinesis_analytics_firehose_input_preprocessing_event.json"); - String actual = deserializeSerializeJsonToString(expected, KinesisAnalyticsFirehoseInputPreprocessingEvent.class); + String actual = deserializeSerializeJsonToString(expected, + KinesisAnalyticsFirehoseInputPreprocessingEvent.class); assertEquals(expected, actual, STRICT); } @@ -375,7 +377,8 @@ public void testKinesisAnalyticsOutputDeliveryResponse() throws IOException, JSO @Test public void testKinesisAnalyticsStreamsInputPreprocessingEvent() throws IOException, JSONException { String expected = EventUtils.readEvent("kinesis_analytics_streams_input_preprocessing_event.json"); - String actual = deserializeSerializeJsonToString(expected, KinesisAnalyticsStreamsInputPreprocessingEvent.class); + String actual = deserializeSerializeJsonToString(expected, + KinesisAnalyticsStreamsInputPreprocessingEvent.class); assertEquals(expected, actual, STRICT); } @@ -420,6 +423,30 @@ public void testLexEvent() throws IOException, JSONException { assertEquals(expected, actual, STRICT); } + @Test + public void testLexV2Event() throws IOException, JSONException { + String expected = EventUtils.readEvent("lex_v2_event.json"); + String actual = deserializeSerializeJsonToString(expected, LexV2Event.class); + + assertEquals(expected, actual, STRICT); + } + + @Test + public void testLexV2KendraSentimentEvent() throws IOException, JSONException { + String expected = EventUtils.readEvent("lex_v2_kendra_sentiment_event.json"); + String actual = deserializeSerializeJsonToString(expected, LexV2Event.class); + + assertEquals(expected, actual, STRICT); + } + + @Test + public void testLexV2Response() throws IOException, JSONException { + String expected = EventUtils.readEvent("lex_v2_response.json"); + String actual = deserializeSerializeJsonToString(expected, LexV2Response.class); + + assertEquals(expected, actual, STRICT); + } + @Test public void testRabbitMQ() throws IOException, JSONException { String expected = EventUtils.readEvent("rabbit_mq.json"); diff --git a/aws-lambda-java-events/src/test/resources/event_models/lex_v2_event.json b/aws-lambda-java-events/src/test/resources/event_models/lex_v2_event.json new file mode 100644 index 00000000..1fbb2590 --- /dev/null +++ b/aws-lambda-java-events/src/test/resources/event_models/lex_v2_event.json @@ -0,0 +1,142 @@ +{ + "sessionId": "123456789123456", + "inputTranscript": "deluxe", + "interpretations": [ + { + "intent": { + "slots": { + "RoomType": { + "shape": "Scalar", + "value": { + "originalValue": "deluxe", + "resolvedValues": [ + "deluxe" + ], + "interpretedValue": "deluxe" + } + }, + "CheckInDate": { + "shape": "Scalar", + "value": { + "originalValue": "fifth of may", + "resolvedValues": [ + "2022-05-05" + ], + "interpretedValue": "2022-05-05" + } + }, + "Nights": { + "shape": "Scalar", + "value": { + "originalValue": "fourteen", + "resolvedValues": [ + "14" + ], + "interpretedValue": "14" + } + }, + "Location": { + "shape": "Scalar", + "value": { + "originalValue": "seattle", + "resolvedValues": [ + "seattle" + ], + "interpretedValue": "seattle" + } + } + }, + "confirmationState": "None", + "name": "BookHotel", + "state": "InProgress" + }, + "nluConfidence": 1 + }, + { + "intent": { + "slots": {}, + "confirmationState": "None", + "name": "FallbackIntent", + "state": "InProgress" + } + }, + { + "intent": { + "slots": { + "ReturnDate": null, + "PickUpDate": null, + "DriverAge": null, + "CarType": null, + "PickUpCity": null + }, + "confirmationState": "None", + "name": "BookCar", + "state": "InProgress" + }, + "nluConfidence": 0.52 + } + ], + "responseContentType": "text/plain; charset=utf-8", + "invocationSource": "DialogCodeHook", + "messageVersion": "1.0", + "sessionState": { + "originatingRequestId": "00000000-1111-2222-3333-444444444444", + "activeContexts": [], + "intent": { + "slots": { + "RoomType": { + "shape": "Scalar", + "value": { + "originalValue": "deluxe", + "resolvedValues": [ + "deluxe" + ], + "interpretedValue": "deluxe" + } + }, + "CheckInDate": { + "shape": "Scalar", + "value": { + "originalValue": "fifth of may", + "resolvedValues": [ + "2022-05-05" + ], + "interpretedValue": "2022-05-05" + } + }, + "Nights": { + "shape": "Scalar", + "value": { + "originalValue": "fourteen", + "resolvedValues": [ + "14" + ], + "interpretedValue": "14" + } + }, + "Location": { + "shape": "Scalar", + "value": { + "originalValue": "seattle", + "resolvedValues": [ + "seattle" + ], + "interpretedValue": "seattle" + } + } + }, + "confirmationState": "None", + "name": "BookHotel", + "state": "InProgress" + } + }, + "inputMode": "Text", + "bot": { + "aliasName": "TestBotAlias", + "aliasId": "TSTALIASID", + "name": "BookTrip", + "version": "DRAFT", + "localeId": "en_US", + "id": "ABCDE01235" + } +} \ No newline at end of file diff --git a/aws-lambda-java-events/src/test/resources/event_models/lex_v2_kendra_sentiment_event.json b/aws-lambda-java-events/src/test/resources/event_models/lex_v2_kendra_sentiment_event.json new file mode 100644 index 00000000..ba6304fe --- /dev/null +++ b/aws-lambda-java-events/src/test/resources/event_models/lex_v2_kendra_sentiment_event.json @@ -0,0 +1,983 @@ +{ + "requestAttributes": { + "x-amz-lex:kendra-search-response-document-link-2": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/Storage.html", + "x-amz-lex:kendra-search-response-document-link-1": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/Storage.html", + "x-amz-lex:kendra-search-response-document-5": "...Instances\n\n \n \n \n Amazon EBS data services...", + "x-amz-lex:kendra-search-response-document-4": "...For more information about Amazon\n EBS pricing, see the \n Projecting Costs section of the Amazon Elastic Block Store page...", + "x-amz-lex:kendra-search-response-document-link-5": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/ebs-data-services.html", + "x-amz-lex:kendra-search-response-document-link-4": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/AmazonEBS.html", + "x-amz-lex:kendra-search-response-document-link-3": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/AmazonEBS.html", + "x-amz-lex:kendra-search-response-document-3": "...For more information about Amazon\n EBS pricing, see the \n Projecting Costs section of the Amazon Elastic Block Store page...", + "x-amz-lex:kendra-search-response-document-2": "...multiple volumes can be attached to an instance.\n You can\n also detach an EBS volume from one instance and attach it to another instance. You\n can...", + "x-amz-lex:kendra-search-response-document-1": "...multiple volumes can be attached to an instance.\n You can\n also detach an EBS volume from one instance and attach it to another instance. You\n can..." + }, + "sessionId": "123456789123456", + "inputTranscript": "What is EBS?", + "interpretations": [ + { + "intent": { + "slots": {}, + "confirmationState": "None", + "kendraResponse": { + "queryId": "abcdefgh-1234-1234-1234-ijklmnopqrst", + "resultItems": [ + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-b8b894b8-7da1-4abb-9f7a-6e6013baf61f", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/Storage.html", + "documentTitle": { + "text": "Storage - Amazon Elastic Compute Cloud", + "highlights": [] + }, + "documentExcerpt": { + "text": "...multiple volumes can be attached to an instance.\n You can\n also detach an EBS volume from one instance and attach it to another instance. You\n can...", + "highlights": [ + { + "beginOffset": 147, + "endOffset": 150, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/Storage.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/Storage.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-10" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-fb0b72bc-f91d-4b7a-b158-55b00eda3ff7", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/Storage.html", + "documentTitle": { + "text": "Storage - Amazon Elastic Compute Cloud", + "highlights": [] + }, + "documentExcerpt": { + "text": "...multiple volumes can be attached to an instance.\n You can\n also detach an EBS volume from one instance and attach it to another instance. You\n can...", + "highlights": [ + { + "beginOffset": 147, + "endOffset": 150, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/Storage.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/Storage.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-9" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-8f67430d-ab6e-44d7-a0ad-8ae6e76bedfe", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/AmazonEBS.html", + "documentTitle": { + "text": "Amazon Elastic Block Store (Amazon EBS) - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 35, + "endOffset": 38, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...For more information about Amazon\n EBS pricing, see the \n Projecting Costs section of the Amazon Elastic Block Store page...", + "highlights": [ + { + "beginOffset": 73, + "endOffset": 76, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/AmazonEBS.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/AmazonEBS.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-8" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-2c376c85-d46a-4b3f-8baf-fb276512698f", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/AmazonEBS.html", + "documentTitle": { + "text": "Amazon Elastic Block Store (Amazon EBS) - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 35, + "endOffset": 38, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...For more information about Amazon\n EBS pricing, see the \n Projecting Costs section of the Amazon Elastic Block Store page...", + "highlights": [ + { + "beginOffset": 73, + "endOffset": 76, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/AmazonEBS.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/AmazonEBS.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-2" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-ef9fb2c2-23ae-43e4-82d0-a8b7693c90f7", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/ebs-data-services.html", + "documentTitle": { + "text": "Amazon EBS data services - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 7, + "endOffset": 10, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...Instances\n\n \n \n \n Amazon EBS data services...", + "highlights": [ + { + "beginOffset": 147, + "endOffset": 150, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/ebs-data-services.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/ebs-data-services.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-3" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-9db425c8-d9ae-4b57-b726-1b52664f1dc5", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/ebs-data-services.html", + "documentTitle": { + "text": "Amazon EBS data services - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 7, + "endOffset": 10, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...Instances\n\n \n \n \n Amazon EBS data services...", + "highlights": [ + { + "beginOffset": 147, + "endOffset": 150, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/ebs-data-services.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/ebs-data-services.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-4" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-82f71cdb-0ca4-4828-b183-3054797fecd8", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/monitor-with-cloudtrail.html", + "documentTitle": { + "text": "Logging Amazon EC2 and Amazon EBS API calls with\n AWS CloudTrail - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 30, + "endOffset": 33, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...Guide for Linux Instances\n\n Amazon EC2 and Amazon EBS information in CloudTrailUnderstanding Amazon EC2 and Amazon EBS log file\n entriesAuditing users that connect via EC2 Instance Connect...", + "highlights": [ + { + "beginOffset": 79, + "endOffset": 82, + "topAnswer": false, + "type": "STANDARD" + }, + { + "beginOffset": 144, + "endOffset": 147, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/monitor-with-cloudtrail.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/monitor-with-cloudtrail.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-5" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-12f33f89-751e-49be-a5ed-d356fcdbcb69", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/monitor-with-cloudtrail.html", + "documentTitle": { + "text": "Logging Amazon EC2 and Amazon EBS API calls with\n AWS CloudTrail - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 30, + "endOffset": 33, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...Guide for Windows Instances\n\n Amazon EC2 and Amazon EBS information in CloudTrailUnderstanding Amazon EC2 and Amazon EBS log file\n entriesAuditing users that connect via EC2 Instance Connect...", + "highlights": [ + { + "beginOffset": 81, + "endOffset": 84, + "topAnswer": false, + "type": "STANDARD" + }, + { + "beginOffset": 146, + "endOffset": 149, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/monitor-with-cloudtrail.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/monitor-with-cloudtrail.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-6" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-a19f3b7e-56d8-4a65-b03a-799a38ef11e7", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/APIReference/API_EbsBlockDevice.html", + "documentTitle": { + "text": "EbsBlockDevice - Amazon Elastic Compute Cloud", + "highlights": [] + }, + "documentExcerpt": { + "text": "...For more\n information, see Preserving Amazon EBS volumes on instance termination in the\n Amazon Elastic Compute Cloud User Guide...", + "highlights": [ + { + "beginOffset": 92, + "endOffset": 95, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/APIReference/API_EbsBlockDevice.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/APIReference/API_EbsBlockDevice.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-7" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-193710fb-5552-4f8e-8215-7c9cb14ac1ff", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html", + "documentTitle": { + "text": "Amazon CloudWatch Events for Amazon EBS - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 36, + "endOffset": 39, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...Contents\n\n \tEBS volume events\n\tEBS snapshot events\n\tEBS volume modification events\n\tEBS fast snapshot restore events\n\tUsing AWS Lambda to handle CloudWatch events...", + "highlights": [ + { + "beginOffset": 50, + "endOffset": 53, + "topAnswer": false, + "type": "STANDARD" + }, + { + "beginOffset": 69, + "endOffset": 72, + "topAnswer": false, + "type": "STANDARD" + }, + { + "beginOffset": 90, + "endOffset": 93, + "topAnswer": false, + "type": "STANDARD" + }, + { + "beginOffset": 122, + "endOffset": 125, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-1" + } + ], + "facetResults": [], + "totalNumberOfResults": 369 + }, + "name": "KendraSearchIntent", + "state": "ReadyForFulfillment" + }, + "sentimentResponse": { + "sentimentScore": { + "mixed": 0.0001402172929374501, + "neutral": 0.8999575972557068, + "negative": 0.09440270811319351, + "positive": 0.005499483551830053 + }, + "sentiment": "NEUTRAL" + } + }, + { + "intent": { + "slots": {}, + "confirmationState": "None", + "name": "FallbackIntent", + "state": "ReadyForFulfillment" + }, + "sentimentResponse": { + "sentimentScore": { + "mixed": 0.0001402172929374501, + "neutral": 0.8999575972557068, + "negative": 0.09440270811319351, + "positive": 0.005499483551830053 + }, + "sentiment": "NEUTRAL" + } + }, + { + "intent": { + "slots": { + "RoomType": null, + "CheckInDate": null, + "Nights": null, + "Location": null + }, + "confirmationState": "None", + "name": "BookHotel", + "state": "ReadyForFulfillment" + }, + "sentimentResponse": { + "sentimentScore": { + "mixed": 0.0001402172929374501, + "neutral": 0.8999575972557068, + "negative": 0.09440270811319351, + "positive": 0.005499483551830053 + }, + "sentiment": "NEUTRAL" + }, + "nluConfidence": 0.61 + }, + { + "intent": { + "slots": { + "PickUpDate": null, + "ReturnDate": null, + "DriverAge": null, + "CarType": null, + "PickUpCity": null + }, + "confirmationState": "None", + "name": "BookCar", + "state": "ReadyForFulfillment" + }, + "sentimentResponse": { + "sentimentScore": { + "mixed": 0.0001402172929374501, + "neutral": 0.8999575972557068, + "negative": 0.09440270811319351, + "positive": 0.005499483551830053 + }, + "sentiment": "NEUTRAL" + }, + "nluConfidence": 0.45 + } + ], + "responseContentType": "text/plain; charset=utf-8", + "invocationSource": "FulfillmentCodeHook", + "messageVersion": "1.0", + "sessionState": { + "activeContexts": [], + "intent": { + "slots": {}, + "confirmationState": "None", + "kendraResponse": { + "queryId": "abcdefgh-1234-1234-1234-ijklmnopqrst", + "resultItems": [ + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-b8b894b8-7da1-4abb-9f7a-6e6013baf61f", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/Storage.html", + "documentTitle": { + "text": "Storage - Amazon Elastic Compute Cloud", + "highlights": [] + }, + "documentExcerpt": { + "text": "...multiple volumes can be attached to an instance.\n You can\n also detach an EBS volume from one instance and attach it to another instance. You\n can...", + "highlights": [ + { + "beginOffset": 147, + "endOffset": 150, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/Storage.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/Storage.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-10" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-fb0b72bc-f91d-4b7a-b158-55b00eda3ff7", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/Storage.html", + "documentTitle": { + "text": "Storage - Amazon Elastic Compute Cloud", + "highlights": [] + }, + "documentExcerpt": { + "text": "...multiple volumes can be attached to an instance.\n You can\n also detach an EBS volume from one instance and attach it to another instance. You\n can...", + "highlights": [ + { + "beginOffset": 147, + "endOffset": 150, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/Storage.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/Storage.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-9" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-8f67430d-ab6e-44d7-a0ad-8ae6e76bedfe", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/AmazonEBS.html", + "documentTitle": { + "text": "Amazon Elastic Block Store (Amazon EBS) - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 35, + "endOffset": 38, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...For more information about Amazon\n EBS pricing, see the \n Projecting Costs section of the Amazon Elastic Block Store page...", + "highlights": [ + { + "beginOffset": 73, + "endOffset": 76, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/AmazonEBS.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/AmazonEBS.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-8" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-2c376c85-d46a-4b3f-8baf-fb276512698f", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/AmazonEBS.html", + "documentTitle": { + "text": "Amazon Elastic Block Store (Amazon EBS) - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 35, + "endOffset": 38, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...For more information about Amazon\n EBS pricing, see the \n Projecting Costs section of the Amazon Elastic Block Store page...", + "highlights": [ + { + "beginOffset": 73, + "endOffset": 76, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/AmazonEBS.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/AmazonEBS.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-2" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-ef9fb2c2-23ae-43e4-82d0-a8b7693c90f7", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/ebs-data-services.html", + "documentTitle": { + "text": "Amazon EBS data services - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 7, + "endOffset": 10, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...Instances\n\n \n \n \n Amazon EBS data services...", + "highlights": [ + { + "beginOffset": 147, + "endOffset": 150, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/ebs-data-services.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/ebs-data-services.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-3" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-9db425c8-d9ae-4b57-b726-1b52664f1dc5", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/ebs-data-services.html", + "documentTitle": { + "text": "Amazon EBS data services - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 7, + "endOffset": 10, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...Instances\n\n \n \n \n Amazon EBS data services...", + "highlights": [ + { + "beginOffset": 147, + "endOffset": 150, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/ebs-data-services.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/ebs-data-services.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-4" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-82f71cdb-0ca4-4828-b183-3054797fecd8", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/monitor-with-cloudtrail.html", + "documentTitle": { + "text": "Logging Amazon EC2 and Amazon EBS API calls with\n AWS CloudTrail - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 30, + "endOffset": 33, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...Guide for Linux Instances\n\n Amazon EC2 and Amazon EBS information in CloudTrailUnderstanding Amazon EC2 and Amazon EBS log file\n entriesAuditing users that connect via EC2 Instance Connect...", + "highlights": [ + { + "beginOffset": 79, + "endOffset": 82, + "topAnswer": false, + "type": "STANDARD" + }, + { + "beginOffset": 144, + "endOffset": 147, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/monitor-with-cloudtrail.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/monitor-with-cloudtrail.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-5" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-12f33f89-751e-49be-a5ed-d356fcdbcb69", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/monitor-with-cloudtrail.html", + "documentTitle": { + "text": "Logging Amazon EC2 and Amazon EBS API calls with\n AWS CloudTrail - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 30, + "endOffset": 33, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...Guide for Windows Instances\n\n Amazon EC2 and Amazon EBS information in CloudTrailUnderstanding Amazon EC2 and Amazon EBS log file\n entriesAuditing users that connect via EC2 Instance Connect...", + "highlights": [ + { + "beginOffset": 81, + "endOffset": 84, + "topAnswer": false, + "type": "STANDARD" + }, + { + "beginOffset": 146, + "endOffset": 149, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/monitor-with-cloudtrail.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/WindowsGuide/monitor-with-cloudtrail.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-6" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-a19f3b7e-56d8-4a65-b03a-799a38ef11e7", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/APIReference/API_EbsBlockDevice.html", + "documentTitle": { + "text": "EbsBlockDevice - Amazon Elastic Compute Cloud", + "highlights": [] + }, + "documentExcerpt": { + "text": "...For more\n information, see Preserving Amazon EBS volumes on instance termination in the\n Amazon Elastic Compute Cloud User Guide...", + "highlights": [ + { + "beginOffset": 92, + "endOffset": 95, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/APIReference/API_EbsBlockDevice.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/APIReference/API_EbsBlockDevice.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-7" + }, + { + "id": "abcdefgh-1234-1234-1234-ijklmnopqrst-193710fb-5552-4f8e-8215-7c9cb14ac1ff", + "type": "DOCUMENT", + "additionalAttributes": [], + "documentId": "s3://amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html", + "documentTitle": { + "text": "Amazon CloudWatch Events for Amazon EBS - Amazon Elastic Compute Cloud", + "highlights": [ + { + "beginOffset": 36, + "endOffset": 39, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentExcerpt": { + "text": "...Contents\n\n \tEBS volume events\n\tEBS snapshot events\n\tEBS volume modification events\n\tEBS fast snapshot restore events\n\tUsing AWS Lambda to handle CloudWatch events...", + "highlights": [ + { + "beginOffset": 50, + "endOffset": 53, + "topAnswer": false, + "type": "STANDARD" + }, + { + "beginOffset": 69, + "endOffset": 72, + "topAnswer": false, + "type": "STANDARD" + }, + { + "beginOffset": 90, + "endOffset": 93, + "topAnswer": false, + "type": "STANDARD" + }, + { + "beginOffset": 122, + "endOffset": 125, + "topAnswer": false, + "type": "STANDARD" + } + ] + }, + "documentURI": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html", + "documentAttributes": [ + { + "key": "_source_uri", + "value": { + "stringValue": "https://s3.us-east-1.amazonaws.com/amazon-kendra-sample-docs-us-east-1/documents/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html" + } + } + ], + "scoreAttributes": { + "scoreConfidence": "HIGH" + }, + "feedbackToken": "Example-Feedback-Token-1" + } + ], + "facetResults": [], + "totalNumberOfResults": 369 + }, + "name": "KendraSearchIntent", + "state": "ReadyForFulfillment" + }, + "originatingRequestId": "00000000-1111-2222-3333-444444444444" + }, + "transcriptions": [ + { + "transcription": "What is EBS?", + "resolvedSlots": {}, + "transcriptionConfidence": 1, + "resolvedContext": { + "intent": "FallbackIntent" + } + } + ], + "inputMode": "Text", + "bot": { + "aliasName": "TestBotAlias", + "aliasId": "TSTALIASID", + "name": "BookTrip", + "version": "DRAFT", + "localeId": "en_US", + "id": "ABCDE01235" + } +} \ No newline at end of file diff --git a/aws-lambda-java-events/src/test/resources/event_models/lex_v2_response.json b/aws-lambda-java-events/src/test/resources/event_models/lex_v2_response.json new file mode 100644 index 00000000..c41a4161 --- /dev/null +++ b/aws-lambda-java-events/src/test/resources/event_models/lex_v2_response.json @@ -0,0 +1,62 @@ +{ + "sessionState": { + "sessionAttributes": {}, + "dialogAction": { + "type": "Close" + }, + "intent": { + "slots": { + "RoomType": { + "shape": "Scalar", + "value": { + "originalValue": "deluxe", + "resolvedValues": [ + "deluxe" + ], + "interpretedValue": "deluxe" + } + }, + "CheckInDate": { + "shape": "Scalar", + "value": { + "originalValue": "fifth of may", + "resolvedValues": [ + "2022-05-05" + ], + "interpretedValue": "2022-05-05" + } + }, + "Nights": { + "shape": "Scalar", + "value": { + "originalValue": "fourteen", + "resolvedValues": [ + "14" + ], + "interpretedValue": "14" + } + }, + "Location": { + "shape": "Scalar", + "value": { + "originalValue": "seattle", + "resolvedValues": [ + "seattle" + ], + "interpretedValue": "seattle" + } + } + }, + "confirmationState": "None", + "name": "BookHotel", + "state": "Fulfilled" + } + }, + "messages": [ + { + "contentType": "PlainText", + "content": "Thank you." + } + ], + "requestAttributes": {} +} \ No newline at end of file