mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
allow setting litellm.api_key
This commit is contained in:
parent
4f6958dc5b
commit
8b408bb83b
3 changed files with 4 additions and 3 deletions
|
@ -5,6 +5,7 @@ set_verbose=False
|
|||
telemetry=True
|
||||
max_tokens = 256 # OpenAI Defaults
|
||||
retry = True
|
||||
api_key = None
|
||||
openai_key = None
|
||||
azure_key = None
|
||||
anthropic_key = None
|
||||
|
|
|
@ -717,10 +717,10 @@ def get_secret(secret_name):
|
|||
# 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)
|
||||
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.389"
|
||||
version = "0.1.390"
|
||||
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