update get secret logic

This commit is contained in:
Krrish Dholakia 2023-08-28 07:21:02 -07:00
parent 841ac5ab20
commit 9497175a97
2 changed files with 8 additions and 9 deletions

View file

@ -211,9 +211,9 @@ def completion(
openai.api_type = "openai"
# note: if a user sets a custom base - we should ensure this works
api_base = (
custom_api_base or litellm.api_base or get_secret("OPENAI_API_BASE")
custom_api_base or litellm.api_base or get_secret("OPENAI_API_BASE") or "https://api.openai.com/v1"
)
openai.api_base = api_base or "https://api.openai.com/v1"
openai.api_base = api_base
openai.api_version = None
if litellm.organization:
openai.organization = litellm.organization