33 lines
650 B
Python
Raw Normal View History

class ChatMemory:
"""
ChatMemory is the base class for all chat memory classes.
"""
2024-01-31 16:15:30 +08:00
def __init__(self):
pass
2024-01-31 16:15:30 +08:00
def append(self, request, response):
"""
Append a request and response to the memory.
"""
# it must implemented in sub class
pass
2024-01-31 16:15:30 +08:00
def append_request(self, request):
"""
Append a request to the memory.
"""
pass
2024-01-31 16:15:30 +08:00
def append_response(self, response):
"""
Append a request to the memory.
"""
pass
2024-01-31 16:15:30 +08:00
def contexts(self):
"""
Return the contexts of the memory.
"""
pass