From 728947e285ac42781604e396ef3264ee8d1ef496 Mon Sep 17 00:00:00 2001 From: Martin Battaglino Date: Tue, 25 May 2021 19:02:16 -0300 Subject: [PATCH 1/6] Remove testData to be renamed --- .../ai/qna/testData/QnaMaker_IsTest_True.json | 13 ---- .../QnaMaker_LegacyEndpointAnswer.json | 13 ---- .../QnaMaker_RankerType_QuestionOnly.json | 35 ---------- ...QnaMaker_ReturnAnswer_MultiTurnLevel1.json | 19 ------ .../QnaMaker_ReturnAnswer_withPrompts.json | 38 ----------- .../qna/testData/QnaMaker_ReturnsAnswer.json | 26 -------- .../QnaMaker_ReturnsAnswerWithContext.json | 18 ----- .../QnaMaker_ReturnsAnswerWithIntent.json | 26 -------- .../QnaMaker_ReturnsAnswerWithoutContext.json | 32 --------- ...Answer_GivenScoreThresholdQueryOption.json | 19 ------ ...r_ReturnsAnswer_WhenNoAnswerFoundInKb.json | 13 ---- ...Maker_ReturnsAnswersWithMetadataBoost.json | 19 ------ .../testData/QnaMaker_ReturnsNoAnswer.json | 4 -- .../qna/testData/QnaMaker_TestThreshold.json | 3 - .../ai/qna/testData/QnaMaker_TopNAnswer.json | 65 ------------------- ...aker_TopNAnswer_DisableActiveLearning.json | 65 ------------------- ...aker_UsesStrictFilters_ToReturnAnswer.json | 19 ------ .../qnamaker.settings.development.westus.json | 6 -- 18 files changed, 433 deletions(-) delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_IsTest_True.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_LegacyEndpointAnswer.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_RankerType_QuestionOnly.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnAnswer_MultiTurnLevel1.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnAnswer_withPrompts.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswer.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswerWithContext.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswerWithIntent.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswerWithoutContext.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswer_GivenScoreThresholdQueryOption.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswer_WhenNoAnswerFoundInKb.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswersWithMetadataBoost.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsNoAnswer.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_TestThreshold.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_TopNAnswer.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_TopNAnswer_DisableActiveLearning.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_UsesStrictFilters_ToReturnAnswer.json delete mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/qnamaker.settings.development.westus.json diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_IsTest_True.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_IsTest_True.json deleted file mode 100644 index 263f6a1e5..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_IsTest_True.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "activeLearningEnabled": true, - "answers": [ - { - "questions": [], - "answer": "No good match found in KB.", - "score": 0, - "id": -1, - "source": null, - "metadata": [] - } - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_LegacyEndpointAnswer.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_LegacyEndpointAnswer.json deleted file mode 100644 index 158877934..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_LegacyEndpointAnswer.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "answers": [ - { - "score": 30.500827898, - "qnaId": 18, - "answer": "To be the very best, you gotta catch 'em all", - "source": "Custom Editorial", - "questions": [ - "How do I be the best?" - ] - } - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_RankerType_QuestionOnly.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_RankerType_QuestionOnly.json deleted file mode 100644 index ff2b0f788..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_RankerType_QuestionOnly.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "activeLearningEnabled": false, - "answers": [ - { - "questions": [ - "Q1" - ], - "answer": "A1", - "score": 80, - "id": 15, - "source": "Editorial", - "metadata": [ - { - "name": "topic", - "value": "value" - } - ] - }, - { - "questions": [ - "Q2" - ], - "answer": "A2", - "score": 78, - "id": 16, - "source": "Editorial", - "metadata": [ - { - "name": "topic", - "value": "value" - } - ] - } - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnAnswer_MultiTurnLevel1.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnAnswer_MultiTurnLevel1.json deleted file mode 100644 index 48f461826..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnAnswer_MultiTurnLevel1.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "answers": [ - { - "questions": [ - "I accidentally deleted a part of my QnA Maker, what should I do?" - ], - "answer": "All deletes are permanent, including question and answer pairs, files, URLs, custom questions and answers, knowledge bases, or Azure resources. Make sure you export your knowledge base from the Settings**page before deleting any part of your knowledge base.", - "score": 89.99, - "id": 1, - "source": "https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/troubleshooting", - "metadata": [], - "context": { - "isContextOnly": false, - "prompts": [] - } - } - ], - "activeLearningEnabled": false -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnAnswer_withPrompts.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnAnswer_withPrompts.json deleted file mode 100644 index 67f5ce464..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnAnswer_withPrompts.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "activeLearningEnabled": true, - "answers": [ - { - "questions": [ - "Issues related to KB" - ], - "answer": "Please select one of the following KB issues. ", - "score": 98.0, - "id": 27, - "source": "Editorial", - "metadata": [], - "context": { - "isContextOnly": false, - "prompts": [ - { - "displayOrder": 0, - "qnaId": 1, - "qna": null, - "displayText": "Accidently deleted KB" - }, - { - "displayOrder": 0, - "qnaId": 3, - "qna": null, - "displayText": "KB Size Limits" - }, - { - "displayOrder": 0, - "qnaId": 29, - "qna": null, - "displayText": "Other Issues" - } - ] - } - } - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswer.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswer.json deleted file mode 100644 index a5fdc06b5..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "activeLearningEnabled": true, - "answers": [ - { - "questions": [ - "how do I clean the stove?" - ], - "answer": "BaseCamp: You can use a damp rag to clean around the Power Pack", - "score": 100, - "id": 5, - "source": "Editorial", - "metadata": [], - "context": { - "isContextOnly": true, - "prompts": [ - { - "displayOrder": 0, - "qnaId": 55, - "qna": null, - "displayText": "Where can I buy?" - } - ] - } - } - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswerWithContext.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswerWithContext.json deleted file mode 100644 index a1c6989ae..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswerWithContext.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "answers": [ - { - "questions": [ - "Where can I buy cleaning products?" - ], - "answer": "Any DIY store", - "score": 100, - "id": 55, - "source": "Editorial", - "metadata": [], - "context": { - "isContextOnly": true, - "prompts": [] - } - } - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswerWithIntent.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswerWithIntent.json deleted file mode 100644 index 53d56dc04..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswerWithIntent.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "activeLearningEnabled": true, - "answers": [ - { - "questions": [ - "how do I clean the stove?" - ], - "answer": "intent=DeferToRecognizer_xxx", - "score": 100, - "id": 5, - "source": "Editorial", - "metadata": [], - "context": { - "isContextOnly": true, - "prompts": [ - { - "displayOrder": 0, - "qnaId": 55, - "qna": null, - "displayText": "Where can I buy?" - } - ] - } - } - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswerWithoutContext.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswerWithoutContext.json deleted file mode 100644 index b5cf68875..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswerWithoutContext.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "answers": [ - { - "questions": [ - "Where can I buy home appliances?" - ], - "answer": "Any Walmart store", - "score": 68, - "id": 56, - "source": "Editorial", - "metadata": [], - "context": { - "isContextOnly": false, - "prompts": [] - } - }, - { - "questions": [ - "Where can I buy cleaning products?" - ], - "answer": "Any DIY store", - "score": 56, - "id": 55, - "source": "Editorial", - "metadata": [], - "context": { - "isContextOnly": false, - "prompts": [] - } - } - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswer_GivenScoreThresholdQueryOption.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswer_GivenScoreThresholdQueryOption.json deleted file mode 100644 index 2d9c67652..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswer_GivenScoreThresholdQueryOption.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "answers": [ - { - "score": 68.54820341616869, - "Id": 22, - "answer": "Why do you ask?", - "source": "Custom Editorial", - "questions": [ - "what happens when you hug a procupine?" - ], - "metadata": [ - { - "name": "animal", - "value": "procupine" - } - ] - } - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswer_WhenNoAnswerFoundInKb.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswer_WhenNoAnswerFoundInKb.json deleted file mode 100644 index 05e1d3907..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswer_WhenNoAnswerFoundInKb.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "answers": [ - { - "questions": [], - "answer": "No good match found in KB.", - "score": 0, - "id": -1, - "source": null, - "metadata": [] - } - ], - "debugInfo": null -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswersWithMetadataBoost.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswersWithMetadataBoost.json deleted file mode 100644 index 280467e7b..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsAnswersWithMetadataBoost.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "answers": [ - { - "questions": [ - "Who loves me?" - ], - "answer": "Kiki", - "score": 100, - "id": 29, - "source": "Editorial", - "metadata": [ - { - "name": "artist", - "value": "drake" - } - ] - } - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsNoAnswer.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsNoAnswer.json deleted file mode 100644 index 9888a8555..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_ReturnsNoAnswer.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "answers": [ - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_TestThreshold.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_TestThreshold.json deleted file mode 100644 index c8973d9e8..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_TestThreshold.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "answers": [ ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_TopNAnswer.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_TopNAnswer.json deleted file mode 100644 index 17f598471..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_TopNAnswer.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "activeLearningEnabled": true, - "answers": [ - { - "questions": [ - "Q1" - ], - "answer": "A1", - "score": 80, - "id": 15, - "source": "Editorial", - "metadata": [ - { - "name": "topic", - "value": "value" - } - ] - }, - { - "questions": [ - "Q2" - ], - "answer": "A2", - "score": 78, - "id": 16, - "source": "Editorial", - "metadata": [ - { - "name": "topic", - "value": "value" - } - ] - }, - { - "questions": [ - "Q3" - ], - "answer": "A3", - "score": 75, - "id": 17, - "source": "Editorial", - "metadata": [ - { - "name": "topic", - "value": "value" - } - ] - }, - { - "questions": [ - "Q4" - ], - "answer": "A4", - "score": 50, - "id": 18, - "source": "Editorial", - "metadata": [ - { - "name": "topic", - "value": "value" - } - ] - } - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_TopNAnswer_DisableActiveLearning.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_TopNAnswer_DisableActiveLearning.json deleted file mode 100644 index e3f714416..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_TopNAnswer_DisableActiveLearning.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "activeLearningEnabled": false, - "answers": [ - { - "questions": [ - "Q1" - ], - "answer": "A1", - "score": 80, - "id": 15, - "source": "Editorial", - "metadata": [ - { - "name": "topic", - "value": "value" - } - ] - }, - { - "questions": [ - "Q2" - ], - "answer": "A2", - "score": 78, - "id": 16, - "source": "Editorial", - "metadata": [ - { - "name": "topic", - "value": "value" - } - ] - }, - { - "questions": [ - "Q3" - ], - "answer": "A3", - "score": 75, - "id": 17, - "source": "Editorial", - "metadata": [ - { - "name": "topic", - "value": "value" - } - ] - }, - { - "questions": [ - "Q4" - ], - "answer": "A4", - "score": 50, - "id": 18, - "source": "Editorial", - "metadata": [ - { - "name": "topic", - "value": "value" - } - ] - } - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_UsesStrictFilters_ToReturnAnswer.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_UsesStrictFilters_ToReturnAnswer.json deleted file mode 100644 index 2dbb1d051..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/QnaMaker_UsesStrictFilters_ToReturnAnswer.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "answers": [ - { - "questions": [ - "how do I clean the stove?" - ], - "answer": "BaseCamp: You can use a damp rag to clean around the Power Pack", - "score": 100, - "id": 5, - "source": "Editorial", - "metadata": [ - { - "name": "topic", - "value": "value" - } - ] - } - ] -} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/qnamaker.settings.development.westus.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/qnamaker.settings.development.westus.json deleted file mode 100644 index b1071df7e..000000000 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testData/qnamaker.settings.development.westus.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "qna": { - "sandwichQnA_en_us_qna": "", - "hostname": "" - } -} From 712f5695c4b2c9ad638d88aacb87d7c7800f78e7 Mon Sep 17 00:00:00 2001 From: Martin Battaglino Date: Tue, 25 May 2021 19:03:40 -0300 Subject: [PATCH 2/6] Rename testData to testdata in order to be consistent with other Java libraries --- .../bot/ai/qna/QnAMakerRecognizerTests.java | 2 +- .../ai/qna/testdata/QnaMaker_IsTest_True.json | 13 ++++ .../QnaMaker_LegacyEndpointAnswer.json | 13 ++++ .../QnaMaker_RankerType_QuestionOnly.json | 35 ++++++++++ ...QnaMaker_ReturnAnswer_MultiTurnLevel1.json | 19 ++++++ .../QnaMaker_ReturnAnswer_withPrompts.json | 38 +++++++++++ .../qna/testdata/QnaMaker_ReturnsAnswer.json | 26 ++++++++ .../QnaMaker_ReturnsAnswerWithContext.json | 18 +++++ .../QnaMaker_ReturnsAnswerWithIntent.json | 26 ++++++++ .../QnaMaker_ReturnsAnswerWithoutContext.json | 32 +++++++++ ...Answer_GivenScoreThresholdQueryOption.json | 19 ++++++ ...r_ReturnsAnswer_WhenNoAnswerFoundInKb.json | 13 ++++ ...Maker_ReturnsAnswersWithMetadataBoost.json | 19 ++++++ .../testdata/QnaMaker_ReturnsNoAnswer.json | 4 ++ .../qna/testdata/QnaMaker_TestThreshold.json | 3 + .../ai/qna/testdata/QnaMaker_TopNAnswer.json | 65 +++++++++++++++++++ ...aker_TopNAnswer_DisableActiveLearning.json | 65 +++++++++++++++++++ ...aker_UsesStrictFilters_ToReturnAnswer.json | 19 ++++++ .../qnamaker.settings.development.westus.json | 6 ++ 19 files changed, 434 insertions(+), 1 deletion(-) create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_IsTest_True.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_LegacyEndpointAnswer.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_RankerType_QuestionOnly.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnAnswer_MultiTurnLevel1.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnAnswer_withPrompts.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswer.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswerWithContext.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswerWithIntent.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswerWithoutContext.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswer_GivenScoreThresholdQueryOption.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswer_WhenNoAnswerFoundInKb.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswersWithMetadataBoost.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsNoAnswer.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_TestThreshold.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_TopNAnswer.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_TopNAnswer_DisableActiveLearning.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_UsesStrictFilters_ToReturnAnswer.json create mode 100644 libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/qnamaker.settings.development.westus.json diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/QnAMakerRecognizerTests.java b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/QnAMakerRecognizerTests.java index 3adb6ef60..f8e0526ea 100644 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/QnAMakerRecognizerTests.java +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/QnAMakerRecognizerTests.java @@ -219,7 +219,7 @@ public void returnAnswersWithIntents() { private String readFileContent (String fileName) throws IOException { String path = Paths.get("", "src", "test", "java", "com", "microsoft", "bot", "ai", "qna", - "testData", fileName).toAbsolutePath().toString(); + "testdata", fileName).toAbsolutePath().toString(); File file = new File(path); return FileUtils.readFileToString(file, "utf-8"); } diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_IsTest_True.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_IsTest_True.json new file mode 100644 index 000000000..263f6a1e5 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_IsTest_True.json @@ -0,0 +1,13 @@ +{ + "activeLearningEnabled": true, + "answers": [ + { + "questions": [], + "answer": "No good match found in KB.", + "score": 0, + "id": -1, + "source": null, + "metadata": [] + } + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_LegacyEndpointAnswer.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_LegacyEndpointAnswer.json new file mode 100644 index 000000000..158877934 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_LegacyEndpointAnswer.json @@ -0,0 +1,13 @@ +{ + "answers": [ + { + "score": 30.500827898, + "qnaId": 18, + "answer": "To be the very best, you gotta catch 'em all", + "source": "Custom Editorial", + "questions": [ + "How do I be the best?" + ] + } + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_RankerType_QuestionOnly.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_RankerType_QuestionOnly.json new file mode 100644 index 000000000..ff2b0f788 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_RankerType_QuestionOnly.json @@ -0,0 +1,35 @@ +{ + "activeLearningEnabled": false, + "answers": [ + { + "questions": [ + "Q1" + ], + "answer": "A1", + "score": 80, + "id": 15, + "source": "Editorial", + "metadata": [ + { + "name": "topic", + "value": "value" + } + ] + }, + { + "questions": [ + "Q2" + ], + "answer": "A2", + "score": 78, + "id": 16, + "source": "Editorial", + "metadata": [ + { + "name": "topic", + "value": "value" + } + ] + } + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnAnswer_MultiTurnLevel1.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnAnswer_MultiTurnLevel1.json new file mode 100644 index 000000000..48f461826 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnAnswer_MultiTurnLevel1.json @@ -0,0 +1,19 @@ +{ + "answers": [ + { + "questions": [ + "I accidentally deleted a part of my QnA Maker, what should I do?" + ], + "answer": "All deletes are permanent, including question and answer pairs, files, URLs, custom questions and answers, knowledge bases, or Azure resources. Make sure you export your knowledge base from the Settings**page before deleting any part of your knowledge base.", + "score": 89.99, + "id": 1, + "source": "https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/troubleshooting", + "metadata": [], + "context": { + "isContextOnly": false, + "prompts": [] + } + } + ], + "activeLearningEnabled": false +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnAnswer_withPrompts.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnAnswer_withPrompts.json new file mode 100644 index 000000000..67f5ce464 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnAnswer_withPrompts.json @@ -0,0 +1,38 @@ +{ + "activeLearningEnabled": true, + "answers": [ + { + "questions": [ + "Issues related to KB" + ], + "answer": "Please select one of the following KB issues. ", + "score": 98.0, + "id": 27, + "source": "Editorial", + "metadata": [], + "context": { + "isContextOnly": false, + "prompts": [ + { + "displayOrder": 0, + "qnaId": 1, + "qna": null, + "displayText": "Accidently deleted KB" + }, + { + "displayOrder": 0, + "qnaId": 3, + "qna": null, + "displayText": "KB Size Limits" + }, + { + "displayOrder": 0, + "qnaId": 29, + "qna": null, + "displayText": "Other Issues" + } + ] + } + } + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswer.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswer.json new file mode 100644 index 000000000..a5fdc06b5 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswer.json @@ -0,0 +1,26 @@ +{ + "activeLearningEnabled": true, + "answers": [ + { + "questions": [ + "how do I clean the stove?" + ], + "answer": "BaseCamp: You can use a damp rag to clean around the Power Pack", + "score": 100, + "id": 5, + "source": "Editorial", + "metadata": [], + "context": { + "isContextOnly": true, + "prompts": [ + { + "displayOrder": 0, + "qnaId": 55, + "qna": null, + "displayText": "Where can I buy?" + } + ] + } + } + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswerWithContext.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswerWithContext.json new file mode 100644 index 000000000..a1c6989ae --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswerWithContext.json @@ -0,0 +1,18 @@ +{ + "answers": [ + { + "questions": [ + "Where can I buy cleaning products?" + ], + "answer": "Any DIY store", + "score": 100, + "id": 55, + "source": "Editorial", + "metadata": [], + "context": { + "isContextOnly": true, + "prompts": [] + } + } + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswerWithIntent.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswerWithIntent.json new file mode 100644 index 000000000..53d56dc04 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswerWithIntent.json @@ -0,0 +1,26 @@ +{ + "activeLearningEnabled": true, + "answers": [ + { + "questions": [ + "how do I clean the stove?" + ], + "answer": "intent=DeferToRecognizer_xxx", + "score": 100, + "id": 5, + "source": "Editorial", + "metadata": [], + "context": { + "isContextOnly": true, + "prompts": [ + { + "displayOrder": 0, + "qnaId": 55, + "qna": null, + "displayText": "Where can I buy?" + } + ] + } + } + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswerWithoutContext.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswerWithoutContext.json new file mode 100644 index 000000000..b5cf68875 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswerWithoutContext.json @@ -0,0 +1,32 @@ +{ + "answers": [ + { + "questions": [ + "Where can I buy home appliances?" + ], + "answer": "Any Walmart store", + "score": 68, + "id": 56, + "source": "Editorial", + "metadata": [], + "context": { + "isContextOnly": false, + "prompts": [] + } + }, + { + "questions": [ + "Where can I buy cleaning products?" + ], + "answer": "Any DIY store", + "score": 56, + "id": 55, + "source": "Editorial", + "metadata": [], + "context": { + "isContextOnly": false, + "prompts": [] + } + } + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswer_GivenScoreThresholdQueryOption.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswer_GivenScoreThresholdQueryOption.json new file mode 100644 index 000000000..2d9c67652 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswer_GivenScoreThresholdQueryOption.json @@ -0,0 +1,19 @@ +{ + "answers": [ + { + "score": 68.54820341616869, + "Id": 22, + "answer": "Why do you ask?", + "source": "Custom Editorial", + "questions": [ + "what happens when you hug a procupine?" + ], + "metadata": [ + { + "name": "animal", + "value": "procupine" + } + ] + } + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswer_WhenNoAnswerFoundInKb.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswer_WhenNoAnswerFoundInKb.json new file mode 100644 index 000000000..05e1d3907 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswer_WhenNoAnswerFoundInKb.json @@ -0,0 +1,13 @@ +{ + "answers": [ + { + "questions": [], + "answer": "No good match found in KB.", + "score": 0, + "id": -1, + "source": null, + "metadata": [] + } + ], + "debugInfo": null +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswersWithMetadataBoost.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswersWithMetadataBoost.json new file mode 100644 index 000000000..280467e7b --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsAnswersWithMetadataBoost.json @@ -0,0 +1,19 @@ +{ + "answers": [ + { + "questions": [ + "Who loves me?" + ], + "answer": "Kiki", + "score": 100, + "id": 29, + "source": "Editorial", + "metadata": [ + { + "name": "artist", + "value": "drake" + } + ] + } + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsNoAnswer.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsNoAnswer.json new file mode 100644 index 000000000..9888a8555 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_ReturnsNoAnswer.json @@ -0,0 +1,4 @@ +{ + "answers": [ + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_TestThreshold.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_TestThreshold.json new file mode 100644 index 000000000..c8973d9e8 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_TestThreshold.json @@ -0,0 +1,3 @@ +{ + "answers": [ ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_TopNAnswer.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_TopNAnswer.json new file mode 100644 index 000000000..17f598471 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_TopNAnswer.json @@ -0,0 +1,65 @@ +{ + "activeLearningEnabled": true, + "answers": [ + { + "questions": [ + "Q1" + ], + "answer": "A1", + "score": 80, + "id": 15, + "source": "Editorial", + "metadata": [ + { + "name": "topic", + "value": "value" + } + ] + }, + { + "questions": [ + "Q2" + ], + "answer": "A2", + "score": 78, + "id": 16, + "source": "Editorial", + "metadata": [ + { + "name": "topic", + "value": "value" + } + ] + }, + { + "questions": [ + "Q3" + ], + "answer": "A3", + "score": 75, + "id": 17, + "source": "Editorial", + "metadata": [ + { + "name": "topic", + "value": "value" + } + ] + }, + { + "questions": [ + "Q4" + ], + "answer": "A4", + "score": 50, + "id": 18, + "source": "Editorial", + "metadata": [ + { + "name": "topic", + "value": "value" + } + ] + } + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_TopNAnswer_DisableActiveLearning.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_TopNAnswer_DisableActiveLearning.json new file mode 100644 index 000000000..e3f714416 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_TopNAnswer_DisableActiveLearning.json @@ -0,0 +1,65 @@ +{ + "activeLearningEnabled": false, + "answers": [ + { + "questions": [ + "Q1" + ], + "answer": "A1", + "score": 80, + "id": 15, + "source": "Editorial", + "metadata": [ + { + "name": "topic", + "value": "value" + } + ] + }, + { + "questions": [ + "Q2" + ], + "answer": "A2", + "score": 78, + "id": 16, + "source": "Editorial", + "metadata": [ + { + "name": "topic", + "value": "value" + } + ] + }, + { + "questions": [ + "Q3" + ], + "answer": "A3", + "score": 75, + "id": 17, + "source": "Editorial", + "metadata": [ + { + "name": "topic", + "value": "value" + } + ] + }, + { + "questions": [ + "Q4" + ], + "answer": "A4", + "score": 50, + "id": 18, + "source": "Editorial", + "metadata": [ + { + "name": "topic", + "value": "value" + } + ] + } + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_UsesStrictFilters_ToReturnAnswer.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_UsesStrictFilters_ToReturnAnswer.json new file mode 100644 index 000000000..2dbb1d051 --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/QnaMaker_UsesStrictFilters_ToReturnAnswer.json @@ -0,0 +1,19 @@ +{ + "answers": [ + { + "questions": [ + "how do I clean the stove?" + ], + "answer": "BaseCamp: You can use a damp rag to clean around the Power Pack", + "score": 100, + "id": 5, + "source": "Editorial", + "metadata": [ + { + "name": "topic", + "value": "value" + } + ] + } + ] +} diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/qnamaker.settings.development.westus.json b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/qnamaker.settings.development.westus.json new file mode 100644 index 000000000..b1071df7e --- /dev/null +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/testdata/qnamaker.settings.development.westus.json @@ -0,0 +1,6 @@ +{ + "qna": { + "sandwichQnA_en_us_qna": "", + "hostname": "" + } +} From 5f77283193ccd733051931d8c0e89dcf17107bcb Mon Sep 17 00:00:00 2001 From: Martin Battaglino Date: Tue, 25 May 2021 19:04:18 -0300 Subject: [PATCH 3/6] Fix typo in javadoc --- .../java/com/microsoft/bot/ai/qna/models/FeedbackRecord.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/models/FeedbackRecord.java b/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/models/FeedbackRecord.java index c58ef5f0e..f96c87729 100644 --- a/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/models/FeedbackRecord.java +++ b/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/models/FeedbackRecord.java @@ -19,7 +19,7 @@ public class FeedbackRecord { private Integer qnaId; /** - * Gets the feedback recod's user ID. + * Gets the feedback record's user ID. * * @return The user ID. */ @@ -28,7 +28,7 @@ public String getUserId() { } /** - * Sets the feedback recod's user ID. + * Sets the feedback record's user ID. * * @param withUserId The user ID. */ From 05589cb3bb179c0199e30f5560414578f06f9548 Mon Sep 17 00:00:00 2001 From: Martin Battaglino Date: Tue, 25 May 2021 19:04:29 -0300 Subject: [PATCH 4/6] Consistency of StringUtils --- .../src/main/java/com/microsoft/bot/ai/qna/QnAMaker.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/QnAMaker.java b/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/QnAMaker.java index 821cf0196..91a233d4e 100644 --- a/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/QnAMaker.java +++ b/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/QnAMaker.java @@ -33,7 +33,6 @@ import java.util.concurrent.CompletableFuture; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.google.common.base.Strings; import org.apache.commons.lang3.StringUtils; import org.slf4j.LoggerFactory; @@ -91,15 +90,15 @@ public QnAMaker( } this.endpoint = withEndpoint; - if (Strings.isNullOrEmpty(this.endpoint.getKnowledgeBaseId())) { + if (StringUtils.isBlank(this.endpoint.getKnowledgeBaseId())) { throw new IllegalArgumentException("knowledgeBaseId"); } - if (Strings.isNullOrEmpty(this.endpoint.getHost())) { + if (StringUtils.isBlank(this.endpoint.getHost())) { throw new IllegalArgumentException("host"); } - if (Strings.isNullOrEmpty(this.endpoint.getEndpointKey())) { + if (StringUtils.isBlank(this.endpoint.getEndpointKey())) { throw new IllegalArgumentException("endpointKey"); } @@ -222,7 +221,7 @@ public CompletableFuture getAnswersRaw( return Async.completeExceptionally(new IllegalArgumentException("Activity type is not a message")); } - if (Strings.isNullOrEmpty(turnContext.getActivity().getText())) { + if (StringUtils.isBlank(turnContext.getActivity().getText())) { return Async.completeExceptionally(new IllegalArgumentException("Null or empty text")); } From 298c8902814df6f68df9b3c1631c13db3b892e2d Mon Sep 17 00:00:00 2001 From: Martin Battaglino Date: Tue, 25 May 2021 19:04:44 -0300 Subject: [PATCH 5/6] Make props as final --- .../java/com/microsoft/bot/ai/qna/utils/BindToActivity.java | 6 +++--- .../com/microsoft/bot/ai/qna/utils/HttpRequestUtils.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/utils/BindToActivity.java b/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/utils/BindToActivity.java index 0262ba9bf..d365cbc34 100644 --- a/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/utils/BindToActivity.java +++ b/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/utils/BindToActivity.java @@ -14,11 +14,11 @@ * Class to bind activities. */ public class BindToActivity { - private Activity activity; + private final Activity activity; /** * Construct to bind an Activity. - * + * * @param withActivity activity to bind. */ public BindToActivity(Activity withActivity) { @@ -37,7 +37,7 @@ public CompletableFuture bind(DialogContext context, @Nullable Object /** * Get the activity text. - * + * * @return The activity text. */ public String toString() { diff --git a/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/utils/HttpRequestUtils.java b/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/utils/HttpRequestUtils.java index b76a6d8cd..3ffd9e8a9 100644 --- a/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/utils/HttpRequestUtils.java +++ b/libraries/bot-ai-qna/src/main/java/com/microsoft/bot/ai/qna/utils/HttpRequestUtils.java @@ -24,7 +24,7 @@ * Helper for HTTP requests. */ public class HttpRequestUtils { - private OkHttpClient httpClient = new OkHttpClient(); + private final OkHttpClient httpClient = new OkHttpClient(); /** * Execute Http request. From 78911c56d431153873e2a96de43b223636e4e96d Mon Sep 17 00:00:00 2001 From: Martin Battaglino Date: Tue, 25 May 2021 19:05:00 -0300 Subject: [PATCH 6/6] Update property from 0.4 to 0.42 --- .../src/test/java/com/microsoft/bot/ai/qna/QnAMakerTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/QnAMakerTests.java b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/QnAMakerTests.java index 46298f17f..1dbc9eb9f 100644 --- a/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/QnAMakerTests.java +++ b/libraries/bot-ai-qna/src/test/java/com/microsoft/bot/ai/qna/QnAMakerTests.java @@ -1109,7 +1109,7 @@ public void qnaMakerTestOptionsHydration() { QnAMakerOptions allChangedRequestOptions = new QnAMakerOptions(); allChangedRequestOptions.setTop(2000); - allChangedRequestOptions.setScoreThreshold(0.4f); + allChangedRequestOptions.setScoreThreshold(0.42f); allChangedRequestOptions.setStrictFilters(allChangedRequestOptionsFilters); QnAMaker qna = new QnAMaker(qnAMakerEndpoint, noFiltersOptions);