def text_to_video(
        self, prompt: str, save_at: str, duration: float, config: dict
    ):
        """
        Generates a video from using text-to-video models.
        """
        try:
            model_name = config.get("model_name", "fal-ai/minimax-video")
            res = fal_client.run(
                model_name,
                arguments={"prompt": prompt, "duration": duration},
            )
            video_url = res["video"]["url"]
            with open(save_at, "wb") as f:
                f.write(requests.get(video_url).content)

        except Exception as e:
            raise Exception(f"Error generating video: {type(e).__name__}: {str(e)}")

        return {"status": "success", "video_path": save_at}

        Generates a video from using text-to-video models.
        
backend/director/tools/fal_video.py