langchain/memory/chat_message_histories/cassandra.py/CassandraChatMessageHistory/add_message
class CassandraChatMessageHistory:    def add_message(self, message: BaseMessage) -> None:
        """Append the message to the record in Cassandra"""

        import uuid

        from cassandra import Unavailable, WriteFailure, WriteTimeout

        try:
            self.session.execute(
                """INSERT INTO message_store
                (id, session_id, history) VALUES (%s, %s, %s);""",
                (uuid.uuid4(), self.session_id, json.dumps(_message_to_dict(message))),
            )
        except (Unavailable, WriteTimeout, WriteFailure) as error:
            logger.error("Unable to write chat history messages to cassandra")
            raise error