From 64940e9d0fd2d00c321c625313e8031db2ff7204 Mon Sep 17 00:00:00 2001 From: Harrison Chase Date: Sat, 6 May 2023 10:16:00 -0700 Subject: [PATCH] docs for azure (#4238) --- .../integrations/azure_openai_example.ipynb | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/docs/modules/models/llms/integrations/azure_openai_example.ipynb b/docs/modules/models/llms/integrations/azure_openai_example.ipynb index 19cb9a33..66a262ff 100644 --- a/docs/modules/models/llms/integrations/azure_openai_example.ipynb +++ b/docs/modules/models/llms/integrations/azure_openai_example.ipynb @@ -63,7 +63,21 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 3, + "id": "faacfa54", + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "os.environ[\"OPENAI_API_TYPE\"] = \"azure\"\n", + "os.environ[\"OPENAI_API_VERSION\"] = \"2022-12-01\"\n", + "os.environ[\"OPENAI_API_BASE\"] = \"...\"\n", + "os.environ[\"OPENAI_API_KEY\"] = \"...\"" + ] + }, + { + "cell_type": "code", + "execution_count": 4, "id": "8fad2a6e", "metadata": {}, "outputs": [], @@ -74,29 +88,32 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 5, "id": "8c80213a", "metadata": {}, "outputs": [], "source": [ "# Create an instance of Azure OpenAI\n", "# Replace the deployment name with your own\n", - "llm = AzureOpenAI(deployment_name=\"text-davinci-002-prod\", model_name=\"text-davinci-002\")" + "llm = AzureOpenAI(\n", + " deployment_name=\"td2\",\n", + " model_name=\"text-davinci-002\", \n", + ")" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 6, "id": "592dc404", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'\\n\\nWhy did the chicken cross the road?\\n\\nTo get to the other side.'" + "\"\\n\\nWhy couldn't the bicycle stand up by itself? Because it was...two tired!\"" ] }, - "execution_count": 3, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -158,7 +175,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.9.1" }, "vscode": { "interpreter": {