langchain/libs/community/tests/integration_tests/embeddings/test_sambanova.py
Jorge Piedrahita Ortiz e65652c3e8
community: add SambaNova embeddings integration (#21227)
- **Description:**  SambaNova hosted embeddings integration
2024-05-06 13:29:59 -07:00

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