Find answers from the community

Updated last year

Has anyone set up AzureOpenAI with

Has anyone set up AzureOpenAI with LlamaIndex? I've deployed a gpt-35-turbo model and a text-embedding-ada-002 model to my Azure subscription. Also, I've initialized the AzureOpenAI & OpenAIEmbedding class with my model, apiBase, apiKey, apiType and deployment name (credentials from azure) and passed it into the service_context. Now, the chat completion goes through Azure OpenAI. However, when I look at my console logs, I see that for the embedding, the URL "api.openai.com/v1/embeddings" is called. Question: Why does it not go to Azure but the official OpenAI API?
L
b
4 comments
Did you set a global service context? Azure tends to need it for whatever reason

Plain Text
from llama_index import set_global_service_context
set_global_service_context(azure_service_context)
Oh, I didn't. I did not know that this was needed. I'll try it out and we'll give feedback. Thanks Logan πŸ˜„
Works! Thanksss
Nice! πŸ’ͺ
Add a reply
Sign up and join the conversation on Discord