Fix return metadata when searching for DingoDB (#12937)

This commit is contained in:
Hech
2023-11-06 23:35:36 +08:00
committed by GitHub
parent ada3d2cbd1
commit 8fe6bcc662
2 changed files with 19 additions and 6 deletions

View File

@@ -104,11 +104,11 @@
"source": [
"from dingodb import DingoDB\n",
"\n",
"index_name = \"langchain-demo\"\n",
"index_name = \"langchain_demo\"\n",
"\n",
"dingo_client = DingoDB(user=\"\", password=\"\", host=[\"127.0.0.1:13000\"])\n",
"# First, check if our index already exists. If it doesn't, we create it\n",
"if index_name not in dingo_client.get_index():\n",
"if index_name not in dingo_client.get_index() and index_name.upper() not in dingo_client.get_index():\n",
" # we create a new index, modify to your own\n",
" dingo_client.create_index(\n",
" index_name=index_name, dimension=1536, metric_type=\"cosine\", auto_id=False\n",