mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
litellm not honoring OPENAI_ORGANIZATION env var (#7066)
* fix setting organization using .env vars * test_completion_bad_org * test_completion_bad_org
This commit is contained in:
parent
04d558e75f
commit
aaa4d4178a
2 changed files with 24 additions and 1 deletions
|
@ -1527,12 +1527,13 @@ def completion( # type: ignore # noqa: PLR0915
|
|||
or get_secret("OPENAI_API_BASE")
|
||||
or "https://api.openai.com/v1"
|
||||
)
|
||||
openai.organization = (
|
||||
organization = (
|
||||
organization
|
||||
or litellm.organization
|
||||
or get_secret("OPENAI_ORGANIZATION")
|
||||
or None # default - https://github.com/openai/openai-python/blob/284c1799070c723c6a553337134148a7ab088dd8/openai/util.py#L105
|
||||
)
|
||||
openai.organization = organization
|
||||
# set API KEY
|
||||
api_key = (
|
||||
api_key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue