Skip to content

Commit ace770d

Browse files
committed
Vector query fix in RAG tutorial
1 parent 4c5e538 commit ace770d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Tutorial-RAG/Tutorial-rag.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,14 +559,17 @@
559559
"\"\"\"\n",
560560
"\n",
561561
"# Provide the query. Notice it's sent to both the search engine and the LLM.\n",
562+
"# The query sent to the search engine is hybrid. Keyword search on \"query\". Text-to-vector conversion for vector search.\n",
562563
"query=\"how much of earth is covered by water\"\n",
564+
"vector_query = VectorizableTextQuery(text=query, k_nearest_neighbors=1, fields=\"text_vector\", exhaustive=True)\n",
563565
"\n",
564566
"# Set up the search results and the chat thread.\n",
565567
"# Retrieve the selected fields from the search index related to the question.\n",
566568
"search_results = search_client.search(\n",
567569
" search_text=query,\n",
570+
" vector_queries= [vector_query],\n",
571+
" select=\"title, chunk, locations\",\n",
568572
" top=1,\n",
569-
" select=\"title, chunk, locations\"\n",
570573
")\n",
571574
"sources_formatted = \"\\n\".join([f'{document[\"title\"]}:{document[\"chunk\"]}:{document[\"locations\"]}' for document in search_results])\n",
572575
"\n",

0 commit comments

Comments
 (0)