def run(
        self,
        collection_id: str,
        source: str,
        source_type: str,
        media_type="video",
        name: str = None,
        *args,
        **kwargs,
    ) -> AgentResponse:
        """
        Upload the media with the given source.

        :param collection_id: str - collection_id in which the upload is required.
        :param source: str - The URL or local path of the media to upload.
        :param source_type: str - The type indicating the source of the media.
        :param media_type: str, optional - The type of media to upload, defaults to "video".
        :param name: str, optional - Name required for uploaded file.
        :return: AgentResponse - The response containing information about the upload operation.
        """

        self.videodb_tool = VideoDBTool(collection_id=collection_id)

        if source_type == "local_file":
            return self._upload(source, source_type, media_type, name)
        elif source_type == "url":
            playlist_info = self._get_yt_playlist_videos(source)
            if playlist_info:
                self.output_message.actions.append("YouTube Playlist detected")
                self.output_message.push_update()
                return self._upload_yt_playlist(playlist_info, media_type)
            return self._upload(source, source_type, media_type, name)
        else:
            error_message = f"Invalid source type {source_type}"
            logger.error(error_message)
            return AgentResponse(
                status=AgentStatus.ERROR, message=error_message, data={}
            )

        Upload the media with the given source.

        :param collection_id: str - collection_id in which the upload is required.
        :param source: str - The URL or local path of the media to upload.
        :param source_type: str - The type indicating the source of the media.
        :param media_type: str, optional - The type of media to upload, defaults to "video".
        :param name: str, optional - Name required for uploaded file.
        :return: AgentResponse - The response containing information about the upload operation.
        
backend/director/agents/upload.py