forked from phoenix/litellm-mirror
fixed get_secret
This commit is contained in:
parent
f5b6c04de4
commit
952e994ad1
2 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue