Fix flexible dimension and doc for DingoDB (#12187)

pull/12219/head
Hech 11 months ago committed by GitHub
parent 95ae40ff90
commit d76f026d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

File diff suppressed because one or more lines are too long

@ -1,14 +1,14 @@
# Dingo
# DingoDB
This page covers how to use the Dingo ecosystem within LangChain.
It is broken into two parts: installation and setup, and then references to specific Dingo wrappers.
This page covers how to use the DingoDB ecosystem within LangChain.
It is broken into two parts: installation and setup, and then references to specific DingoDB wrappers.
## Installation and Setup
- Install the Python SDK with `pip install dingodb`
## VectorStore
There exists a wrapper around Dingo indexes, allowing you to use it as a vectorstore,
There exists a wrapper around DingoDB indexes, allowing you to use it as a vectorstore,
whether for semantic search or example selection.
To import this vectorstore:
@ -16,4 +16,4 @@ To import this vectorstore:
from langchain.vectorstores import Dingo
```
For a more detailed walkthrough of the Dingo wrapper, see [this notebook](/docs/integrations/vectorstores/dingo.html)
For a more detailed walkthrough of the DingoDB wrapper, see [this notebook](/docs/integrations/vectorstores/dingo.html)

@ -5,9 +5,9 @@
"id": "683953b3",
"metadata": {},
"source": [
"# Dingo\n",
"# DingoDB\n",
"\n",
">[Dingo](https://dingodb.readthedocs.io/en/latest/) is a distributed multi-mode vector database, which combines the characteristics of data lakes and vector databases, and can store data of any type and size (Key-Value, PDF, audio, video, etc.). It has real-time low-latency processing capabilities to achieve rapid insight and response, and can efficiently conduct instant analysis and process multi-modal data.\n",
">[DingoDB](https://dingodb.readthedocs.io/en/latest/) is a distributed multi-mode vector database, which combines the characteristics of data lakes and vector databases, and can store data of any type and size (Key-Value, PDF, audio, video, etc.). It has real-time low-latency processing capabilities to achieve rapid insight and response, and can efficiently conduct instant analysis and process multi-modal data.\n",
"\n",
"This notebook shows how to use functionality related to the DingoDB vector database.\n",
"\n",

@ -36,6 +36,7 @@ class Dingo(VectorStore):
*,
client: Any = None,
index_name: Optional[str] = None,
dimension: int = 1024,
host: Optional[List[str]] = None,
user: str = "root",
password: str = "123123",
@ -67,9 +68,11 @@ class Dingo(VectorStore):
if index_name is not None and index_name not in dingo_client.get_index():
if self_id is True:
dingo_client.create_index(index_name, 1024, auto_id=False)
dingo_client.create_index(
index_name, dimension=dimension, auto_id=False
)
else:
dingo_client.create_index(index_name, 1024)
dingo_client.create_index(index_name, dimension=dimension)
self._index_name = index_name
self._embedding = embedding
@ -268,6 +271,7 @@ class Dingo(VectorStore):
ids: Optional[List[str]] = None,
text_key: str = "text",
index_name: Optional[str] = None,
dimension: int = 1024,
client: Any = None,
host: List[str] = ["172.20.31.10:13000"],
user: str = "root",
@ -315,11 +319,12 @@ class Dingo(VectorStore):
raise ValueError(f"Dingo failed to connect: {e}")
if kwargs is not None and kwargs.get("self_id") is True:
if index_name not in dingo_client.get_index():
dingo_client.create_index(index_name, 1024, auto_id=False)
dingo_client.create_index(
index_name, dimension=dimension, auto_id=False
)
else:
if index_name not in dingo_client.get_index():
dingo_client.create_index(index_name, 1024)
# dingo_client.create_index(index_name, 1024, index_type="hnsw")
dingo_client.create_index(index_name, dimension=dimension)
# Embed and create the documents

Loading…
Cancel
Save