From 58a0b4c03bdb8990c6f1940ece0bc7703abe3511 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Mon, 15 Jan 2024 16:57:36 -0800 Subject: [PATCH] Revert "Revert "(fix) proxy only import dynamo_db when it's being used"" This reverts commit 8cce2f28caf5a9a31d86a9b40bf51f60df67e6bf. --- litellm/proxy/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index 4224437f55e..c55453423bf 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -7,7 +7,6 @@ from litellm.proxy.hooks.parallel_request_limiter import MaxParallelRequestsHand from litellm.proxy.hooks.max_budget_limiter import MaxBudgetLimiter from litellm.integrations.custom_logger import CustomLogger from litellm.proxy.db.base_client import CustomDB -from litellm.proxy.db.dynamo_db import DynamoDBWrapper from fastapi import HTTPException, status import smtplib from email.mime.text import MIMEText @@ -595,6 +594,8 @@ class DBClient: self, custom_db_type: Literal["dynamo_db"], custom_db_args: dict ) -> None: if custom_db_type == "dynamo_db": + from litellm.proxy.db.dynamo_db import DynamoDBWrapper + self.db = DynamoDBWrapper(database_arguments=DynamoDBArgs(**custom_db_args)) async def get_data(self, key: str, table_name: Literal["user", "key", "config"]):