Skip to content

Commit

Permalink
[fix] delete file if >= 10 m.b
Browse files Browse the repository at this point in the history
  • Loading branch information
Daggx committed Oct 16, 2024
1 parent 7705007 commit 3cd5f59
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions edenai_apis/apis/google/google_video_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
)
Expand Down

0 comments on commit 3cd5f59

Please sign in to comment.