mirror of https://github.com/hwchase17/langchain
langchain: import InMemoryChatMessageHistory from core (#21198)
parent
3cd7fced5f
commit
bd5d2c2674
@ -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
|
__all__ = [
|
||||||
|
"ChatMessageHistory",
|
||||||
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"]
|
|
||||||
|
Loading…
Reference in New Issue