From 02f7f8cd8735ec0a55e1b73006cd9605683a8fbd Mon Sep 17 00:00:00 2001 From: Miguel P Z <60221874+MiguelElGallo@users.noreply.github.com> Date: Sat, 20 Jan 2024 17:21:20 +0200 Subject: [PATCH] Update sample_rag_langchain.ipynb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For using Azure OpenAI, you need to set: ´ openai.api_type = "azure" ´ Otherwise, the URL is malformed or empty. After adding these lines, it started to work for me. --- SampleCode/Python/sample_rag_langchain.ipynb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SampleCode/Python/sample_rag_langchain.ipynb b/SampleCode/Python/sample_rag_langchain.ipynb index 5457048..16ec0ed 100644 --- a/SampleCode/Python/sample_rag_langchain.ipynb +++ b/SampleCode/Python/sample_rag_langchain.ipynb @@ -120,6 +120,8 @@ "source": [ "# Embed the splitted documents and insert into Azure Search vector store\n", "\n", + "import openai \n", + "openai.api_base = os.getenv(\"AZURE_OPENAI_ENDPOINT\")\n", "aoai_embeddings = AzureOpenAIEmbeddings(\n", " azure_deployment=\"\",\n", " openai_api_version=\"\", # e.g., \"2023-07-01-preview\"\n",