Skip to content

Commit e6cfc42

Browse files
committed
RAG quickstart updates
1 parent b81395f commit e6cfc42

File tree

1 file changed

+16
-39
lines changed

1 file changed

+16
-39
lines changed

Quickstart-RAG/Quickstart-rag.ipynb

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# RAG Quickstart for Azure AI Search\n",
88
"\n",
9-
"This quickstart provides a query for RAG scenarios. It demonstrates a approach for grounding chat queries with data in a search index on Azure AI Search.\n",
9+
"This quickstart provides a query for RAG scenarios. It demonstrates an approach for grounding chat queries with data in a search index on Azure AI Search.\n",
1010
"\n",
1111
"We took a few shortcuts to keep the exercise basic and focused on query definitions:\n",
1212
"\n",
@@ -24,23 +24,13 @@
2424
"source": [
2525
"## Prerequisites\n",
2626
"\n",
27-
"- Azure AI Search, any tier\n",
27+
"- Azure AI Search, Basic tier or higher is recommended. Enable semantic ranking and role-based access control.\n",
2828
"\n",
29-
"- Azure OpenAI, in the same region as Azure AI Search\n",
29+
"- Azure OpenAI, in the same region as Azure AI Search. Configure Azure OpenAI to use a system managed identity.\n",
3030
"\n",
31-
"- Deployment GPT-3.5-Turbo, GPT-4, or equivalent LLM\n",
31+
"- Deployment GPT-3.5-Turbo, GPT-4, or equivalent LLM.\n",
3232
"\n",
33-
"### Configuration requirements\n",
34-
"\n",
35-
"Use the Azure portal for these steps.\n",
36-
"\n",
37-
"1. Configure Azure OpenAI to use a system-assigned managed identity.\n",
38-
"\n",
39-
"1. Configure Azure AI Search to use a system-assigned managed identity.\n",
40-
"\n",
41-
"1. Create the hotels-sample-index using the Import data wizard.\n",
42-
"\n",
43-
"1. Add a semantic configuration named \"semantic-config\" and make it the default configuration:\n",
33+
"- Create the hotels-sample-index using [this quickstart](https://learn.microsoft.com/azure/search/search-get-started-portal), and then modify it to use this semantic configuration:\n",
4434
" \n",
4535
" ```json\n",
4636
" \"semantic\": {\n",
@@ -58,14 +48,14 @@
5848
" }]},\n",
5949
" ```\n",
6050
"\n",
61-
"1. On Azure AI Search, create a role assignment for the Azure OpenAI managed identity. Required roles: Search Index Data Reader, Search Service Contributor.\n",
51+
"- On Azure AI Search, create a role assignment for the Azure OpenAI managed identity. Required roles: Search Index Data Reader, Search Service Contributor.\n",
6252
"\n",
63-
"1. On Azure OpenAI, create a role assigmnet for the user running the code: Required role: Cognitive Services OpenAI User."
53+
"- On Azure OpenAI, create a role assigmnet for the user running the code: Required role: Cognitive Services OpenAI User."
6454
]
6555
},
6656
{
6757
"cell_type": "code",
68-
"execution_count": 1,
58+
"execution_count": null,
6959
"metadata": {},
7060
"outputs": [],
7161
"source": [
@@ -77,7 +67,7 @@
7767
},
7868
{
7969
"cell_type": "code",
80-
"execution_count": 2,
70+
"execution_count": null,
8171
"metadata": {},
8272
"outputs": [],
8373
"source": [
@@ -89,7 +79,7 @@
8979
},
9080
{
9181
"cell_type": "code",
92-
"execution_count": 3,
82+
"execution_count": null,
9383
"metadata": {},
9484
"outputs": [],
9585
"source": [
@@ -102,11 +92,11 @@
10292
},
10393
{
10494
"cell_type": "code",
105-
"execution_count": 11,
95+
"execution_count": null,
10696
"metadata": {},
10797
"outputs": [],
10898
"source": [
109-
"# Set up the query for generating responses\n",
99+
"# Set up the clients, define a chat instance, create a search function\n",
110100
"from azure.core.credentials_async import AsyncTokenCredential\n",
111101
"from azure.identity.aio import get_bearer_token_provider\n",
112102
"from azure.search.documents.aio import SearchClient\n",
@@ -131,7 +121,7 @@
131121
" credential=credential\n",
132122
" )\n",
133123
"\n",
134-
"# This quickstart is only using text at the moment\n",
124+
"# This quickstart is only using text at this time\n",
135125
"class SearchType(Enum):\n",
136126
" TEXT = \"text\"\n",
137127
" VECTOR = \"vector\"\n",
@@ -197,24 +187,11 @@
197187
},
198188
{
199189
"cell_type": "code",
200-
"execution_count": 12,
190+
"execution_count": null,
201191
"metadata": {},
202-
"outputs": [
203-
{
204-
"name": "stdout",
205-
"output_type": "stream",
206-
"text": [
207-
"Based on your request, here are a few hotel recommendations with beach access and good views:\n",
208-
"\n",
209-
"1. Ocean Air Motel - oceanfront hotel with a private balcony and indoor and outdoor pools\n",
210-
"2. Marquis Plaza & Suites - offers a view, free Wi-Fi, and a pool\n",
211-
"3. Pull'r Inn Motel - offers a view, a pool, and free Wi-Fi\n",
212-
"\n",
213-
"I hope this helps! Let me know if you need any further assistance.\n"
214-
]
215-
}
216-
],
192+
"outputs": [],
217193
"source": [
194+
"# Instantiate the chat thread and run the conversation\n",
218195
"import azure.identity.aio\n",
219196
"\n",
220197
"chat_thread = ChatThread()\n",

0 commit comments

Comments
 (0)