From 1689cf14c6cddc93f36044ac672790716af55cb0 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 22 Aug 2023 16:18:11 -0700 Subject: [PATCH] fixing linting issues --- litellm/utils.py | 29 ----------------------------- pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/litellm/utils.py b/litellm/utils.py index f9792fab4..2c0c2e352 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -1021,35 +1021,6 @@ def handle_success(args, kwargs, result, start_time, end_time): ) pass - -def get_model_list(): - global last_fetched_at - # if user is using hosted product -> get their updated model list - refresh every 5 minutes - user_email = os.getenv("LITELLM_EMAIL") or litellm.email - if user_email: - time_delta = 0 - if last_fetched_at != None: - current_time = time.time() - time_delta = current_time - last_fetched_at - if time_delta > 300 or last_fetched_at == None: - # make the api call - last_fetched_at = time.time() - print(f"last_fetched_at: {last_fetched_at}") - response = requests.post( - url="http://api.litellm.ai/get_model_list", - headers={"content-type": "application/json"}, - data=json.dumps({"user_email": user_email}), - ) - print_verbose(f"get_model_list response: {response.text}") - data = response.json() - # update model list - model_list = data["model_list"] - return model_list - return None - # return None by default - return None - - def acreate(*args, **kwargs): ## Thin client to handle the acreate langchain call return litellm.acompletion(*args, **kwargs) diff --git a/pyproject.toml b/pyproject.toml index 4422f20d1..f5178bfb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ python = "^3.8" openai = "^0.27.8" python-dotenv = "^1.0.0" tiktoken = "^0.4.0" -importlib_metadata +importlib_metadata = "^6.8.0" [build-system] requires = ["poetry-core"]