fix: max_marginal_relevance_search and docs in Dingo (#9244)

This commit is contained in:
Hech
2023-08-15 16:06:06 +08:00
committed by GitHub
parent 664ff28cba
commit 4b505060bd
2 changed files with 25 additions and 13 deletions

View File

@@ -23,7 +23,9 @@
},
"outputs": [],
"source": [
"!pip install dingodb"
"!pip install dingodb\n",
"or install latest:\n",
"!pip install git+https://git@github.com/dingodb/pydingo.git"
]
},
{
@@ -107,7 +109,7 @@
"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",
" # we create a new index\n",
" # we create a new index, modify to your own\n",
" dingo_client.create_index(\n",
" index_name=index_name,\n",
" dimension=1536,\n",
@@ -150,7 +152,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(docs[0][1])"
"print(docs[0].page_content)"
]
},
{
@@ -170,9 +172,9 @@
"metadata": {},
"outputs": [],
"source": [
"vectorstore = Dingo(client, embeddings.embed_query, \"text\")\n",
"vectorstore = Dingo(embeddings, \"text\", client=dingo_client, index_name=index_name)\n",
"\n",
"vectorstore.add_texts(\"More text!\")"
"vectorstore.add_texts([\"More text!\"])"
]
},
{