Skip to content

Commit

Permalink
docs: Add partition parameter to DashVector (#19385)
Browse files Browse the repository at this point in the history
**Description**: Add `partition` parameter to DashVector
dashvector.ipynb
**Related PR**: #19023
**Twitter handle**: @CailinWang_

---------

Co-authored-by: root <root@Bluedot-AI>
  • Loading branch information
2 people authored and hinthornw committed Apr 26, 2024
1 parent 7750bf4 commit 1caced8
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions docs/docs/integrations/vectorstores/dashvector.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,41 @@
"print(docs)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Operating band `partition` parameters"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The `partition` parameter defaults to default, and if a non-existent `partition` parameter is passed in, the `partition` will be created automatically. "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": []
"source": [
"texts = [\"foo\", \"bar\", \"baz\"]\n",
"metadatas = [{\"key\": i} for i in range(len(texts))]\n",
"ids = [\"0\", \"1\", \"2\"]\n",
"partition = \"langchain\"\n",
"\n",
"# add texts\n",
"dashvector.add_texts(texts, metadatas=metadatas, ids=ids, partition=partition)\n",
"\n",
"# similarity search\n",
"query = \"What did the president say about Ketanji Brown Jackson\"\n",
"docs = dashvector.similarity_search(query, partition=partition)\n",
"\n",
"# delete\n",
"dashvector.delete(ids=ids, partition=partition)"
]
}
],
"metadata": {
Expand All @@ -228,7 +255,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.11.6"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 1caced8

Please sign in to comment.