Here are the installation instructions.Install‚Äãpip install dashvector dashscopeWe want to use DashScopeEmbeddings so we also have to get the Dashscope API Key.import osimport getpassos.environ["DASHVECTOR_API_KEY"] = getpass.getpass("DashVector API Key:")os.environ["DASHSCOPE_API_KEY"] = getpass.getpass("DashScope API Key:")Example‚Äãfrom langchain.embeddings.dashscope import DashScopeEmbeddingsfrom langchain.text_splitter import CharacterTextSplitterfrom langchain.vectorstores import DashVectorfrom langchain.document_loaders import TextLoaderloader = TextLoader("../../modules/state_of_the_union.txt")documents = loader.load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)docs = text_splitter.split_documents(documents)embeddings = DashScopeEmbeddings()We can create DashVector from documents.dashvector = DashVector.from_documents(docs, embeddings)query = "What did the president say about Ketanji Brown Jackson"docs = dashvector.similarity_search(query)print(docs)We can add texts with meta datas and ids, and search with meta filter.texts = ["foo", "bar", "baz"]metadatas = [{"key": i} for i in range(len(texts))]ids = ["0", "1", "2"]dashvector.add_texts(texts, metadatas=metadatas, ids=ids)docs = dashvector.similarity_search("foo", filter="key = 2")print(docs)    [Document(page_content='baz', metadata={'key': 2})]PreviousClickHouseNextDingoInstallExampleCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
DashVector is a fully-managed vectorDB service that supports high-dimension dense and sparse vectors, real-time insertion and filtered search. It is built to scale automatically and can adapt to different application requirements.
DashVector is a fully-managed vectorDB service that supports high-dimension dense and sparse vectors, real-time insertion and filtered search. It is built to scale automatically and can adapt to different application requirements. ->: Here are the installation instructions.Install‚Äãpip install dashvector dashscopeWe want to use DashScopeEmbeddings so we also have to get the Dashscope API Key.import osimport getpassos.environ["DASHVECTOR_API_KEY"] = getpass.getpass("DashVector API Key:")os.environ["DASHSCOPE_API_KEY"] = getpass.getpass("DashScope API Key:")Example‚Äãfrom langchain.embeddings.dashscope import DashScopeEmbeddingsfrom langchain.text_splitter import CharacterTextSplitterfrom langchain.vectorstores import DashVectorfrom langchain.document_loaders import TextLoaderloader = TextLoader("../../modules/state_of_the_union.txt")documents = loader.load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)docs = text_splitter.split_documents(documents)embeddings = DashScopeEmbeddings()We can create DashVector from documents.dashvector = DashVector.from_documents(docs, embeddings)query = "What did the president say about Ketanji Brown Jackson"docs = dashvector.similarity_search(query)print(docs)We can add texts with meta datas and ids, and search with meta filter.texts = ["foo", "bar", "baz"]metadatas = [{"key": i} for i in range(len(texts))]ids = ["0", "1", "2"]dashvector.add_texts(texts, metadatas=metadatas, ids=ids)docs = dashvector.similarity_search("foo", filter="key = 2")print(docs)    [Document(page_content='baz', metadata={'key': 2})]PreviousClickHouseNextDingoInstallExampleCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.