llama_index
                                
                                 llama_index copied to clipboard
                                
                                    llama_index copied to clipboard
                            
                            
                            
                        can't use GPTSimpleVectorIndex with Microsoft Azure OpenAI
I can't use GPTSimpleVectorIndex with Microsoft Azure OpenAI
I have the following settings:
openai.api_type = "azure"
openai.api_base = "https://xyz.openai.azure.com/"
openai.api_version = "2022-12-01"
openai.api_key = os.getenv("OPENAI_API_KEY")
from gpt_index import GPTSimpleVectorIndex, SimpleDirectoryReader, LLMPredictor
documents = SimpleDirectoryReader('docs/test-data', recursive=True, required_exts=[".md"]).load_data()
llm_predictor = LLMPredictor(llm=AzureOpenAI(deployment_name="xyz-Curie", openai_api_key=openai.api_key))
index = GPTSimpleVectorIndex(documents=documents, llm_predictor=llm_predictor)
Error:
openai.error.InvalidRequestError: The API deployment for the resource does not exist.
i haven't really tested the AzureOpenAI stuff, i think we only have embedding support atm and not the full llm? https://github.com/jerryjliu/gpt_index/pull/254/files
Any update on this? What is being supported now?
It works if you specify both embedding and completion model:
embed_model = OpenAIEmbedding(deployment_name="text-search-ada-doc-001")
llm_predictor = LLMPredictor(llm=AzureOpenAI(deployment_name="davinci-003", openai_api_key=openai.api_key))
index = GPTSimpleVectorIndex(documents, embed_model=embed_model, llm_predictor=llm_predictor)
should be resolved with the nb provided in #402