From 689371949c120ff6bb748e5736683e091a6e610f Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Mon, 9 Oct 2023 16:49:22 -0700 Subject: [PATCH] fix(main.py): read openai org from env --- litellm/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/litellm/main.py b/litellm/main.py index c52568a489b..f045ffb8169 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -376,8 +376,11 @@ def completion( or get_secret("OPENAI_API_BASE") or "https://api.openai.com/v1" ) - if litellm.organization: - openai.organization = litellm.organization + openai.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 api_key = ( api_key or