def validate_audio_source(self, audio_source: dict):
        """Ensure that either 'audio_url' or 'video_id' is provided, but not both."""
        has_audio_url = "audio_url" in audio_source and bool(audio_source["audio_url"])
        has_video_id = "video_id" in audio_source and bool(audio_source["video_id"])

        if has_audio_url and has_video_id:
            raise ValueError("Provide either 'audio_url' or 'video_id', but not both.")

        if not has_audio_url and not has_video_id:
            raise ValueError("Either 'audio_url' or 'video_id' must be provided.")

        if has_video_id:
            audio_source.setdefault("start_time", 0)
            audio_source.setdefault("end_time", 90)
            if "collection_id" not in audio_source:
                raise ValueError("'collection_id' is required when using 'video_id'.")

        return audio_source
Ensure that either 'audio_url' or 'video_id' is provided, but not both.
backend/director/agents/clone_voice.py