Skip to main content

AwaDB

AwaDB 是一个用于LLM应用程序的嵌入向量搜索和存储的AI原生数据库。

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

# pip install awadb

导入库

<!--IMPORTS:[{"imported": "AwaEmbeddings", "source": "langchain_community.embeddings", "docs": "https://python.langchain.com/api_reference/community/embeddings/langchain_community.embeddings.awa.AwaEmbeddings.html", "title": "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"])

相关


Was this page helpful?


You can also leave detailed feedback on GitHub.

扫我,入群扫我,找书