working_memory
WorkingMemory
Bases: BaseModelDict
Represents the volatile memory of a cat, functioning similarly to a dictionary to store temporary custom data.
Attributes:
Name | Type | Description |
---|---|---|
history |
List[HistoryMessage]
|
A list that maintains the conversation history between the Human and the AI. |
user_message_json |
Optional[UserMessage], default=None
|
An optional UserMessage object representing the last user message. |
active_form |
Optional[CatForm], default=None
|
An optional reference to a CatForm currently in use. |
recall_query |
str, default=""
|
A string that stores the last recall query. |
episodic_memories |
List
|
A list for storing episodic memories. |
declarative_memories |
List
|
A list for storing declarative memories. |
procedural_memories |
List
|
A list for storing procedural memories. |
model_interactions |
List[ModelInteraction]
|
A list of interactions with models. |
Source code in cat/memory/working_memory.py
update_conversation_history(message, who, why={})
This method is deprecated. Use update_history
instead.
Updates the conversation history with the most recent message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
str
|
The text content of the message. |
required |
who
|
str
|
The name of the message author. |
required |
why
|
Optional[Dict[str, Any]]
|
Optional explanation for the message. |
None
|
Notes
This method is deprecated and will be removed in future versions. Use update_history
instead.
Source code in cat/memory/working_memory.py
update_history(message)
Adds a message to the history.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
ConversationMessage
|
The message, must be of type |
required |