mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-08 16:48:49 +00:00
23 lines
600 B
Python
23 lines
600 B
Python
"""Test SambaNova Embeddings."""
|
|
|
|
from langchain_community.embeddings.sambanova import (
|
|
SambaStudioEmbeddings,
|
|
)
|
|
|
|
|
|
def test_embedding_documents() -> None:
|
|
"""Test embeddings for documents."""
|
|
documents = ["foo", "bar"]
|
|
embedding = SambaStudioEmbeddings()
|
|
output = embedding.embed_documents(documents)
|
|
assert len(output) == 2
|
|
assert len(output[0]) == 1024
|
|
|
|
|
|
def test_embedding_query() -> None:
|
|
"""Test embeddings for query."""
|
|
document = "foo bar"
|
|
embedding = SambaStudioEmbeddings()
|
|
output = embedding.embed_query(document)
|
|
assert len(output) == 1024
|