Skip to content

base ¤

Base class for the memory module.

Classes:

Name Description
BaseChatMessageHistory

Abstract class to store the chat message history.

BaseChatMessageHistory ¤

Bases: ABC

Abstract class to store the chat message history.

See ChatMessageHistory for default implementation.

Methods:

Name Description
add_message

Add a Message object to the state.

clear

Remove all messages from the state

Attributes:

Name Type Description
history List[Message]

Return the chat message history

history abstractmethod property ¤

history: List[Message]

Return the chat message history

Returns:

Type Description
List[Message]

List of Message objects

add_message abstractmethod ¤

add_message(message: Message) -> None

Add a Message object to the state.

Parameters:

Name Type Description Default
message Message

Message object to add to the state

required
Source code in src/declarai/memory/base.py
28
29
30
31
32
33
34
35
@abstractmethod
def add_message(self, message: Message) -> None:
    """
    Add a Message object to the state.

    Args:
        message: Message object to add to the state
    """

clear abstractmethod ¤

clear() -> None

Remove all messages from the state

Source code in src/declarai/memory/base.py
37
38
39
40
41
@abstractmethod
def clear(self) -> None:
    """
    Remove all messages from the state
    """