From ba54b984759df2ee2d8c9de60c10bbacd8128f60 Mon Sep 17 00:00:00 2001 From: Jim Burtoft <39492751+jimburtoft@users.noreply.github.com> Date: Sun, 3 Dec 2023 21:26:27 -0500 Subject: [PATCH 1/3] Update app.py - Usage list Added additional options in "Usage" list and fixed bedrock|claudev2 typo. This change only affects the text of the Exception message if you start streamlit without a valid option. --- kendra_retriever_samples/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kendra_retriever_samples/app.py b/kendra_retriever_samples/app.py index 34613b9..a440056 100644 --- a/kendra_retriever_samples/app.py +++ b/kendra_retriever_samples/app.py @@ -79,7 +79,7 @@ def read_properties_file(filename): else: raise Exception("Unsupported LLM: ", sys.argv[1]) else: - raise Exception("Usage: streamlit run app.py ") + raise Exception("Usage: streamlit run app.py ") if 'chat_history' not in st.session_state: st.session_state['chat_history'] = [] From 33f8979cb1e994291a3a76f8443fd460058e37c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 03:02:09 +0000 Subject: [PATCH 2/3] Bump langchain from 0.0.306 to 0.0.329 in /kendra_retriever_samples Bumps [langchain](https://github.com/langchain-ai/langchain) from 0.0.306 to 0.0.329. - [Release notes](https://github.com/langchain-ai/langchain/releases) - [Commits](https://github.com/langchain-ai/langchain/compare/v0.0.306...v0.0.329) --- updated-dependencies: - dependency-name: langchain dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- kendra_retriever_samples/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kendra_retriever_samples/requirements.txt b/kendra_retriever_samples/requirements.txt index fbf3f7a..9cc12f1 100644 --- a/kendra_retriever_samples/requirements.txt +++ b/kendra_retriever_samples/requirements.txt @@ -1,4 +1,4 @@ -langchain==0.0.326 +langchain==0.0.329 boto3>=1.28.27 openai anthropic From 28fca441396c3a8b5eb4df44348151be2c88f5fe Mon Sep 17 00:00:00 2001 From: Moha Date: Mon, 22 Jan 2024 17:07:19 +1100 Subject: [PATCH 3/3] updated handling of profile name in claude v2 script --- .../kendra_chat_bedrock_claudev2.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/kendra_retriever_samples/kendra_chat_bedrock_claudev2.py b/kendra_retriever_samples/kendra_chat_bedrock_claudev2.py index b1b98c3..74198bc 100644 --- a/kendra_retriever_samples/kendra_chat_bedrock_claudev2.py +++ b/kendra_retriever_samples/kendra_chat_bedrock_claudev2.py @@ -23,17 +23,22 @@ class bcolors: def build_chain(): region = os.environ["AWS_REGION"] kendra_index_id = os.environ["KENDRA_INDEX_ID"] - credentials_profile_name = os.environ['AWS_PROFILE'] - print(credentials_profile_name) - - - llm = Bedrock( + if "AWS_PROFILE" in os.environ: + credentials_profile_name = os.environ['AWS_PROFILE'] + print("Using " + credentials_profile_name + " profile.") + llm = Bedrock( credentials_profile_name=credentials_profile_name, region_name = region, model_kwargs={"max_tokens_to_sample":300,"temperature":1,"top_k":250,"top_p":0.999,"anthropic_version":"bedrock-2023-05-31"}, model_id="anthropic.claude-v2" - ) + ) + else: + llm = Bedrock( + region_name = region, + model_kwargs={"max_tokens_to_sample":300,"temperature":1,"top_k":250,"top_p":0.999,"anthropic_version":"bedrock-2023-05-31"}, + model_id="anthropic.claude-v2" + ) retriever = AmazonKendraRetriever(index_id=kendra_index_id,top_k=5,region_name=region)