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
|
# TODO: check which secret manager is being used
|
||||||
# currently only supports Infisical
|
# currently only supports Infisical
|
||||||
secret = litellm.secret_manager_client.get_secret(secret_name).secret_value
|
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
|
# if secret manager fails default to using .env variables
|
||||||
os.environ[secret_name] = secret # set to env to be safe
|
os.environ[secret_name] = secret # set to env to be safe
|
||||||
return secret
|
return secret
|
||||||
elif litellm.api_key != None: # if users use litellm default key
|
elif litellm.api_key != None: # if users use litellm default key
|
||||||
return litellm.api_key
|
return litellm.api_key
|
||||||
else:
|
else:
|
||||||
return os.environ.get(secret_name)
|
return os.environ.get(secret_name)
|
||||||
|
|
||||||
######## Streaming Class ############################
|
######## Streaming Class ############################
|
||||||
# wraps the completion stream to return the correct format for the model
|
# wraps the completion stream to return the correct format for the model
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "litellm"
|
name = "litellm"
|
||||||
version = "0.1.390"
|
version = "0.1.391"
|
||||||
description = "Library to easily interface with LLM API providers"
|
description = "Library to easily interface with LLM API providers"
|
||||||
authors = ["BerriAI"]
|
authors = ["BerriAI"]
|
||||||
license = "MIT License"
|
license = "MIT License"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue