mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-13 21:47:12 +00:00
IMPROVEMENT: filter global warnings properly (#13754)
This commit is contained in:
@@ -27,7 +27,7 @@ def set_verbose(value: bool) -> None:
|
||||
warnings.filterwarnings(
|
||||
"ignore",
|
||||
message=(
|
||||
"Importing verbose from langchain_core root module is no longer supported"
|
||||
"Importing verbose from langchain root module is no longer supported"
|
||||
),
|
||||
)
|
||||
# N.B.: This is a workaround for an unfortunate quirk of Python's
|
||||
@@ -55,7 +55,7 @@ def get_verbose() -> bool:
|
||||
warnings.filterwarnings(
|
||||
"ignore",
|
||||
message=(
|
||||
"Importing verbose from langchain_core root module is no longer supported"
|
||||
".*Importing verbose from langchain root module is no longer supported"
|
||||
),
|
||||
)
|
||||
# N.B.: This is a workaround for an unfortunate quirk of Python's
|
||||
@@ -87,7 +87,7 @@ def set_debug(value: bool) -> None:
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings(
|
||||
"ignore",
|
||||
message="Importing debug from langchain_core root module is no longer supported",
|
||||
message="Importing debug from langchain root module is no longer supported",
|
||||
)
|
||||
# N.B.: This is a workaround for an unfortunate quirk of Python's
|
||||
# module-level `__getattr__()` implementation:
|
||||
@@ -113,7 +113,7 @@ def get_debug() -> bool:
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings(
|
||||
"ignore",
|
||||
message="Importing debug from langchain_core root module is no longer supported",
|
||||
message="Importing debug from langchain root module is no longer supported",
|
||||
)
|
||||
# N.B.: This is a workaround for an unfortunate quirk of Python's
|
||||
# module-level `__getattr__()` implementation:
|
||||
@@ -145,7 +145,7 @@ def set_llm_cache(value: Optional["BaseCache"]) -> None:
|
||||
warnings.filterwarnings(
|
||||
"ignore",
|
||||
message=(
|
||||
"Importing llm_cache from langchain_core root module is no longer supported"
|
||||
"Importing llm_cache from langchain root module is no longer supported"
|
||||
),
|
||||
)
|
||||
# N.B.: This is a workaround for an unfortunate quirk of Python's
|
||||
@@ -173,7 +173,7 @@ def get_llm_cache() -> "BaseCache":
|
||||
warnings.filterwarnings(
|
||||
"ignore",
|
||||
message=(
|
||||
"Importing llm_cache from langchain_core root module is no longer supported"
|
||||
"Importing llm_cache from langchain root module is no longer supported"
|
||||
),
|
||||
)
|
||||
# N.B.: This is a workaround for an unfortunate quirk of Python's
|
||||
|
Reference in New Issue
Block a user