mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-12 12:59:07 +00:00
Harrison/tair (#3770)
Co-authored-by: Seth Huang <848849+seth-hg@users.noreply.github.com>
This commit is contained in:
15
tests/integration_tests/vectorstores/test_tair.py
Normal file
15
tests/integration_tests/vectorstores/test_tair.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""Test tair functionality."""
|
||||
|
||||
from langchain.docstore.document import Document
|
||||
from langchain.vectorstores.tair import Tair
|
||||
from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings
|
||||
|
||||
|
||||
def test_tair() -> None:
|
||||
"""Test end to end construction and search."""
|
||||
texts = ["foo", "bar", "baz"]
|
||||
docsearch = Tair.from_texts(
|
||||
texts, FakeEmbeddings(), tair_url="redis://localhost:6379"
|
||||
)
|
||||
output = docsearch.similarity_search("foo", k=1)
|
||||
assert output == [Document(page_content="foo")]
|
Reference in New Issue
Block a user