2023-07-28 00:08:00 +00:00
|
|
|
"""Test Awa Embedding"""
|
2023-12-11 21:53:30 +00:00
|
|
|
from langchain_community.embeddings.awa import AwaEmbeddings
|
2023-07-28 00:08:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_awa_embedding_documents() -> None:
|
|
|
|
"""Test Awa embeddings for documents."""
|
|
|
|
documents = ["foo bar", "test document"]
|
|
|
|
embedding = AwaEmbeddings()
|
|
|
|
output = embedding.embed_documents(documents)
|
|
|
|
assert len(output) == 2
|
|
|
|
assert len(output[0]) == 768
|
|
|
|
|
|
|
|
|
|
|
|
def test_awa_embedding_query() -> None:
|
|
|
|
"""Test Awa embeddings for query."""
|
|
|
|
document = "foo bar"
|
|
|
|
embedding = AwaEmbeddings()
|
|
|
|
output = embedding.embed_query(document)
|
|
|
|
assert len(output) == 768
|