Skip to content

Commit

Permalink
Add embedding integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: B-Step62 <[email protected]>
  • Loading branch information
B-Step62 committed Sep 23, 2024
1 parent 08fd0c8 commit 8b243b0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions libs/databricks/tests/integration_tests/test_embeddings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from langchain_databricks import DatabricksEmbeddings

_TEST_ENDPOINT = "databricks-bge-large-en"

def test_embedding_documents() -> None:
documents = ["foo bar"]
embedding = DatabricksEmbeddings(endpoint=_TEST_ENDPOINT)
output = embedding.embed_documents(documents)
assert len(output) == 1
assert len(output[0]) > 0


def test_embedding_query() -> None:
document = "foo bar"
embedding = DatabricksEmbeddings(endpoint=_TEST_ENDPOINT)
output = embedding.embed_query(document)
assert len(output) > 0

0 comments on commit 8b243b0

Please sign in to comment.