|
72 | 72 | "# \"ResourceId=/subscriptions/FAKE-SUBCRIPTION=ID/resourceGroups/FAKE-RESOURCE-GROUP/providers/Microsoft.Storage/storageAccounts/FAKE-ACCOUNT;\"" |
73 | 73 | ] |
74 | 74 | }, |
| 75 | + { |
| 76 | + "cell_type": "markdown", |
| 77 | + "metadata": {}, |
| 78 | + "source": [ |
| 79 | + "## Create a virtual environment\n", |
| 80 | + "\n", |
| 81 | + "Create a virtual environment so that you can install the dependencies in isolation.\n", |
| 82 | + "\n", |
| 83 | + "1. In Visual Studio Code, open the folder containing tutorial-rag.ipynb.\n", |
| 84 | + "\n", |
| 85 | + "1. Press Ctrl-shift-P to open the command palette, search for \"Python: Create Environment\", and then select `Venv` to create a virtual environment in the current workspace.\n", |
| 86 | + "\n", |
| 87 | + "1. Select Tutorial-RAG\\tutorial-rag-requirements.txt for the dependencies.\n", |
| 88 | + "\n", |
| 89 | + "It takes several minutes to create the environment. When the environment is ready, continue to the next step." |
| 90 | + ] |
| 91 | + }, |
75 | 92 | { |
76 | 93 | "cell_type": "markdown", |
77 | 94 | "metadata": {}, |
|
198 | 215 | " OutputFieldMappingEntry,\n", |
199 | 216 | " AzureOpenAIEmbeddingSkill,\n", |
200 | 217 | " EntityRecognitionSkill,\n", |
201 | | - " SearchIndexerIndexProjections,\n", |
| 218 | + " SearchIndexerIndexProjection,\n", |
202 | 219 | " SearchIndexerIndexProjectionSelector,\n", |
203 | 220 | " SearchIndexerIndexProjectionsParameters,\n", |
204 | 221 | " IndexProjectionMode,\n", |
|
226 | 243 | "embedding_skill = AzureOpenAIEmbeddingSkill( \n", |
227 | 244 | " description=\"Skill to generate embeddings via Azure OpenAI\", \n", |
228 | 245 | " context=\"/document/pages/*\", \n", |
229 | | - " resource_uri=AZURE_OPENAI_ACCOUNT, \n", |
230 | | - " deployment_id=\"text-embedding-ada-002\", \n", |
| 246 | + " resource_url=AZURE_OPENAI_ACCOUNT, \n", |
| 247 | + " deployment_name=\"text-embedding-ada-002\", \n", |
231 | 248 | " model_name=\"text-embedding-ada-002\",\n", |
232 | 249 | " dimensions=1536,\n", |
233 | 250 | " inputs=[ \n", |
|
251 | 268 | " ]\n", |
252 | 269 | ")\n", |
253 | 270 | " \n", |
254 | | - "index_projections = SearchIndexerIndexProjections( \n", |
| 271 | + "index_projections = SearchIndexerIndexProjection( \n", |
255 | 272 | " selectors=[ \n", |
256 | 273 | " SearchIndexerIndexProjectionSelector( \n", |
257 | 274 | " target_index_name=index_name, \n", |
|
278 | 295 | " name=skillset_name, \n", |
279 | 296 | " description=\"Skillset to chunk documents and generating embeddings\", \n", |
280 | 297 | " skills=skills, \n", |
281 | | - " index_projections=index_projections,\n", |
| 298 | + " index_projection=index_projections,\n", |
282 | 299 | " cognitive_services_account=cognitive_services_account\n", |
283 | 300 | ")\n", |
284 | 301 | " \n", |
|
345 | 362 | "from azure.search.documents.models import VectorizableTextQuery\n", |
346 | 363 | "\n", |
347 | 364 | "# Vector Search using text-to-vector conversion of the querystring\n", |
348 | | - "query = \"how much of earth is covered by water\" \n", |
| 365 | + "query = \"where are NASA's headquarters located?\" \n", |
349 | 366 | "\n", |
350 | 367 | "search_client = SearchClient(endpoint=AZURE_SEARCH_SERVICE, credential=AZURE_SEARCH_CREDENTIAL, index_name=index_name)\n", |
351 | 368 | "vector_query = VectorizableTextQuery(text=query, k_nearest_neighbors=1, fields=\"text_vector\", exhaustive=True)\n", |
|
0 commit comments