diff --git a/libs/experimental/langchain_experimental/agents/agent_toolkits/cloudwatch/base.py b/libs/experimental/langchain_experimental/agents/agent_toolkits/cloudwatch/base.py index e736e34..f04c61e 100644 --- a/libs/experimental/langchain_experimental/agents/agent_toolkits/cloudwatch/base.py +++ b/libs/experimental/langchain_experimental/agents/agent_toolkits/cloudwatch/base.py @@ -1,3 +1,4 @@ +import os from datetime import datetime, timedelta from typing import Any, Dict, List, Optional @@ -14,8 +15,12 @@ SUFFIX, ) +DEFAULT_REGION = "us-east-1" + +region_name = os.getenv("AWS_REGION", DEFAULT_REGION) + # Initialize the boto3 client for CloudWatch Logs -cloudwatch_logs_client = boto3.client("logs") +cloudwatch_logs_client = boto3.client("logs", region_name=region_name) def _validate_cloudwatch_client(client: Any) -> bool: