langchain/libs/community/tests/integration_tests/embeddings/test_volcano.py
Hin 2cf1e73d12
Feat add volcano embedding (#14693)
Description: Volcano Ark is an enterprise-grade large-model service
platform for developers, providing a full range of functions and
services such as model training, inference, evaluation, fine-tuning. You
can visit its homepage at https://www.volcengine.com/docs/82379/1099455
for details. This change could help developers use the platform for
embedding.
Issue: None
Dependencies: volcengine
Tag maintainer: @baskaryan
Twitter handle: @hinnnnnnnnnnnns

---------

Co-authored-by: lujingxuansc <lujingxuansc@bytedance.com>
2024-01-01 14:37:35 -08:00

20 lines
575 B
Python

"""Test Bytedance Volcano Embedding."""
from langchain_community.embeddings import VolcanoEmbeddings
def test_embedding_documents() -> None:
"""Test embeddings for documents."""
documents = ["foo", "bar"]
embedding = VolcanoEmbeddings()
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 = VolcanoEmbeddings()
output = embedding.embed_query(document)
assert len(output) == 1024