From bd5d2c2674a9600494153ea833476920a9a1c3b4 Mon Sep 17 00:00:00 2001 From: ccurme Date: Thu, 2 May 2024 10:53:07 -0400 Subject: [PATCH] langchain: import InMemoryChatMessageHistory from core (#21198) --- .../chat_message_histories/in_memory.py | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/libs/langchain/langchain/memory/chat_message_histories/in_memory.py b/libs/langchain/langchain/memory/chat_message_histories/in_memory.py index 78bc4cc0bb..679c9ce665 100644 --- a/libs/langchain/langchain/memory/chat_message_histories/in_memory.py +++ b/libs/langchain/langchain/memory/chat_message_histories/in_memory.py @@ -1,21 +1,5 @@ -from typing import TYPE_CHECKING, Any +from langchain_core.chat_history import InMemoryChatMessageHistory as ChatMessageHistory -from langchain._api import create_importer - -if TYPE_CHECKING: - from langchain_community.chat_message_histories.in_memory import ChatMessageHistory - -# Create a way to dynamically look up deprecated imports. -# Used to consolidate logic for raising deprecation warnings and -# handling optional imports. -DEPRECATED_LOOKUP = {"ChatMessageHistory": "langchain_community.chat_message_histories"} - -_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP) - - -def __getattr__(name: str) -> Any: - """Look up attributes dynamically.""" - return _import_attribute(name) - - -__all__ = ["ChatMessageHistory"] +__all__ = [ + "ChatMessageHistory", +]