From 3ad78e48e2dbc637e519f9e9f1de3f1b04c109a1 Mon Sep 17 00:00:00 2001 From: chevalmuscle <28069469+chevalmuscle@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:31:16 -0500 Subject: [PATCH] Use endpoint_url if provided with boto3 session for dynamodb (#11622) - **Description:** Uses `endpoint_url` if provided with a boto3 session. When running dynamodb locally, credentials are required even if invalid. With this change, it will be possible to pass a boto3 session with credentials and specify an endpoint_url --------- Co-authored-by: Bagatur Co-authored-by: Erick Friis --- .../langchain/memory/chat_message_histories/dynamodb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/langchain/langchain/memory/chat_message_histories/dynamodb.py b/libs/langchain/langchain/memory/chat_message_histories/dynamodb.py index 318afdce13a..353356ef5ba 100644 --- a/libs/langchain/langchain/memory/chat_message_histories/dynamodb.py +++ b/libs/langchain/langchain/memory/chat_message_histories/dynamodb.py @@ -53,7 +53,7 @@ class DynamoDBChatMessageHistory(BaseChatMessageHistory): kms_key_id: Optional[str] = None, ): if boto3_session: - client = boto3_session.resource("dynamodb") + client = boto3_session.resource("dynamodb", endpoint_url=endpoint_url) else: try: import boto3