You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/community/tests/integration_tests/embeddings/test_johnsnowlabs.py

21 lines
625 B
Python

"""Test johnsnowlabs embeddings."""
from langchain_community.embeddings.johnsnowlabs import JohnSnowLabsEmbeddings
def test_johnsnowlabs_embed_document() -> None:
"""Test johnsnowlabs embeddings."""
documents = ["foo bar", "bar foo"]
embedding = JohnSnowLabsEmbeddings()
output = embedding.embed_documents(documents)
assert len(output) == 2
assert len(output[0]) == 128
def test_johnsnowlabs_embed_query() -> None:
"""Test johnsnowlabs embeddings."""
document = "foo bar"
embedding = JohnSnowLabsEmbeddings()
output = embedding.embed_query(document)
assert len(output) == 128