Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harrison/jina #2043

Merged
merged 18 commits into from
Mar 28, 2023
Prev Previous commit
Next Next commit
fix: add unittest
  • Loading branch information
numb3r3 committed Mar 22, 2023
commit 920d384ec5eb3265e8564839a1276ed966a131c2
19 changes: 19 additions & 0 deletions tests/integration_tests/embeddings/test_jina.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Test jina embeddings."""
from langchain.embeddings.jina import JinaEmbeddings


def test_cohere_embedding_documents() -> None:
"""Test jina embeddings for documents."""
documents = ["foo bar"]
embedding = JinaEmbeddings()
output = embedding.embed_documents(documents)
assert len(output) == 1
assert len(output[0]) == 2048


def test_cohere_embedding_query() -> None:
"""Test jina embeddings for query."""
document = "foo bar"
embedding = JinaEmbeddings()
output = embedding.embed_query(document)
assert len(output) == 2048