Skip to content

Commit

Permalink
Merge pull request #750 from aws-solutions/develop
Browse files Browse the repository at this point in the history
Feature/v6.0.2
  • Loading branch information
jangidms authored Jul 22, 2024
2 parents 7b37073 + f62435a commit 304d4a9
Show file tree
Hide file tree
Showing 94 changed files with 3,039 additions and 1,040 deletions.
8 changes: 8 additions & 0 deletions .nightswatch/functional/files/import-pass-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@
"Can I import multiple answers when I import with excel?",
"Can I import multiple answers when I import with excel using QnA Bot?"
]
},
{
"a": "今日は晴れです。",
"type": "qna",
"qid": "DoubleByteCharacters.001",
"q": [
"今日の天気を教えてください."
]
}
]
}
Binary file modified .nightswatch/functional/files/import-pass.xlsx
Binary file not shown.
6 changes: 5 additions & 1 deletion .nightswatch/functional/test_1_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,13 @@ def test_designer_logout(self, designer_login, dom_operator: DomOperator):
time.sleep(10)
menu.logout()
time.sleep(3)
title = dom_operator.get_title()
current_url = dom_operator.get_current_url()
element = dom_operator.select_css('span.textDescription-customizable')

title = dom_operator.get_title()
assert title == 'Signin'
assert 'login' in current_url
assert element.text == 'Sign in with your username and password'

def test_client_login(self, client_login, dom_operator: DomOperator):
"""
Expand Down
4 changes: 2 additions & 2 deletions .nightswatch/functional/test_kendra.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def test_kendra_fallback(self, designer_login, dom_operator: DomOperator, cw_cli
"""
Test that the Kendra fallback is used when no answer is found.
See: https://github.com/aws-solutions/aws-qnabot/blob/main/docs/Kendra_Fallback_README.md
See: https://github.com/aws-solutions/qnabot-on-aws/blob/main/source/docs/kendra_fallback/README.md
"""
menu = MenuNav(dom_operator)
kendra_page = menu.open_kendra_page()
Expand All @@ -193,7 +193,7 @@ def test_kendra_redirect(self, designer_login, loaded_questions: list[dict], dom
"""
Test the Kendra query contained in the qna is used instead of Kendra fallback when there is a question match.
See: https://github.com/aws-solutions/qnabot-on-aws/tree/main/docs/kendra_redirect
See: https://github.com/aws-solutions/qnabot-on-aws/blob/main/source/docs/kendra_redirect/README.md
"""
qid = 'Kendra.001'
question = self.__get_question_by_qid(qid, loaded_questions)
Expand Down
16 changes: 15 additions & 1 deletion .nightswatch/functional/test_knowledge_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,23 @@ def test_setup(self, designer_login, dom_operator: DomOperator):
settings_page.reset_settings()
settings_page.expand_all_subgroups()

def test_knowledge_base_returns_custom_no_hits_message(self, designer_login, dom_operator: DomOperator, cw_client: CloudWatchClient):
"""
Test Bedrock Knowledge Base integration returns CustomNoMatches defined in the designer when irrelevant question is asked.
https://docs.aws.amazon.com/solutions/latest/qnabot-on-aws/using-keyword-filters-for.html#custom-dont-know-answers
"""
menu = MenuNav(dom_operator)
chat_page = menu.open_chat_page()

chat_page.send_message('Who will win next Cricket world cup?')
answer = chat_page.get_last_message_text()
assert 'You stumped me, I don\'t currently know the answer to that question' in answer
cw_client.print_fulfillment_lambda_logs()

def test_knowledge_base_fallback(self, designer_login, dom_operator: DomOperator, cw_client: CloudWatchClient):
"""
Test that the Knowledge Base fallback is used when no answer is found. LLM should respond with correct answer as well as source links and context which should be enabled by default.
Test that the Knowledge Base fallback is used when no answer is found. LLM should respond with correct answer
as well as source links and context which should be enabled by default.
"""
menu = MenuNav(dom_operator)
Expand Down
13 changes: 13 additions & 0 deletions .nightswatch/functional/test_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,19 @@ def test_inference(self, designer_login, dom_operator: DomOperator, cw_client: C

cw_client.print_fulfillment_lambda_logs()

def test_llm_returns_custom_no_hits_message(self, designer_login, dom_operator: DomOperator, cw_client: CloudWatchClient):
"""
Test LLMApi integration returns CustomNoMatches defined in the designer when irrelevant question is asked.
https://docs.aws.amazon.com/solutions/latest/qnabot-on-aws/using-keyword-filters-for.html#custom-dont-know-answers
"""
menu = MenuNav(dom_operator)
chat_page = menu.open_chat_page()

chat_page.send_message('Did Humpty Dumpty live in Atlanta?')
answer = chat_page.get_last_message_text()
assert 'You stumped me, I don\'t currently know the answer to that question' in answer
cw_client.print_fulfillment_lambda_logs()

@pytest.mark.skipif(region in g5_instance_regions, reason=llm_multilanguage_unsupported_reason)
def test_translation(self, client_login, dom_operator: DomOperator, cw_client: CloudWatchClient):
"""
Expand Down
2 changes: 1 addition & 1 deletion .nightswatch/functional/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_custom_response(self, designer_login, loaded_questions: list[dict], dom
"""
Tests the custom empty response setting can be overwritten.
See: https://docs.aws.amazon.com/solutions/latest/qnabot-on-aws/keyword-filters-and-custom-dont-know-answers.html
See: https://docs.aws.amazon.com/solutions/latest/qnabot-on-aws/using-keyword-filters-for.html
"""
custom_empty_message = "Sorry, I don't know that"
edit_qid = 'CustomNoMatches'
Expand Down
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.0.2] - 2024-07-22

### Added
- Added a migration [documentation](./source/docs/update_or_migrate_deployment/README.md) for Migrating QnABot configurations and data from existing deployment to new deployment
- Added a [documentation](./source/docs/bedrock_knowledgebase_rag/README.md) for Bedrock Knowledge Base

### Fixed
- Improve logout functionality which signs out the user and invalidates the access and refresh tokens that Amazon Cognito issued to a user. [Issue #747](https://github.com/aws-solutions/qnabot-on-aws/issues/747)
- Fixed bug that restricted import of questions with answers that consisted of only double-byte characters. [Issue #731](https://github.com/aws-solutions/qnabot-on-aws/issues/731)
- Fixed bug with chained questions causing errors in the fulfillment lambda.

### Updated
- Removed aws-sdk (JavaScript V2) from dependency list.
- Updated parameter description for elicit response bot settings in the content designer settings. [Issue #745](https://github.com/aws-solutions/qnabot-on-aws/issues/745)
- Removed LLM models `meta.llama2-70b-chat-v1` and `meta.llama2-13b-chat-v1` from the list of models in the Cloudformation parameter `LLMBedrockModelId` since these models will be [unavailable on Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-lifecycle.html#versions-for-eol) starting from August 12, 2024.
- Updated the setting `LLM_QA_NO_HITS_REGEX` in the Content Designer to include a default pattern `Sorry, I don't know` in prompts specified through the setting `LLM_QA_PROMPT_TEMPLATE` and other patterns returned by LLMs in their responses.
- Constrainted the query made to Bedrock Knowledge Base to maximum of 1000 characters input query as per the [input requirements](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerateInput.html#API_agent-runtime_RetrieveAndGenerateInput_Contents).

## [6.0.1] - 2024-06-26
### Fixed
- Fixed bug that was restricting stack names to be below 26 characters. [Issue #741](https://github.com/aws-solutions/qnabot-on-aws/issues/741)
- Fixed a looping issue when using slots and chaining #721 ([PR #721](https://github.com/aws-solutions/qnabot-on-aws/pull/721)) - contributed by ([@amendlik](https://github.com/amendlik))
- Fixed a looping issue when using slots and chaining ([PR #721](https://github.com/aws-solutions/qnabot-on-aws/pull/721)) - contributed by ([@amendlik](https://github.com/amendlik))
- Github links with incorrect paths.

### Updated
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ As QnABot evolves over the years, it makes use of various services and functiona
_Note: **Deployable solution versions** refers to the ability to deploy the version of QnABot in their AWS accounts. **Actively supported versions** for QnABot is only available for the latest version of QnABot._
### Deployable Versions
- [v6.0.2](https://github.com/aws-solutions/qnabot-on-aws/releases/tag/v6.0.2) - [Public](https://solutions-reference.s3.amazonaws.com/qnabot-on-aws/v6.0.2/qnabot-on-aws-main.template)/[VPC](https://solutions-reference.s3.amazonaws.com/qnabot-on-aws/v6.0.2/qnabot-on-aws-vpc.template)
- [v6.0.1](https://github.com/aws-solutions/qnabot-on-aws/releases/tag/v6.0.1) - [Public](https://solutions-reference.s3.amazonaws.com/qnabot-on-aws/v6.0.1/qnabot-on-aws-main.template)/[VPC](https://solutions-reference.s3.amazonaws.com/qnabot-on-aws/v6.0.1/qnabot-on-aws-vpc.template)
- [v6.0.0](https://github.com/aws-solutions/qnabot-on-aws/releases/tag/v6.0.0) - [Public](https://solutions-reference.s3.amazonaws.com/qnabot-on-aws/v6.0.0/qnabot-on-aws-main.template)/[VPC](https://solutions-reference.s3.amazonaws.com/qnabot-on-aws/v6.0.0/qnabot-on-aws-vpc.template)
- [v5.5.2](https://github.com/aws-solutions/qnabot-on-aws/releases/tag/v5.5.2) - [Public](https://solutions-reference.s3.amazonaws.com/qnabot-on-aws/v5.5.2/qnabot-on-aws-main.template)/[VPC](https://solutions-reference.s3.amazonaws.com/qnabot-on-aws/v5.5.2md/qnabot-on-aws-vpc.template)
Expand Down
2 changes: 1 addition & 1 deletion source/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# QnABot CLI
The QnABot on AWS CLI supports the capability to import and export questions and answers from your QnABot setup. For more information on using QnaBot CLI, please refer to [Using QnABot on the AWS Command Line Interface (CLI)](https://docs.aws.amazon.com/solutions/latest/qnabot-on-aws/use-qnabot-on-aws-command-line-interface-cli.html)
The QnABot on AWS CLI supports the capability to import and export questions and answers from your QnABot setup. For more information on using QnaBot CLI, please refer to [Using QnABot on the AWS Command Line Interface (CLI)](https://docs.aws.amazon.com/solutions/latest/qnabot-on-aws/using-qnabot-on-aws-command-line-interface-cli.html)

## Unit Tests
1. Get started by creating a virtual environment and deploy the needed Python packages.
Expand Down
2 changes: 1 addition & 1 deletion source/cli/aws_solutions/qnabot/cli/qnabot_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@click.pass_context
def cli(ctx) -> None:
os.environ["SOLUTION_ID"] = "SO0189"
os.environ["SOLUTION_VERSION"] = "v6.0.1"
os.environ["SOLUTION_VERSION"] = "v6.0.2"


@cli.command("import")
Expand Down
2 changes: 1 addition & 1 deletion source/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"region": "us-east-1",
"profile": "default",
"publicBucket": "solutions",
"publicPrefix": "qnabot-on-aws/v6.0.1",
"publicPrefix": "qnabot-on-aws/v6.0.2",
"devEmail": "",
"ApprovedDomain": "NONE",
"Username": "Admin",
Expand Down
Loading

0 comments on commit 304d4a9

Please sign in to comment.