forked from Archives/langchain
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.
20 lines
560 B
Python
20 lines
560 B
Python
2 years ago
|
"""Test cohere embeddings."""
|
||
|
from langchain.embeddings.cohere import CohereEmbeddings
|
||
|
|
||
|
|
||
|
def test_cohere_embedding_documents() -> None:
|
||
|
"""Test cohere embeddings."""
|
||
|
documents = ["foo bar"]
|
||
|
embedding = CohereEmbeddings()
|
||
|
output = embedding.embed_documents(documents)
|
||
|
assert len(output) == 1
|
||
|
assert len(output[0]) == 2048
|
||
|
|
||
|
|
||
|
def test_cohere_embedding_query() -> None:
|
||
|
"""Test cohere embeddings."""
|
||
|
document = "foo bar"
|
||
|
embedding = CohereEmbeddings()
|
||
|
output = embedding.embed_query(document)
|
||
|
assert len(output) == 2048
|