Skip to content

Commit c1ce9f8

Browse files
authored
Merge pull request #136 from cvgore/patch-1
unable to start ai-service when trying to use public OpenAI
2 parents 1f7ba8b + 3f62f95 commit c1ce9f8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ai-service/routers/LLM.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ def get_llm():
1111
useLocalLLM: bool = False
1212
useAzureOpenAI: bool = False
1313
kernel = False
14-
14+
endpoint: str = ''
15+
1516
if os.environ.get("USE_LOCAL_LLM"):
1617
useLocalLLM = os.environ.get("USE_LOCAL_LLM").lower() == "true"
1718

@@ -24,7 +25,7 @@ def get_llm():
2425

2526
# if useLocalLLM or useAzureOpenAI are set to true, get the endpoint from the environment variables
2627
if useLocalLLM or useAzureOpenAI:
27-
endpoint: str = os.environ.get("AI_ENDPOINT") or os.environ.get("AZURE_OPENAI_ENDPOINT")
28+
endpoint = os.environ.get("AI_ENDPOINT") or os.environ.get("AZURE_OPENAI_ENDPOINT")
2829

2930
if isinstance(endpoint, str) == False or endpoint == "":
3031
raise Exception("AI_ENDPOINT or AZURE_OPENAI_ENDPOINT environment variable must be set when USE_LOCAL_LLM or USE_AZURE_OPENAI is set to true")
@@ -67,4 +68,4 @@ def get_llm():
6768
else:
6869
print("Authenticating to Azure OpenAI with OpenAI API key")
6970
kernel.add_chat_service("dv", AzureChatCompletion(deployment_name=deployment, endpoint=endpoint, api_key=api_key))
70-
return kernel, useLocalLLM, endpoint
71+
return kernel, useLocalLLM, endpoint

0 commit comments

Comments
 (0)