fix issue with openAiBaseURL not being set

This commit is contained in:
Abi Raja 2023-11-30 11:49:59 -05:00
parent 0c532e528c
commit fa6f57914b

View File

@ -113,7 +113,7 @@ async def stream_code(websocket: WebSocket):
# Get the OpenAI Base URL from the request. Fall back to environment variable if not provided. # Get the OpenAI Base URL from the request. Fall back to environment variable if not provided.
openai_base_url = None openai_base_url = None
if params["openAiBaseURL"]: if "openAiBaseURL" in params and params["openAiBaseURL"]:
openai_base_url = params["openAiBaseURL"] openai_base_url = params["openAiBaseURL"]
print("Using OpenAI Base URL from client-side settings dialog") print("Using OpenAI Base URL from client-side settings dialog")
else: else:
@ -122,7 +122,7 @@ async def stream_code(websocket: WebSocket):
print("Using OpenAI Base URL from environment variable") print("Using OpenAI Base URL from environment variable")
if not openai_base_url: if not openai_base_url:
print("Using Offical OpenAI Base URL") print("Using offical OpenAI URL")
# Get the image generation flag from the request. Fall back to True if not provided. # Get the image generation flag from the request. Fall back to True if not provided.
should_generate_images = ( should_generate_images = (