mirror of https://github.com/hwchase17/langchain
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 testspull/14560/head^2
parent
f3601b0aaf
commit
e5cf1e2414
@ -0,0 +1,7 @@
|
||||
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)
|
@ -0,0 +1,7 @@
|
||||
from langchain_community.utilities.tavily_search import TavilySearchAPIWrapper
|
||||
|
||||
|
||||
def test_api_wrapper_api_key_not_visible() -> None:
|
||||
"""Test that an exception is raised if the API key is not present."""
|
||||
wrapper = TavilySearchAPIWrapper(tavily_api_key="abcd123")
|
||||
assert "abcd123" not in repr(wrapper)
|
Loading…
Reference in New Issue