From 3cd5f5986273a44b8610af0957d807863bc94f79 Mon Sep 17 00:00:00 2001 From: Daggx Date: Wed, 16 Oct 2024 11:42:16 +0200 Subject: [PATCH] [fix] delete file if >= 10 m.b --- edenai_apis/apis/google/google_video_api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/edenai_apis/apis/google/google_video_api.py b/edenai_apis/apis/google/google_video_api.py index 768b4aae..ac214f01 100644 --- a/edenai_apis/apis/google/google_video_api.py +++ b/edenai_apis/apis/google/google_video_api.py @@ -795,6 +795,7 @@ def video__question_answer( file_data = self._upload_and_process_file(file, api_key) file_size_mb = self._bytes_to_mega(int(file_data.get("sizeBytes", 0))) if file_size_mb >= 10: + self._delete_file(file=file_data["name"], api_key=api_key) raise ProviderException( message="The video file is too large (over 10 MB). Please use the asynchronous video question answering api instead.", )