Skip to content
Snippets Groups Projects
Commit 81b67794 authored by Marcus Schiesser's avatar Marcus Schiesser Committed by Marcus Schiesser
Browse files

fix: throw errors if azure deployments are no

parent 5c13646e
No related branches found
No related tags found
No related merge requests found
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
"create-llama": patch "create-llama": patch
--- ---
Add azure model provider Add Azure OpenAI as model provider
...@@ -75,15 +75,15 @@ def init_azure_openai(): ...@@ -75,15 +75,15 @@ def init_azure_openai():
from llama_index.embeddings.azure_openai import AzureOpenAIEmbedding from llama_index.embeddings.azure_openai import AzureOpenAIEmbedding
from llama_index.llms.azure_openai import AzureOpenAI from llama_index.llms.azure_openai import AzureOpenAI
llm_deployment = os.getenv("AZURE_OPENAI_LLM_DEPLOYMENT") llm_deployment = os.environ["AZURE_OPENAI_LLM_DEPLOYMENT"]
embedding_deployment = os.getenv("AZURE_OPENAI_EMBEDDING_DEPLOYMENT") embedding_deployment = os.environ["AZURE_OPENAI_EMBEDDING_DEPLOYMENT"]
max_tokens = os.getenv("LLM_MAX_TOKENS") max_tokens = os.getenv("LLM_MAX_TOKENS")
temperature = os.getenv("LLM_TEMPERATURE", DEFAULT_TEMPERATURE) temperature = os.getenv("LLM_TEMPERATURE", DEFAULT_TEMPERATURE)
dimensions = os.getenv("EMBEDDING_DIM") dimensions = os.getenv("EMBEDDING_DIM")
azure_config = { azure_config = {
"api_key": os.getenv("AZURE_OPENAI_KEY"), "api_key": os.environ["AZURE_OPENAI_KEY"],
"azure_endpoint": os.getenv("AZURE_OPENAI_ENDPOINT"), "azure_endpoint": os.environ["AZURE_OPENAI_ENDPOINT"],
"api_version": os.getenv("AZURE_OPENAI_API_VERSION") "api_version": os.getenv("AZURE_OPENAI_API_VERSION")
or os.getenv("OPENAI_API_VERSION"), or os.getenv("OPENAI_API_VERSION"),
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment