mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-02 11:39:18 +00:00
fix: max_marginal_relevance_search and docs in Dingo (#9244)
This commit is contained in:
@@ -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!\"])"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user