mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
20 lines
684 B
Python
20 lines
684 B
Python
"""Test Together embeddings."""
|
|
from langchain_together.embeddings import TogetherEmbeddings
|
|
|
|
|
|
def test_langchain_together_embedding_documents() -> None:
|
|
"""Test cohere embeddings."""
|
|
documents = ["foo bar"]
|
|
embedding = TogetherEmbeddings(model="togethercomputer/m2-bert-80M-8k-retrieval")
|
|
output = embedding.embed_documents(documents)
|
|
assert len(output) == 1
|
|
assert len(output[0]) > 0
|
|
|
|
|
|
def test_langchain_together_embedding_query() -> None:
|
|
"""Test cohere embeddings."""
|
|
document = "foo bar"
|
|
embedding = TogetherEmbeddings(model="togethercomputer/m2-bert-80M-8k-retrieval")
|
|
output = embedding.embed_query(document)
|
|
assert len(output) > 0
|