DashVector
DashVector 是一種完全託管的向量資料庫服務,支援高維度稠密和稀疏向量、即時插入和篩選搜尋。它旨在自動擴展,並能適應不同的應用程式需求。
本文檔示範如何在 LangChain 生態系統中利用 DashVector。特別是,它展示了如何安裝 DashVector,以及如何在 LangChain 中將其用作 VectorStore 插件。它分為兩個部分:安裝和設定,然後參考特定的 DashVector 包裝器。
安裝與設定
安裝 Python SDK
pip install dashvector
您必須擁有 API 金鑰。這是安裝說明。
嵌入模型
from langchain_community.embeddings import DashScopeEmbeddings
API 參考:DashScopeEmbeddings
請參閱使用範例。
向量資料庫
DashVector Collection 被封裝為熟悉的 VectorStore,以便在 LangChain 中原生使用,這使其可以輕鬆地用於各種場景,例如語義搜尋或範例選擇。
您可以透過以下方式匯入向量資料庫
from langchain_community.vectorstores import DashVector
API 參考:DashVector
有關 DashVector 包裝器的詳細演練,請參閱此筆記本