def validate_thread_counts(cls, values):
        """
        Set the values for image_download_thread_count and media_download_thread_count.
        There are 4 cases:
            1. Both not given -> Both reads default values
            2. Image given, media not given -> media reads default value, image uses given value
            3. Media set, image not set -> media uses given value, image uses media value
            4. Both set -> error:
        Once set, media_download_thread_count is used for audio and video, image_download_thread_count is
        used for images, when sending inference requests to the inference server.
        """
        image_count = values.get('image_download_thread_count')
        media_count = values.get('media_download_thread_count')
        if media_count and image_count:
            raise ValueError("Cannot set both 'image_download_thread_count' and 'media_download_thread_count'.")
        elif image_count is None and media_count is None:
            # Set default values for both
            values['image_download_thread_count'] = (
                read_env_vars_and_defaults_ints(EnvVars.MARQO_IMAGE_DOWNLOAD_THREAD_COUNT_PER_REQUEST))
            values['media_download_thread_count'] = (
                read_env_vars_and_defaults_ints(EnvVars.MARQO_MEDIA_DOWNLOAD_THREAD_COUNT_PER_REQUEST)
            )
        elif image_count is None and media_count is not None:
            values['media_download_thread_count'] = media_count
            values['image_download_thread_count'] = media_count
        elif image_count is not None and media_count is None:
            values['media_download_thread_count'] = (
                read_env_vars_and_defaults_ints(EnvVars.MARQO_MEDIA_DOWNLOAD_THREAD_COUNT_PER_REQUEST)
            )
            values['image_download_thread_count'] = image_count
        else:
            raise ValueError("Invalid combination of image_download_thread_count and media_download_thread_count.")
        return values

        Set the values for image_download_thread_count and media_download_thread_count.
        There are 4 cases:
            1. Both not given -> Both reads default values
            2. Image given, media not given -> media reads default value, image uses given value
            3. Media set, image not set -> media uses given value, image uses media value
            4. Both set -> error:
        Once set, media_download_thread_count is used for audio and video, image_download_thread_count is
        used for images, when sending inference requests to the inference server.
        
src/marqo/core/models/add_docs_params.py