Skip to main content
Open In ColabOpen on GitHub

AwaDB

AwaDB is an AI Native database for the search and storage of embedding vectors used by LLM Applications.

本笔记本解释了如何在 LangChain 中使用 AwaEmbeddings

# pip install awadb

导入库

from langchain_community.embeddings import AwaEmbeddings
API 参考:AwaEmbeddings
Embedding = AwaEmbeddings()

设置嵌入模型

用户可以使用Embedding.set_model()指定嵌入模型。
此函数的输入是一个字符串,表示模型的名称。
当前支持的模型列表可以通过以下方式获取。这里 \ \

默认模型是 0,无需设置即可使用。

text = "our embedding test"

Embedding.set_model("all-mpnet-base-v2")
res_query = Embedding.embed_query("The test information")
res_document = Embedding.embed_documents(["test1", "another test"])