Skip to content

The agent engineering platform.

docs: Add `partition` parameter to DashVector (#19385)

Cailin Wang5402aef32ef4
diff --git a/docs/docs/integrations/vectorstores/dashvector.ipynb b/docs/docs/integrations/vectorstores/dashvector.ipynb
index 7ad14a0f78..1694ca2ae2 100644
--- a/docs/docs/integrations/vectorstores/dashvector.ipynb
+++ b/docs/docs/integrations/vectorstores/dashvector.ipynb
@@ -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": {
@@ -228,7 +255,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.10.4"
+ "version": "3.11.6"
}
},
"nbformat": 4,