def run(
        self,
        engine: str,
        job_type: str,
        search_videos: Optional[str] = None,
        *args,
        **kwargs,
    ) -> AgentResponse:
        """
        Perform a search using the specified engine and handle different job types.

        :param engine: Search engine to use (e.g., 'serp').
        :param job_type: Type of job to execute (e.g., 'search_videos').
        :param search_videos: Parameters specific to the 'search_videos' job type.
        :return: A structured response containing search results.
        """
        if engine not in SUPPORTED_ENGINES:
            return AgentResponse(
                status=AgentStatus.ERROR,
                message=f"Engine '{engine}' is not supported.",
            )

        self.api_key = os.getenv("SERP_API_KEY")
        if self.api_key and engine == "serp":
            serp_config = search_videos.get("serp_config", {})
            search_engine_tool = SerpAPI(
                api_key=self.api_key,
                base_url=serp_config.get("base_url"),
                timeout=serp_config.get("timeout", 10),
            )
        else:
            search_engine_tool = VideoDBSearchTool()

        if job_type == "search_videos":
            if not isinstance(search_videos, dict):
                return AgentResponse(
                    status=AgentStatus.ERROR,
                    message="'search_videos' must be a dictionary.",
                )
            if not search_videos:
                return AgentResponse(
                    status=AgentStatus.ERROR,
                    message="Parameters for 'search_videos' are required.",
                )
            return self._handle_video_search(search_videos, search_engine_tool)
        else:
            return AgentResponse(
                status=AgentStatus.ERROR,
                message=f"Unsupported job type: {job_type}.",
            )

        Perform a search using the specified engine and handle different job types.

        :param engine: Search engine to use (e.g., 'serp').
        :param job_type: Type of job to execute (e.g., 'search_videos').
        :param search_videos: Parameters specific to the 'search_videos' job type.
        :return: A structured response containing search results.
        
backend/director/agents/web_search_agent.py