bobo 212537b8a2 chore: Add memory module for LLM API
- Added memory module for LLM API
- Implemented ChatMemory and FixSizeChatMemory classes
- Included methods for appending, requesting, and responding to memory
2024-01-31 16:14:51 +08:00

30 lines
647 B
Python

class ChatMemory:
"""
ChatMemory is the base class for all chat memory classes.
"""
def __init__(self):
pass
def append(self, request, response):
"""
Append a request and response to the memory.
"""
# it must implemented in sub class
pass
def append_request(self, request):
"""
Append a request to the memory.
"""
pass
def append_response(self, response):
"""
Append a request to the memory.
"""
pass
def contexts(self):
"""
Return the contexts of the memory.
"""
pass