This commit is contained in:
Yang Qiao (from Dev Box) 2024-11-07 12:21:44 +08:00
parent 4451b670dc
commit 99923f6fa9

View File

@ -223,7 +223,7 @@
" num_lists, dimensions, similarity_algorithm, kind, m, ef_construction\n",
")\n",
"\n",
"'''\n",
"\"\"\"\n",
"# DiskANN vectorstore\n",
"maxDegree = 40\n",
"dimensions = 1536\n",
@ -255,7 +255,7 @@
" m=m,\n",
" ef_construction=ef_construction,\n",
" )\n",
"'''"
"\"\"\""
]
},
{
@ -418,7 +418,9 @@
],
"source": [
"# create a filter index\n",
"vectorstore.create_filter_index(property_to_filter= \"metadata.source\", index_name='filter_index')"
"vectorstore.create_filter_index(\n",
" property_to_filter=\"metadata.source\", index_name=\"filter_index\"\n",
")"
]
},
{
@ -430,8 +432,7 @@
"source": [
"query = \"What did the president say about Ketanji Brown Jackson\"\n",
"docs = vectorstore.similarity_search(\n",
" query,\n",
" pre_filter= {\"metadata.source\": { \"$ne\": \"filter content\" } }\n",
" query, pre_filter={\"metadata.source\": {\"$ne\": \"filter content\"}}\n",
")"
]
},
@ -465,7 +466,7 @@
"source": [
"docs = vectorstore.similarity_search(\n",
" query,\n",
" pre_filter= {\"metadata.source\": { \"$ne\": \"../../how_to/state_of_the_union.txt\" } }\n",
" pre_filter={\"metadata.source\": {\"$ne\": \"../../how_to/state_of_the_union.txt\"}},\n",
")"
]
},