mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
17e886388b
Co-authored-by: Lance Martin <lance@langchain.dev>
20 lines
619 B
Python
20 lines
619 B
Python
"""Test Nomic embeddings."""
|
|
from langchain_nomic.embeddings import NomicEmbeddings
|
|
|
|
|
|
def test_langchain_nomic_embedding_documents() -> None:
|
|
"""Test cohere embeddings."""
|
|
documents = ["foo bar"]
|
|
embedding = NomicEmbeddings(model="nomic-embed-text-v1")
|
|
output = embedding.embed_documents(documents)
|
|
assert len(output) == 1
|
|
assert len(output[0]) > 0
|
|
|
|
|
|
def test_langchain_nomic_embedding_query() -> None:
|
|
"""Test cohere embeddings."""
|
|
document = "foo bar"
|
|
embedding = NomicEmbeddings(model="nomic-embed-text-v1")
|
|
output = embedding.embed_query(document)
|
|
assert len(output) > 0
|