From 952e994ad1e48e4912166227f401bb73ac8a889f Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Mon, 14 Aug 2023 17:34:28 -0700 Subject: [PATCH] fixed get_secret --- litellm/utils.py | 10 +++++----- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/litellm/utils.py b/litellm/utils.py index 662e70a9c..545138313 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -713,14 +713,14 @@ def get_secret(secret_name): # TODO: check which secret manager is being used # currently only supports Infisical secret = litellm.secret_manager_client.get_secret(secret_name).secret_value - if secret != None: + if secret != None: # failsafe when secret manager fails # if secret manager fails default to using .env variables os.environ[secret_name] = secret # set to env to be safe return secret - elif litellm.api_key != None: # if users use litellm default key - return litellm.api_key - else: - return os.environ.get(secret_name) + elif litellm.api_key != None: # if users use litellm default key + return litellm.api_key + else: + return os.environ.get(secret_name) ######## Streaming Class ############################ # wraps the completion stream to return the correct format for the model diff --git a/pyproject.toml b/pyproject.toml index df6f809da..a6c0225fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "litellm" -version = "0.1.390" +version = "0.1.391" description = "Library to easily interface with LLM API providers" authors = ["BerriAI"] license = "MIT License"