Skip to content

Commit

Permalink
Merge pull request #724 from aws-samples/development
Browse files Browse the repository at this point in the history
Release v0.21.5
  • Loading branch information
atjohns authored Aug 13, 2024
2 parents 22f8273 + 97d4e60 commit 8579237
Show file tree
Hide file tree
Showing 27 changed files with 317 additions and 2,152 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.21.4] - 2024-07-15
- Removed pipeline deployment mode as CodeCommit is no longer accepting new repositories
- Cleaned up some issues around lambda layer building

## [0.21.4] - 2024-07-15
- The Lex Web UI can now act as a passthrough for Q Business, allowing users to converse directly with their Q Business application while inheriting all the features of the Web UI such as embedding, CSS customizations and more.
- Upgraded version of amazon-connect-chatjs
Expand Down
26 changes: 0 additions & 26 deletions README-connect-live-chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,32 +80,6 @@ messages to the user, set the ConnectWaitForAgentMessageIntervalInSeconds to 0.

Once you have the parameters set, Create or update your stack.

### Using the pipeline template

The pipeline templates setup a new pipeline and code commit repo which deploys LexWebUi. The master-pipeline.yaml
template can be used to create a new pipeline and kick off execution of the pipeline. For a new pipeline, the same
parameters described above can be specified. When complete, the newly deployed Lex Web Ui
will have an updated lex-web-ui-loader-config.json file containing all the values specified for Connect Live Chat.
Future modifications to connect live chat parameters should occur in the lex-web-ui-loader-config.json file and
then be committed to code commit repo for deployment.

The new parameters configurable in lex-web-ui-loader-config.json are shown below.

```
"connect": {
"contactFlowId" : "YOUR CONTACT FLOW ID",
"instanceId" : "YOUR CONNECT INSTANCE ID",
"apiGatewayEndpoint" : "Your newly created Amazon API Gateway endpoint",
"promptForNameMessage": "Before starting a live chat, please tell me your name?",
"waitingForAgentMessage": "Thanks for waiting. An agent will be with you when available.",
"waitingForAgentMessageIntervalSeconds": 60,
"agentJoinedMessage": "{Agent} has joined.",
"agentLeftMessage": "{Agent} has left.",
"chatEndedMessage": "Chat ended.",
"attachChatTranscript": true
},
```

## Usage

Once the stack creation has completed, you can open the parent page hosting the Lex Web UI on your browser.
Expand Down
17 changes: 1 addition & 16 deletions README-css-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,7 @@ modifications outlined in this README.
* Modify the CSS accordingly and save the file locally on your desktop
* Upload the custom-chatbot-style.css back to your WebApp S3 bucket
* Use the CloudFront console to invalidate the CloudFront distribution such that it will be served up immediately

* CodePipeline/CodeBuild distribution
If you have used the master-pipeline.yaml to create a CodCommit/CodePipeline/CodeBuild distribution mechanism,
follow these steps.
* git clone the repo from CodeCommit
* Modify the CSS accordingly in your local repo
* Modify the root level Makefile and uncomment the lines noted below
```
# @echo "[INFO] copying custom-chatbot-style.css and setting cache max-age=0"
# aws s3 cp \
# --metadata-directive REPLACE --cache-control max-age=0 \
# "$(DIST_DIR)/custom-chatbot-style.css" s3://$(WEBAPP_BUCKET)
```
* Commit and push the changes to both files
* The resulting CodeBuild execution will publish the modified custom-chatbot-style.css to your WebApp S3 bucket.


## Summary of available css modifications

![Common use of CSS for LexWebUi](./img/LexWebUiStyle.png)
Expand Down
4 changes: 2 additions & 2 deletions README-qbusiness.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This feature supports integration with file attachments, enable both to allow QB
1. An existing deployment of a Q Business application is required for this solution. Please reference the AWS docs for creating a new [Q Business application](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/create-application.html)

### Deploy the Web UI
1. A deployment of the Lex Web UI with login enabled is required for Q Business integration. To launch a new
1. A deployment of the Lex Web UI with login enabled is required for Q Business integration. To launch a new deployment of the Web UI, go to the main [README](https://github.com/aws-samples/aws-lex-web-ui/blob/master/README.md) and select `Launch` for the region where your Q Business app is deployed.

2. The other bot fields for both V1 & V2 bots must be empty for the template to create the Q Business integration bot, please ensure that `Lex V1 Bot Configuration Parameters` and `Lex V2 Bot Configuration Parameters` are blank.

Expand Down Expand Up @@ -69,4 +69,4 @@ This feature supports integration with file attachments, enable both to allow QB

Your deployment of the Web UI should now talk directly to Amazon Q Business and return the same responses as the default web experience. In addition, by turning on upload capabilities you can ask Q Business questions about documents and get GenAI answers.

![QBusinessDemo](./img//QBusiness.gif)
![QBusinessDemo](./img//QBusiness.gif)
38 changes: 36 additions & 2 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ VPATH := $(OUT)

# upload files to bootstrap bucket
# NOTE: files uploaded with public read permissions
upload: upload-templates upload-src-zip upload-response-card-image \
upload-initiate-chat-lambda upload-streaming-lambda upload-qbusiness-lambda
upload: upload-templates upload-custom-resources-zip upload-src-zip upload-layers \
upload-response-card-image upload-initiate-chat-lambda upload-streaming-lambda upload-qbusiness-lambda
.PHONY: upload

# create the output directory for tracking dependencies
Expand All @@ -37,8 +37,42 @@ upload-templates: $(TEMPLATES) | $(OUT)
aws s3 sync --acl public-read --exclude "*" --include "*.yaml" \
"$(TEMPLATES_DIR)" "s3://$(BOOTSTRAP_BUCKET_PATH)/templates/" \
| tee "$(OUT)/$(@)"
aws s3 cp "$(TEMPLATES_DIR)"/layers.zip \
"s3://${BOOTSTRAP_BUCKET_PATH}/layers.zip"
@echo "[INFO] master template: https://s3.amazonaws.com/$(BOOTSTRAP_BUCKET_PATH)/templates/master.yaml"

LAMBDA_LAYER_ZIP := $(TEMPLATES_DIR)/layers.zip

upload-layers:
@echo "[INFO] Uploading lambda layer"
aws s3 cp --acl public-read "$(LAMBDA_LAYER_ZIP)" "s3://${BOOTSTRAP_BUCKET_PATH}/layers.zip"

# cfn custom resource lambda files are found under this directory
CUSTOM_RESOURCES_DIR := $(TEMPLATES_DIR)/custom-resources

# zip cfn custom resource lambda files
PY_MODULES := $(CUSTOM_RESOURCES_DIR)/py_modules
CUSTOM_RESOURCES_ZIP := custom-resources-$(VERSION).zip
CUSTOM_RESOURCES_FILES := $(wildcard $(CUSTOM_RESOURCES_DIR)/*.py)
CUSTOM_RESOURCES_FILES += $(PY_MODULES)
$(PY_MODULES):
pushd $(CUSTOM_RESOURCES_DIR) ; \
[ -f requirements.txt ] && \
python3 -m pip install --upgrade -r requirements.txt -t ./py_modules || true ; \
popd ;
$(CUSTOM_RESOURCES_ZIP): $(CUSTOM_RESOURCES_FILES) | $(OUT)
@echo "[INFO] Creating custom resource Lambda zip file"
zip -u -j "$(OUT)/$(@)" $(?) ; \
pushd $(CUSTOM_RESOURCES_DIR)/py_modules ; \
zip -r -q "../../../build/$(OUT)/$(@)" . ; \
popd ;
upload-custom-resources-zip: $(CUSTOM_RESOURCES_ZIP) | $(OUT)
@echo "[INFO] Uploading custom resources Lambda zip file"
aws s3 cp --acl public-read \
"$(OUT)/$(CUSTOM_RESOURCES_ZIP)" \
"s3://$(BOOTSTRAP_BUCKET_PATH)/$(CUSTOM_RESOURCES_ZIP)" \
| tee -a "$(OUT)/$(@)"

# initiate chat lambda function

INITIATE_CHAT_LAMBDA_DIR := $(SOURCE_DIR)/initiate-chat-lambda
Expand Down
33 changes: 7 additions & 26 deletions build/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,30 @@ case $unamestr in
"Darwin" | "FreeBSD")
sed -i '' -e "s/(v.*)/($VERSION)/g" \
-e "s/Timestamp:.*/Timestamp: $timestamp/g" \
-e "s/custom-resources-.*zip/custom-resources-$VERSION.zip/g" \
-e "s/src-.*zip/src-$VERSION.zip/g" \
-e "s/initiate-chat-lambda-.*zip/initiate-chat-lambda-$VERSION.zip/g" \
../templates/master.yaml;

sed -i '' -e "s/(v.*)/($VERSION)/g" \
-e "s/Timestamp:.*/Timestamp: $timestamp/g" \
-e "s/src-.*zip/src-$VERSION.zip/g" \
-e "s/initiate-chat-lambda-.*zip/initiate-chat-lambda-$VERSION.zip/g" \
../templates/master-pipeline.yaml;;
../templates/master.yaml;;

"Linux")
sed -i -e "s/(v.*)/($VERSION)/g" \
-e "s/Timestamp:.*/Timestamp: $timestamp/g" \
-e "s/src-.*zip/src-$VERSION.zip/g" \
-e "s/initiate-chat-lambda-.*zip/initiate-chat-lambda-$VERSION.zip/g" \
-e "s/streaming-lambda-.*zip/streaming-lambda-$VERSION.zip/g" \
-e "s/custom-resources-.*zip/custom-resources-$VERSION.zip/g" \
-e "s/qbusiness-lambda-.*zip/qbusiness-lambda-$VERSION.zip/g" \
../templates/master.yaml;

sed -i -e "s/(v.*)/($VERSION)/g" \
-e "s/Timestamp:.*/Timestamp: $timestamp/g" \
-e "s/src-.*zip/src-$VERSION.zip/g" \
-e "s/initiate-chat-lambda-.*zip/initiate-chat-lambda-$VERSION.zip/g" \
-e "s/streaming-lambda-.*zip/streaming-lambda-$VERSION.zip/g" \
-e "s/streaming-lambda-.*zip/qbusiness-lambda-$VERSION.zip/g" \
../templates/master-pipeline.yaml;;
../templates/master.yaml;;

*)
sed -i -e "s/(v.*)/($VERSION)/g" \
-e "s/Timestamp:.*/Timestamp: $timestamp/g" \
-e "s/src-.*zip/src-$VERSION.zip/g" \
-e "s/initiate-chat-lambda-.*zip/initiate-chat-lambda-$VERSION.zip/g" \
-e "s/streaming-lambda-.*zip/streaming-lambda-$VERSION.zip/g" \
-e "s/custom-resources-.*zip/custom-resources-$VERSION.zip/g" \
-e "s/qbusiness-lambda-.*zip/qbusiness-lambda-$VERSION.zip/g" \
../templates/master.yaml;

sed -i -e "s/(v.*)/($VERSION)/g" \
-e "s/Timestamp:.*/Timestamp: $timestamp/g" \
-e "s/src-.*zip/src-$VERSION.zip/g" \
-e "s/initiate-chat-lambda-.*zip/initiate-chat-lambda-$VERSION.zip/g" \
-e "s/streaming-lambda-.*zip/streaming-lambda-$VERSION.zip/g" \
-e "s/qbusiness-lambda-.*zip/qbusiness-lambda-$VERSION.zip/g" \
../templates/master-pipeline.yaml;;

../templates/master.yaml;;

esac
cd ../lex-web-ui
Expand All @@ -59,6 +39,7 @@ npm run build-dist
cd ..
make
cd build
make "custom-resources-$VERSION.zip"
make "initiate-chat-lambda-$VERSION.zip"
make "streaming-lambda-$VERSION.zip"
make "qbusiness-lambda-$VERSION.zip"
Expand Down
3 changes: 3 additions & 0 deletions build/upload-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ popd
aws s3 cp out/src-$version.zip \
"s3://${BOOTSTRAP_BUCKET_PATH}/src-$version.zip"

aws s3 cp out/custom-resources-$version.zip \
"s3://${BOOTSTRAP_BUCKET_PATH}/custom-resources-$version.zip"

aws s3 cp out/initiate-chat-lambda-$version.zip \
"s3://${BOOTSTRAP_BUCKET_PATH}/initiate-chat-lambda-$version.zip"

Expand Down
2 changes: 1 addition & 1 deletion dist/lex-web-ui-loader.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/lex-web-ui-loader.min.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* lex-web-ui v0.21.4
* lex-web-ui v0.21.5
* (c) 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Released under the Amazon Software License.
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/lex-web-ui.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/wav-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/wav-worker.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lex-web-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lex-web-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lex-web-ui",
"version": "0.21.4",
"version": "0.21.5",
"description": "Amazon Lex Web Interface",
"author": "AWS",
"license": "Amazon Software License",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-lex-web-ui",
"version": "0.21.4",
"version": "0.21.5",
"description": "Sample Amazon Lex Web Interface",
"main": "dist/lex-web-ui.min.js",
"repository": {
Expand Down
Loading

0 comments on commit 8579237

Please sign in to comment.