def add_or_update_msg_to_conv(
        self,
        session_id: str,
        conv_id: str,
        msg_id: str,
        msg_type: str,
        agents: List[str],
        actions: List[str],
        content: List[dict],
        status: str = None,
        created_at: int = None,
        updated_at: int = None,
        metadata: dict = {},
        **kwargs,
    ) -> None:
        """Add a new message (input or output) to the conversation.

        :param str session_id: Unique session ID.
        :param str conv_id: Unique conversation ID.
        :param str msg_id: Unique message ID.
        :param str msg_type: Type of message (input or output).
        :param list agents: List of agents involved in the conversation.
        :param list actions: List of actions taken by the agents.
        :param list content: List of message content.
        :param str status: Status of the message.
        :param int created_at: Timestamp when the message was created.
        :param int updated_at: Timestamp when the message was last updated.
        :param dict metadata: Additional metadata for the message.
        """
        created_at = created_at or int(time.time())
        updated_at = updated_at or int(time.time())

        self.cursor.execute(
            """
        INSERT OR REPLACE INTO conversations (session_id, conv_id, msg_id, msg_type, agents, actions, content, status, created_at, updated_at, metadata)
        VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
        """,
            (
                session_id,
                conv_id,
                msg_id,
                msg_type,
                json.dumps(agents),
                json.dumps(actions),
                json.dumps(content),
                status,
                created_at,
                updated_at,
                json.dumps(metadata),
            ),
        )
        self.conn.commit()
Add a new message (input or output) to the conversation.

        :param str session_id: Unique session ID.
        :param str conv_id: Unique conversation ID.
        :param str msg_id: Unique message ID.
        :param str msg_type: Type of message (input or output).
        :param list agents: List of agents involved in the conversation.
        :param list actions: List of actions taken by the agents.
        :param list content: List of message content.
        :param str status: Status of the message.
        :param int created_at: Timestamp when the message was created.
        :param int updated_at: Timestamp when the message was last updated.
        :param dict metadata: Additional metadata for the message.
        
backend/director/db/sqlite/db.py