Clone the repository
git clone https://github.com/micxyj/amazon-kendra-langchain-cn.gitMove to the repo dir
cd amazon-kendra-langchain-cnInstall the dependencies
pip install boto3
pip install langchain
pip install streamlitInstall the classes
pip install .https://docs.aws.amazon.com/kendra/latest/dg/what-is-kendra.html
For executing sample chains, install the optional dependencies
pip install ".[samples]"https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
Ensure that the environment variables are set for the aws region, kendra index id and the provider/model used by the sample.
For example, for running the kendra_chatGLM.py sample, these environment variables must be set: AWS_REGION, KENDRA_INDEX_ID
and CHATGLM_ENDPOINT.
You can use commands as below to set the environment variables.
export AWS_REGION="<YOUR-AWS-REGION>"
export KENDRA_INDEX_ID="<YOUR-KENDRA-INDEX-ID>"
export CHATGLM_ENDPOINT="<YOUR-SAGEMAKER-ENDPOINT-FOR-CHATGLM>"The samples directory is bundled with an app.py file that can be run as a web app using streamlit.
cd samples
streamlit run app.py chatglmpython samples/<sample-file-name.py>pip uninstall aws-langchain