langchain/memory/chat_message_histories/firestore.py/FirestoreChatMessageHistory/upsert_messages
class FirestoreChatMessageHistory:    def upsert_messages(self, new_message: Optional[BaseMessage] = None) -> None:
        """Update the Firestore document."""
        if not self._document:
            raise ValueError("Document not initialized")
        self._document.set(
            {
                "id": self.session_id,
                "user_id": self.user_id,
                "messages": messages_to_dict(self.messages),
            }
        )