diff --git a/libs/community/langchain_community/embeddings/__init__.py b/libs/community/langchain_community/embeddings/__init__.py index 9f957f2f6fcb2..d786a2fc1e7b8 100644 --- a/libs/community/langchain_community/embeddings/__init__.py +++ b/libs/community/langchain_community/embeddings/__init__.py @@ -185,12 +185,12 @@ from langchain_community.embeddings.ovhcloud import ( OVHCloudEmbeddings, ) - from langchain_community.embeddings.premai import ( - PremAIEmbeddings, - ) from langchain_community.embeddings.predictionguard import ( PredictionGuardEmbeddings, ) + from langchain_community.embeddings.premai import ( + PremAIEmbeddings, + ) from langchain_community.embeddings.sagemaker_endpoint import ( SagemakerEndpointEmbeddings, ) @@ -304,6 +304,7 @@ "OpenVINOEmbeddings", "OracleEmbeddings", "OVHCloudEmbeddings", + "PredictionGuardEmbeddings", "PremAIEmbeddings", "QianfanEmbeddingsEndpoint", "QuantizedBgeEmbeddings", @@ -390,6 +391,7 @@ "QuantizedBiEncoderEmbeddings": "langchain_community.embeddings.optimum_intel", "OracleEmbeddings": "langchain_community.embeddings.oracleai", "OVHCloudEmbeddings": "langchain_community.embeddings.ovhcloud", + "PredictionGuardEmbeddings": "langchain_community.embeddings.predictionguard", "SagemakerEndpointEmbeddings": "langchain_community.embeddings.sagemaker_endpoint", "SambaStudioEmbeddings": "langchain_community.embeddings.sambanova", "SelfHostedEmbeddings": "langchain_community.embeddings.self_hosted", diff --git a/libs/community/langchain_community/embeddings/predictionguard.py b/libs/community/langchain_community/embeddings/predictionguard.py index 04ff8d56c12a0..58edecb9adff8 100644 --- a/libs/community/langchain_community/embeddings/predictionguard.py +++ b/libs/community/langchain_community/embeddings/predictionguard.py @@ -156,4 +156,4 @@ def embed_image_text(self, inputs: List[Dict[str, str]]) -> List[float]: else: continue - return res \ No newline at end of file + return res diff --git a/libs/community/tests/integration_tests/embeddings/test_predictionguard.py b/libs/community/tests/integration_tests/embeddings/test_predictionguard.py index 2c43898a65b29..419923a975d26 100644 --- a/libs/community/tests/integration_tests/embeddings/test_predictionguard.py +++ b/libs/community/tests/integration_tests/embeddings/test_predictionguard.py @@ -38,7 +38,7 @@ def test_predictionguard_embeddings_images() -> None: """Test Prediction Guard embeddings.""" embeddings = PredictionGuardEmbeddings(model="bridgetower-large-itm-mlm-itc") image = [ - "https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png", + "https://fastly.picsum.photos/id/866/200/300.jpg?hmac=rcadCENKh4rD6MAp6V_ma-AyWv641M4iiOpe1RyFHeI", ] output = embeddings.embed_images(image) assert len(output) == 1 @@ -49,7 +49,7 @@ def test_predictionguard_embeddings_images_multiple() -> None: embeddings = PredictionGuardEmbeddings(model="bridgetower-large-itm-mlm-itc") images = [ "https://farm4.staticflickr.com/3300/3497460990_11dfb95dd1_z.jpg", - "https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png", + "https://fastly.picsum.photos/id/866/200/300.jpg?hmac=rcadCENKh4rD6MAp6V_ma-AyWv641M4iiOpe1RyFHeI", ] output = embeddings.embed_images(images) assert len(output) == 2 @@ -61,7 +61,7 @@ def test_predictionguard_embeddings_image_text() -> None: inputs = [ { "text": "embed me", - "image": "https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png", + "image": "https://fastly.picsum.photos/id/866/200/300.jpg?hmac=rcadCENKh4rD6MAp6V_ma-AyWv641M4iiOpe1RyFHeI", }, ] output = embeddings.embed_image_text(inputs) @@ -74,7 +74,7 @@ def test_predictionguard_embeddings_image_text_multiple() -> None: inputs = [ { "text": "embed me", - "image": "https://pbs.twimg.com/media/GKLN4qPXEAArqoK.png", + "image": "https://fastly.picsum.photos/id/866/200/300.jpg?hmac=rcadCENKh4rD6MAp6V_ma-AyWv641M4iiOpe1RyFHeI", }, { "text": "embed this", @@ -82,4 +82,4 @@ def test_predictionguard_embeddings_image_text_multiple() -> None: }, ] output = embeddings.embed_image_text(inputs) - assert len(output) == 2 \ No newline at end of file + assert len(output) == 2