Skip to content

Commit 6ac5128

Browse files
committed
Update lab_0_explore_and_use_models.ipynb
1 parent 10438b7 commit 6ac5128

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

Labs/lab_0_explore_and_use_models.ipynb

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,18 @@
5252
"cell_type": "markdown",
5353
"metadata": {},
5454
"source": [
55-
"When using the OpenAI client library, the `key` and `endpoint` for the Azure OpenAI service will be needed. This will enable the application to make API calls against the Azure OpenAI service.\n",
55+
"When using the OpenAI client library, the Azure OpenAI `key` and `endpoint` for the service are needed. In this case, ensure the Azure OpenAI `key` and `endpoint` is located in a `.env` file in the root of this project, you will need to create this file. The `.env` file should contain the following values (replace the value with your own `key` and `endpoint`):\n",
5656
"\n",
57-
"It is helpful to set these as environment variables, then reference those environment variables from code.\n",
57+
"AOAI_ENDPOINT = \"https://<resource>.openai.azure.com/\"\n",
5858
"\n",
59-
"Here's an example of this using the recommended environment variable names:\n",
60-
"\n",
61-
"```bash\n",
62-
"// Azure OpenAI Key\n",
63-
"export AOAI_KEY=\"REPLACE_WITH_YOUR_KEY_VALUE_HERE\"\n",
64-
"// Azure OpenAI Endpoint\n",
65-
"export AOAI_ENDPOINT=\"REPLACE_WITH_YOUR_ENDPOINT_HERE\"\n",
66-
"```"
59+
"AOAI_KEY = \"<key>\"\n"
6760
]
6861
},
6962
{
7063
"cell_type": "markdown",
7164
"metadata": {},
7265
"source": [
73-
"Include the following imports in the python code so the app can use the OpenAI library, as well as `os` to access the environment variables."
66+
"The following imports are neded in python so the app can use the OpenAI library, as well as `os` to access the environment variables, and `dotenv` is used here to load environment variables from the `.env` file."
7467
]
7568
},
7669
{
@@ -119,6 +112,13 @@
119112
")"
120113
]
121114
},
115+
{
116+
"cell_type": "markdown",
117+
"metadata": {},
118+
"source": [
119+
"> **Note**: The `api_version` is included to specify the API version for calls to the Azure OpenAI service."
120+
]
121+
},
122122
{
123123
"cell_type": "markdown",
124124
"metadata": {},
@@ -152,6 +152,13 @@
152152
"\n",
153153
"print(chatResponse.choices[0].message.content)"
154154
]
155+
},
156+
{
157+
"cell_type": "markdown",
158+
"metadata": {},
159+
"source": [
160+
"> **Note**: The [`openai` Python library documentation](https://platform.openai.com/docs/guides/text-generation/chat-completions-api) has further information on making Chat Completion calls to the service."
161+
]
155162
}
156163
],
157164
"metadata": {

0 commit comments

Comments
 (0)