mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
fix(main.py): read openai org from env
This commit is contained in:
parent
69e40cdb31
commit
6c7fa8a4aa
1 changed files with 5 additions and 2 deletions
|
@ -376,8 +376,11 @@ def completion(
|
||||||
or get_secret("OPENAI_API_BASE")
|
or get_secret("OPENAI_API_BASE")
|
||||||
or "https://api.openai.com/v1"
|
or "https://api.openai.com/v1"
|
||||||
)
|
)
|
||||||
if litellm.organization:
|
openai.organization = (
|
||||||
openai.organization = litellm.organization
|
litellm.organization
|
||||||
|
or get_secret("OPENAI_ORGANIZATION")
|
||||||
|
or None # default - https://github.com/openai/openai-python/blob/284c1799070c723c6a553337134148a7ab088dd8/openai/util.py#L105
|
||||||
|
)
|
||||||
# set API KEY
|
# set API KEY
|
||||||
api_key = (
|
api_key = (
|
||||||
api_key or
|
api_key or
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue