Skip to content

Commit 68ac327

Browse files
committed
Fixed the type of LexV2Interpretation.NluConfidence to double in Amazon.Lambda.LexV2Events package.
1 parent 0938b0a commit 68ac327

File tree

4 files changed

+7
-21
lines changed

4 files changed

+7
-21
lines changed

Libraries/src/Amazon.Lambda.LexV2Events/Amazon.Lambda.LexV2Events.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Description>Amazon Lambda .NET Core support - Amazon Lex V2 package.</Description>
77
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
88
<AssemblyTitle>Amazon.Lambda.LexV2Events</AssemblyTitle>
9-
<VersionPrefix>1.0.0</VersionPrefix>
9+
<VersionPrefix>1.0.1</VersionPrefix>
1010
<AssemblyName>Amazon.Lambda.LexV2Events</AssemblyName>
1111
<PackageId>Amazon.Lambda.LexV2Events</PackageId>
1212
<PackageTags>AWS;Amazon;Lambda;Lex;LexV2</PackageTags>

Libraries/src/Amazon.Lambda.LexV2Events/LexV2Interpretation.cs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ public class LexV2Interpretation
1212
public LexV2Intent Intent { get; set; }
1313

1414
/// <summary>
15-
/// Determines the threshold where Amazon Lex V2 will insert the <c>AMAZON.FallbackIntent</c>, <c>AMAZON.KendraSearchIntent</c>, or both when returning
16-
/// alternative intents in a response. <c>AMAZON.FallbackIntent</c> and <c>AMAZON.KendraSearchIntent</c> are only inserted if they are configured for the bot.
15+
/// Represents a score that indicates the confidence that Amazon Lex V2 has that an intent is the one that satisfies the user's intent. Determines the threshold
16+
/// where Amazon Lex V2 will insert the <c>AMAZON.FallbackIntent</c>, <c>AMAZON.KendraSearchIntent</c>, or both when returning alternative intents in a response.
17+
/// <c>AMAZON.FallbackIntent</c> and <c>AMAZON.KendraSearchIntent</c> are only inserted if they are configured for the bot.
1718
/// </summary>
18-
public LexV2ConfidenceScore NluConfidence { get; set; }
19+
public double? NluConfidence { get; set; }
1920

2021
/// <summary>
2122
/// The sentiment expressed in an utterance.
@@ -24,19 +25,6 @@ public class LexV2Interpretation
2425
public LexV2SentimentResponse SentimentResponse { get; set; }
2526
}
2627

27-
/// <summary>
28-
/// The class that represents a score that indicates the confidence that Amazon Lex V2 has that an intent is the one that satisfies the user's intent.
29-
/// https://docs.aws.amazon.com/lexv2/latest/dg/API_runtime_ConfidenceScore.html
30-
/// </summary>
31-
public class LexV2ConfidenceScore
32-
{
33-
/// <summary>
34-
/// A score that indicates how confident Amazon Lex V2 is that an intent satisfies the user's intent.
35-
/// Ranges between 0.00 and 1.00. Higher scores indicate higher confidence.
36-
/// </summary>
37-
public double? Score { get; set; }
38-
}
39-
4028
/// <summary>
4129
/// Provides information about the sentiment expressed in a user's response in a conversation. Sentiments are determined using Amazon Comprehend.
4230
/// Sentiments are only returned if they are enabled for the bot.

Libraries/test/EventsTests.Shared/EventTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@ public void LexV2Event(Type serializerType)
13701370
Assert.Null(lexV2Event.Interpretations[0].Intent.Slots["ActionTime"]);
13711371
Assert.Equal("InProgress", lexV2Event.Interpretations[0].Intent.State);
13721372
Assert.Equal("None", lexV2Event.Interpretations[0].Intent.ConfirmationState);
1373-
Assert.Equal(1.0, lexV2Event.Interpretations[0].NluConfidence.Score);
1373+
Assert.Equal(0.79, lexV2Event.Interpretations[0].NluConfidence);
13741374
Assert.Equal("testsentiment", lexV2Event.Interpretations[0].SentimentResponse.Sentiment);
13751375
Assert.Equal(0.1, lexV2Event.Interpretations[0].SentimentResponse.SentimentScore.Mixed);
13761376
Assert.Equal(0.1, lexV2Event.Interpretations[0].SentimentResponse.SentimentScore.Negative);

Libraries/test/EventsTests.Shared/lexv2-event.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@
4545
"state": "InProgress",
4646
"confirmationState": "None"
4747
},
48-
"nluConfidence": {
49-
"score": 1.0
50-
},
48+
"nluConfidence": 0.79,
5149
"sentimentResponse": {
5250
"sentiment": "testsentiment",
5351
"sentimentScore": {

0 commit comments

Comments
 (0)