跳到主要内容
Open In ColabOpen on GitHub

虚假嵌入

LangChain 也提供了一个虚假嵌入类。你可以使用它来测试你的管道。

from langchain_community.embeddings import FakeEmbeddings
API 参考:FakeEmbeddings
embeddings = FakeEmbeddings(size=1352)
query_result = embeddings.embed_query("foo")
doc_results = embeddings.embed_documents(["foo"])
© . This site is unofficial and not affiliated with LangChain, Inc.
这些文档随着 LangChain v1.0 在 2025 年 10 月的发布而弃用,并且不再维护。 请访问 v1.0 文档