Describe the bug
The following code in 02_qa_w_rag_claude_opensearch.ipynb will throw an error if the AWS_DEFAULT_REGION is not set. Update to retrieve the region dynamically, e.g. boto3.session.Session.region_name. Do not hard code the region.
from opensearchpy import OpenSearch, RequestsHttpConnection, AWSV4SignerAuth
from langchain.vectorstores import OpenSearchVectorSearch
service = 'aoss'
credentials = boto3.Session().get_credentials()
auth = AWSV4SignerAuth(credentials, os.environ.get("AWS_DEFAULT_REGION", 'us-east-1'), service)
The following line in 02_qa_w_rag_claude_opensearch.ipynb will also throw an error if the REGION is not set:
Describe the bug The following code in 02_qa_w_rag_claude_opensearch.ipynb will throw an error if the AWS_DEFAULT_REGION is not set. Update to retrieve the region dynamically, e.g.
boto3.session.Session.region_name
. Do not hard code the region.The following line in 02_qa_w_rag_claude_opensearch.ipynb will also throw an error if the REGION is not set:
None
is not an appropriate value if the variable is not set.