Skip to content

Commit f16f1da

Browse files
authored
Merge pull request #117 from HeidiSteen/main
Revised set up steps
2 parents 655e501 + 2e690f9 commit f16f1da

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

Quickstart-RAG/Quickstart-rag.ipynb

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
"source": [
77
"# RAG Quickstart for Azure AI Search\n",
88
"\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",
9+
"This quickstart provides a query for RAG scenarios. It demonstrates an approach for a chat experience using grounding data from 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",
1313
"- We use the hotels-sample-index, which can be created in minutes and runs on any search service tier. This index is created by a wizard using built-in sample data.\n",
1414
"\n",
15-
"- We omit vectors so that we can skip chunking and embedding.\n",
15+
"- We omit vectors so that we can skip chunking and embedding. The index contains plain text.\n",
1616
"\n",
1717
"Once you understand the fundamentals of integrating queries from Azure AI Search to an LLM, you can build on that experience by adding vector fields and vector and hybrid queries. We recommend the [phi-chat Python code example](https://github.com/Azure/azure-search-vector-samples/blob/main/demo-python/code/phi-chat/phi-chat.ipynb) for that step.\n",
1818
"\n",
19-
"This quickstart is documented in [Quickstart: Generative search (RAG) with grounding data from Azure AI Search](https://learn.microsoft.com/azure/search/search-get-started-rag). If you need more guidance than the readme provides, please refer to the article.\n"
19+
"This example is fully documented in [Quickstart: Generative search (RAG) with grounding data from Azure AI Search](https://learn.microsoft.com/azure/search/search-get-started-rag). If you need more guidance than the readme provides, please refer to the article.\n"
2020
]
2121
},
2222
{
@@ -27,7 +27,6 @@
2727
"\n",
2828
"- [Azure OpenAI](https://learn.microsoft.com/azure/ai-services/openai/how-to/create-resource)\n",
2929
"\n",
30-
" - Configure Azure OpenAI to use a system managed identity.\n",
3130
" - Deploy a chat model (GPT-3.5-Turbo, GPT-4, or equivalent LLM).\n",
3231
"\n",
3332
"- [Azure AI Search](https://learn.microsoft.com/azure/search/search-create-service-portal)\n",
@@ -36,14 +35,20 @@
3635
" - Choose the same region as Azure OpenAI.\n",
3736
" - Enable semantic ranking.\n",
3837
" - Enable role-based access control.\n",
38+
" - Enable a system identity for Azure AI Search.\n",
39+
" \n",
40+
"Make sure you know the name of the deployed model, and have the endpoints for both Azure resources at hand. You will provide this information in the steps that follow.\n",
3941
"\n",
4042
"## Configure access\n",
4143
"\n",
4244
"This quickstart assumes authentication and authorization using Microsoft Entra ID and role assignments. It also assumes that you run this code from your local device.\n",
4345
"\n",
44-
"1. To create and load the sample index on Azure AI Search, you must have role assignments for: **Search Index Data Reader**, **Search Index Data Contributor**, **Search Service Contributor**.\n",
46+
"1. To create, load, and query the sample index on Azure AI Search, you must personally have role assignments for: **Search Index Data Reader**, **Search Index Data Contributor**, **Search Service Contributor**.\n",
47+
"\n",
48+
"1. To send the query and search results to Azure OpenAI, both you and the search system identity must have **Cognitive Services OpenAI User** permissions on Azure OpenAI.\n",
4549
"\n",
46-
"1. To send the query and results from the search engine to Azure OpenAI, the search system identity must have **Cognitive Services OpenAI User** permissions on Azure OpenAI.\n",
50+
" - Queries in the system prompt are sent from your local system, which is why you need permissions on Azure OpenAI.\n",
51+
" - Results used for grounding data are sent from the search engine, which is why the search service needs permissions on Azure OpenAI.\n",
4752
"\n",
4853
"## Create the sample index\n",
4954
"\n",
@@ -85,7 +90,7 @@
8590
},
8691
{
8792
"cell_type": "code",
88-
"execution_count": 6,
93+
"execution_count": 20,
8994
"metadata": {},
9095
"outputs": [],
9196
"source": [
@@ -95,19 +100,19 @@
95100
},
96101
{
97102
"cell_type": "code",
98-
"execution_count": 7,
103+
"execution_count": 22,
99104
"metadata": {},
100105
"outputs": [],
101106
"source": [
102107
"# Set endpoints and deployment model (provide the name of the deployment)\n",
103-
" AZURE_SEARCH_SERVICE: str = \"PUT YOUR SEARCH SERVICE ENDPOINT HERE\"\n",
104-
" AZURE_OPENAI_ACCOUNT: str = \"PUT YOUR AZURE OPENAI ENDPOINT HERE\"\n",
105-
" AZURE_DEPLOYMENT_MODEL: str = \"gpt-35-turbo\""
108+
"AZURE_SEARCH_SERVICE: str = \"PUT YOUR SEARCH SERVICE ENDPOINT HERE\"\n",
109+
"AZURE_OPENAI_ACCOUNT: str = \"PUT YOUR AZURE OPENAI ENDPOINT HERE\"\n",
110+
"AZURE_DEPLOYMENT_MODEL: str = \"gpt-35-turbo\""
106111
]
107112
},
108113
{
109114
"cell_type": "code",
110-
"execution_count": 8,
115+
"execution_count": 23,
111116
"metadata": {},
112117
"outputs": [],
113118
"source": [
@@ -119,7 +124,7 @@
119124
},
120125
{
121126
"cell_type": "code",
122-
"execution_count": 16,
127+
"execution_count": 24,
123128
"metadata": {},
124129
"outputs": [],
125130
"source": [
@@ -212,18 +217,18 @@
212217
},
213218
{
214219
"cell_type": "code",
215-
"execution_count": 19,
220+
"execution_count": 28,
216221
"metadata": {},
217222
"outputs": [
218223
{
219224
"name": "stdout",
220225
"output_type": "stream",
221226
"text": [
222-
"Based on your preferences, I recommend the following hotels: \n",
227+
"Based on your preferences, I recommend the following hotels:\n",
223228
"\n",
224-
"- Ocean Air Motel: This hotel is oceanfront with beach access, two pools, and a private balcony with ocean views. \n",
225-
"- Marquis Plaza & Suites: This hotel has a view of the ocean and amenities like free Wi-Fi, a full kitchen, and a free breakfast buffet. \n",
226-
"- Trails End Motel: Though not directly on the ocean, this hotel does have a view and is only 8 miles from downtown. Amenities include an on-site bar/restaurant, free hot breakfast buffet, and free Wi-Fi.\n"
229+
"- Ocean Air Motel: This oceanfront hotel overlooks the beach and features rooms with private balconies, 2 indoor and outdoor pools, and it's located steps away from various shops and entertainment on the boardwalk.\n",
230+
"- Marquis Plaza & Suites: Offering views of the ocean and amenities like free Wi-Fi, a full kitchen, and a free breakfast buffet, this hotel is a great option for those who want to spend a day at the aquarium and then come home to relax.\n",
231+
"- Trails End Motel: Although not directly on the ocean, this non-smoking hotel offers great views, an on-site bar/restaurant, a hot breakfast buffet, and free wireless internet. Only 8 miles from downtown and 15 miles from the airport, it's a convenient choice.\n"
227232
]
228233
}
229234
],

0 commit comments

Comments
 (0)