跳到主要內容

偽造嵌入 (Fake Embeddings)

LangChain 也提供一個偽造嵌入類別。您可以使用它來測試您的管線。(LangChain also provides a fake embedding class. You can use this to test your pipelines.)

from langchain_community.embeddings import FakeEmbeddings
API 參考:FakeEmbeddings
embeddings = FakeEmbeddings(size=1352)
query_result = embeddings.embed_query("foo")
doc_results = embeddings.embed_documents(["foo"])

這個頁面有幫助嗎? (Was this page helpful?)