def __init__(self, length: int, storage_path: Path):
        """
        Initialize the ChatSession decorator.

        :param length: Integer, maximum number of cached messages to keep.
        """
        self.length = length
        self.storage_path = storage_path
        self.storage_path.mkdir(parents=True, exist_ok=True)

        Initialize the ChatSession decorator.

        :param length: Integer, maximum number of cached messages to keep.
        
sgpt/handlers/chat_handler.py