Skip to content

The agent engineering platform.

Fix/abstract add message (#8856)

shibuiwilliamfbc83dfdbbc1
diff --git a/libs/langchain/langchain/schema/memory.py b/libs/langchain/langchain/schema/memory.py
index 46da7504b2..fe1b784440 100644
--- a/libs/langchain/langchain/schema/memory.py
+++ b/libs/langchain/langchain/schema/memory.py
@@ -107,14 +107,14 @@ class BaseChatMessageHistory(ABC):
"""
self.add_message(AIMessage(content=message))
- # TODO: Make this an abstractmethod.
+ @abstractmethod
def add_message(self, message: BaseMessage) -> None:
"""Add a Message object to the store.
Args:
message: A BaseMessage object to store.
"""
- raise NotImplementedError
+ raise NotImplementedError()
@abstractmethod
def clear(self) -> None: