langchain/libs/community/tests/unit_tests/embeddings/test_huggingface.py
William FH e5cf1e2414
Community[patch]use secret str in Tavily and HuggingFaceInferenceEmbeddings (#16109)
So the api keys don't show up in repr's 

Still need to do tests
2024-01-17 00:30:07 -08:00

8 lines
314 B
Python

from langchain_community.embeddings.huggingface import HuggingFaceInferenceAPIEmbeddings
def test_hugginggface_inferenceapi_embedding_documents_init() -> None:
"""Test huggingface embeddings."""
embedding = HuggingFaceInferenceAPIEmbeddings(api_key="abcd123")
assert "abcd123" not in repr(embedding)