class_docstr: base class to work with chatbot memory
class_docstr_tok: ["base","class","to","work","with","chatbot","memory"]
code: def get_chat_history(self, chat_id, cached=True):
      if cached and chat_id in self._cache:
          history = self._cache[chat_id]
      else:
          history = self._get_chat_history(chat_id)
          self._cache[chat_id] = history
  
      history = self._apply_hiding(chat_id, history)
      return history
  
imports: from mindsdb_sql.parser.ast import Identifier, Select, BinaryOperation, Constant, OrderBy
  from mindsdb.interfaces.storage import db
  from .types import ChatBotMessage
label_desc: Use image node_id 8 for calling the BaseMemory obj's underlying member method code with example usage: obj.get_chat_history(chat_id, cached) and returns: history