mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
e65652c3e8
- **Description:** SambaNova hosted embeddings integration
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
|