[Bug Fix] Add support for AWS_REGION override (#1237)

This commit is contained in:
Thomas T
2024-02-06 14:25:58 -05:00
committed by GitHub
parent fa78c972be
commit 8fe2c3effc
2 changed files with 5 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
import os
from typing import Optional
from langchain.llms import Bedrock
@@ -25,7 +26,7 @@ class AWSBedrockLlm(BaseLlm):
'Please install with `pip install --upgrade "embedchain[aws-bedrock]"`'
) from None
self.boto_client = boto3.client("bedrock-runtime", "us-west-2")
self.boto_client = boto3.client("bedrock-runtime", "us-west-2" or os.environ.get("AWS_REGION"))
kwargs = {
"model_id": config.model or "amazon.titan-text-express-v1",