mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-08 22:42:05 +00:00
community: add SambaNova embeddings integration (#21227)
- **Description:** SambaNova hosted embeddings integration
This commit is contained in:
committed by
GitHub
parent
df1c10260c
commit
e65652c3e8
@@ -0,0 +1,22 @@
|
||||
"""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
|
Reference in New Issue
Block a user