hunk.code_window:         return f"{base_url}?brain_subscription_invitation={self.brain_id}"
       def resend_invitation_email(self):
           resend.api_key = os.getenv("RESEND_API_KEY")
           brain_url = self.get_brain_url()
           html_body = f"""
  
hunk.labels: keep keep keep replace keep keep keep keep
hunk.after_edit:         brains_settings = BrainSettings()  # pyright: ignore reportPrivateUsage=none
           resend.api_key = brains_settings.resend_api_key
  
hunk.file_path: backend/core/models/brains_subscription_invitations.py
hunk.type: replace
file: from dataclasses import asdict, dataclass
  
  
  @dataclass
  class Chat:
      chat_id: str
      user_id: str
      creation_time: str
      chat_name: str
  
      def __init__(self, chat_dict: dict):
          self.chat_id = chat_dict.get(
              "chat_id"
          )  # pyright: ignore reportPrivateUsage=none
          self.user_id = chat_dict.get(
              "user_id"
          )  # pyright: ignore reportPrivateUsage=none
          self.creation_time = chat_dict.get(
              "creation_time"
          )  # pyright: ignore reportPrivateUsage=none
          self.chat_name = chat_dict.get(
              "chat_name"
          )  # pyright: ignore reportPrivateUsage=none
  
  
  @dataclass
  class ChatHistory:
      chat_id: str
      message_id: str
      user_message: str
      assistant: str
      message_time: str
  
      def __init__(self, chat_dict: dict):
          self.chat_id = chat_dict.get(
              "chat_id"
          )  # pyright: ignore reportPrivateUsage=none
          self.message_id = chat_dict.get(
              "message_id"
          )  # pyright: ignore reportPrivateUsage=none
          self.user_message = chat_dict.get(
              "user_message"
          )  # pyright: ignore reportPrivateUsage=none
          self.assistant = chat_dict.get(
              "assistant"
          )  # pyright: ignore reportPrivateUsage=none
          self.message_time = chat_dict.get(
              "message_time"
          )  # pyright: ignore reportPrivateUsage=none
  
      def to_dict(self):
          return asdict(self)
  