Skip to content

The agent engineering platform.

huggingface[patch]: add integration tests for embeddings (#26272)

ccurme979232257be6
diff --git a/libs/partners/huggingface/tests/integration_tests/test_embeddings_standard.py b/libs/partners/huggingface/tests/integration_tests/test_embeddings_standard.py
new file mode 100644
index 0000000000..4f5cefcbdf
--- /dev/null
+++ b/libs/partners/huggingface/tests/integration_tests/test_embeddings_standard.py
@@ -0,0 +1,30 @@
+"""Test HuggingFace embeddings."""
+
+from typing import Type
+
+from langchain_standard_tests.integration_tests import EmbeddingsIntegrationTests
+
+from langchain_huggingface.embeddings import (
+ HuggingFaceEmbeddings,
+ HuggingFaceEndpointEmbeddings,
+)
+
+
+class TestHuggingFaceEmbeddings(EmbeddingsIntegrationTests):
+ @property
+ def embeddings_class(self) -> Type[HuggingFaceEmbeddings]:
+ return HuggingFaceEmbeddings
+
+ @property
+ def embedding_model_params(self) -> dict:
+ return {"model_name": "sentence-transformers/all-mpnet-base-v2"}
+
+
+class TestHuggingFaceEndpointEmbeddings(EmbeddingsIntegrationTests):
+ @property
+ def embeddings_class(self) -> Type[HuggingFaceEndpointEmbeddings]:
+ return HuggingFaceEndpointEmbeddings
+
+ @property
+ def embedding_model_params(self) -> dict:
+ return {"model": "sentence-transformers/all-mpnet-base-v2"}