Skip to content

Commit 1fe7349

Browse files
author
Praveen Kumar Jeyarajan
committed
feat: update outdated libraries
1 parent 71912f2 commit 1fe7349

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## GenAI Chat Assistant on AWS
1+
# GenAI Chat Assistant on AWS
22

3-
### Introduction
3+
## Introduction
44

55
This demo Chat Assistant application centers around the development of an advanced Chat Assistant using Amazon Bedrock and AWS's serverless GenAI solution. The solution demonstrates a Chat Assistant that utilizes the knowledge of the [Amazon SageMaker Developer Guide](https://docs.aws.amazon.com/sagemaker/latest/dg/gs.html?icmpid=docs_sagemaker_lp/index.html) and [SageMaker instance pricing](https://aws.amazon.com/sagemaker/pricing/). This Chat Assistant serves as an example of the power of Amazon Bedrock in processing and utilizing complex data sets, and it’s capability of converting natural language into Amazon Athena queries. It employs open source tools like LangChain and LLamaIndex to enhance its data processing and retrieval capabilities. The article also highlights the integration of various AWS resources, including Amazon S3 for storage, Amazon Kendra as vector store to support the retrieval augmented generation (RAG), AWS Glue for data preparation, Amazon Athena for efficient querying, Amazon Lambda for serverless computing, and Amazon ECS for container management. These resources collectively enable the Chat Assistant to effectively retrieve and manage content from documents and databases, illustrating the potential of Amazon Bedrock in sophisticated Chat Assistant applications.
66

code/lambda-container/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM public.ecr.aws/lambda/python:3.11@sha256:ac1ea95dc3a292ee5583e2771bb9e8d21e449aedc5b1fcf93accfae55f049df6
1+
FROM public.ecr.aws/lambda/python:3.11@sha256:4c04b142654ce3d1b8d705880bf5c720599b5984fd4c751763f09f1682308490
22
RUN yum update --security -y && yum clean all
33
COPY requirements.txt ${LAMBDA_TASK_ROOT}/
44
RUN pip install -r requirements.txt --no-cache-dir
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
boto3>=1.34.61
2-
llama-index==0.12.28
3-
llama-index-embeddings-bedrock==0.2.1
4-
llama-index-llms-bedrock==0.1.9
5-
langchain==0.3.0
6-
langchain-community==0.2.19
7-
sqlalchemy==2.0.28
8-
PyAthena[SQLAlchemy]
1+
boto3==1.36.1
2+
llama-index==0.12.40
3+
llama-index-embeddings-bedrock==0.5.0
4+
llama-index-llms-bedrock==0.3.8
5+
langchain==0.3.25
6+
langchain-community==0.3.24
7+
sqlalchemy
8+
PyAthena[SQLAlchemy]==3.14.1

code/lambda-container/sagemaker_dg_rag.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def doc_retrieval(query, llm_model="ClaudeInstant", K=5):
3939
kclient=Connections.kendra_client,
4040
top_k=K,
4141
index_id=Connections.kendra_rawdata_index_id,
42+
min_score_confidence=0.1, # Added parameter to fix validation error
4243
)
4344
docs = retriever._get_relevant_documents(query, run_manager=None)
4445

code/lambda-container/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ class InMemoryHistory(BaseChatMessageHistory, BaseModel):
99
"""In memory implementation of chat message history."""
1010

1111
messages: List[BaseMessage] = Field(default_factory=list)
12+
13+
class Config:
14+
arbitrary_types_allowed = True
1215

1316
def add_messages(self, messages: List[BaseMessage]) -> None:
1417
"""Add a list of messages to the store"""

0 commit comments

Comments
 (0)