LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    โŒ˜I

    Chat LangChain

    What can I help with?

    Enter to sendยทShift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-core_apideprecationsuppress_langchain_deprecation_warning
    Functionโ—Since v1.8

    suppress_langchain_deprecation_warning

    Copy
    suppress_langchain_deprecation_warning() -> Generator[None, None, None]
    View source on GitHub

    Suppress LangChain deprecation warnings within the current context.

    Silences warnings emitted through warn_deprecated and @deprecated. It does not modify the global warnings filters, so calling warnings.warn directly with LangChainDeprecationWarning is not suppressed; use warnings.filterwarnings for that.

    Suppression is stored in a context variable, not a process-wide filter. It applies to the current thread or asyncio task, and to tasks or copied contexts created inside the block (e.g. asyncio.create_task, asyncio.to_thread), which keep it even after the block exits. Other threads are unaffected.