mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-10 21:35:08 +00:00
## Description - Responding to `NCP API Key` changes. - To fix `ChatClovaX` `astream` function to raise `SSEError` when an error event occurs. - To add `token length` and `ai_filter` to ChatClovaX's `response_metadata`. - To update document for apply NCP API Key changes. cc. @efriis @vbarda
38 lines
1020 B
Python
38 lines
1020 B
Python
"""Test Naver embeddings."""
|
|
|
|
from langchain_community.embeddings import ClovaXEmbeddings
|
|
|
|
|
|
def test_embedding_documents() -> None:
|
|
"""Test ClovaX embeddings."""
|
|
documents = ["foo bar"]
|
|
embedding = ClovaXEmbeddings()
|
|
output = embedding.embed_documents(documents)
|
|
assert len(output) == 1
|
|
assert len(output[0]) > 0
|
|
|
|
|
|
async def test_aembedding_documents() -> None:
|
|
"""Test ClovaX embeddings."""
|
|
documents = ["foo bar"]
|
|
embedding = ClovaXEmbeddings()
|
|
output = await embedding.aembed_documents(documents)
|
|
assert len(output) == 1
|
|
assert len(output[0]) > 0
|
|
|
|
|
|
def test_embedding_query() -> None:
|
|
"""Test ClovaX embeddings."""
|
|
document = "foo bar"
|
|
embedding = ClovaXEmbeddings()
|
|
output = embedding.embed_query(document)
|
|
assert len(output) > 0
|
|
|
|
|
|
async def test_aembedding_query() -> None:
|
|
"""Test ClovaX embeddings."""
|
|
document = "foo bar"
|
|
embedding = ClovaXEmbeddings()
|
|
output = await embedding.aembed_query(document)
|
|
assert len(output) > 0
|