super().__init__()
        self.creds = creds
        self.n = n
        self.raise_error = raise_error
[docs]    def lazy_load(self) -> Iterator[ChatSession]:
        from googleapiclient.discovery import build
        service = build("gmail", "v1", credentials=self.creds)
        results = (
            service.users()
            .messages()
            .list(userId="me", labelIds=["SENT"], maxResults=self.n)
            .execute()
        )
        messages = results.get("messages", [])
        for message in messages:
            try:
                yield _get_message_data(service, message)
            except Exception as e:
                # TODO: handle errors better
                if self.raise_error:
                    raise e
                else:
                    pass