跳到主要内容
AwaDB 是一个 AI 原生数据库,用于搜索和存储 LLM 应用程序使用的嵌入向量。
本笔记本解释了如何在 LangChain 中使用 AwaEmbeddings
# pip install awadb

导入库

from langchain_community.embeddings import AwaEmbeddings
Embedding = AwaEmbeddings()

设置嵌入模型

用户可以使用 Embedding.set_model() 来指定嵌入模型。
此函数的输入是一个字符串,表示模型的名称。
目前支持的模型列表可以在这里获取。
默认模型all-mpnet-base-v2,无需设置即可使用。
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"])

以编程方式连接这些文档到 Claude、VSCode 等,通过 MCP 获取实时答案。
© . This site is unofficial and not affiliated with LangChain, Inc.