code: import datetime
  import uuid
  
  from llama_index.core.memory import ChatMemoryBuffer
  
  
  class Chat:
      def __init__(self, model):
          self.model = model
  
          if model.id is None:
              self.id = str(uuid.uuid4())
          else:
              self.id = model.id
  
          self.history = ChatMemoryBuffer.from_defaults(token_limit=3900)
  
          self.created = datetime.datetime.now()
  
      def clearHistory(self):
          self.history.reset()
  
      def __eq__(self, other):
          return self.id == other.id
  
apis: llama_index.core.memory.ChatMemoryBuffer.from_defaults
extract_api: [((293, 341), 'llama_index.core.memory.ChatMemoryBuffer.from_defaults', 'ChatMemoryBuffer.from_defaults', ([], {'token_limit': '(3900)'}), '(token_limit=3900)\n', (323, 341), False, 'from llama_index.core.memory import ChatMemoryBuffer\n'), ((366, 389), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (387, 389), False, 'import datetime\n'), ((210, 222), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (220, 222), False, 'import uuid\n')]