Skip to content

Commit

Permalink
Python: added reference to AzureTextCompletion to notebook (#1456)
Browse files Browse the repository at this point in the history
### Motivation and Context
This is addressing issue#1455
#1455

### Description
In the second cell, I added the missing reference to Azure Text
Completion.

In the _Context Variables_ section, I updated the first cell to include
an option to run using Azure OpenAI (was missed previously). This
follows the same format as used in other cells.
  • Loading branch information
mathyousee authored Jun 14, 2023
1 parent aa5c02e commit d5de382
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions samples/notebooks/python/08-native-function-inline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"import os\n",
"import sys\n",
"import semantic_kernel as sk\n",
"from semantic_kernel.connectors.ai.open_ai import OpenAITextCompletion\n",
"from semantic_kernel.connectors.ai.open_ai import AzureTextCompletion, OpenAITextCompletion\n",
"\n",
"kernel = sk.Kernel()\n",
"\n",
Expand Down Expand Up @@ -218,12 +218,20 @@
"import os\n",
"import sys\n",
"import semantic_kernel as sk\n",
"from semantic_kernel.connectors.ai.open_ai import OpenAITextCompletion\n",
"from semantic_kernel.connectors.ai.open_ai import AzureTextCompletion, OpenAITextCompletion\n",
"\n",
"kernel = sk.Kernel()\n",
"\n",
"api_key, org_id = sk.openai_settings_from_dot_env()\n",
"kernel.add_text_completion_service(\"dv\", OpenAITextCompletion(\"text-davinci-003\", api_key, org_id))"
"\n",
"useAzureOpenAI = False\n",
"\n",
"# Configure AI service used by the kernel\n",
"if useAzureOpenAI:\n",
" deployment, api_key, endpoint = sk.azure_openai_settings_from_dot_env()\n",
" kernel.add_text_completion_service(\"dv\", AzureTextCompletion(deployment, endpoint, api_key))\n",
"else:\n",
" api_key, org_id = sk.openai_settings_from_dot_env()\n",
" kernel.add_text_completion_service(\"dv\", OpenAITextCompletion(\"text-davinci-003\", api_key, org_id))"
]
},
{
Expand Down

0 comments on commit d5de382

Please sign in to comment.