Vikit-ai / sdk

Vikit.ai SDK let you develop easily video generators leveraging generative AI and other AI models.
https://vikit.ai
Apache License 2.0
51 stars 7 forks source link

urgent Fix.: retry once until gen video availability #136

Closed jeffmac-aix closed 3 months ago

jeffmac-aix commented 3 months ago

Urgent Fix, for video only: a video generation model might send an URL too early, i.e. before the video is actually generated and available. This causes the overall video generation process to fail. Here we fix this by checking the actual presence of the video file after we get an URL back from video generation API. If not we wait for a 5s delay (this can be changed by changing MEDIA_POLLING_INTERVAL env var) and check again If the URL is find, all good, otherwise we simply log an error and let the flow continue to generate the other videos. We take the assumption that this case is very unlikely to happen until we fix the video availability issue by polling the API properly, which depends on the API / platform, or use webhooks.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 37.50000% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
tests/test_video_building_handlers.py 0.00% 5 Missing :warning:
vikit/video/building/handlers/videogen_handler.py 44.44% 5 Missing :warning:
tests/test_filetools.py 0.00% 4 Missing :warning:
vikit/common/config.py 40.00% 3 Missing :warning:
vikit/common/file_tools.py 66.66% 3 Missing :warning:
Files with missing lines Coverage Δ
vikit/video/video.py 88.17% <ø> (ø)
vikit/common/config.py 44.31% <40.00%> (-0.81%) :arrow_down:
vikit/common/file_tools.py 64.22% <66.66%> (-0.13%) :arrow_down:
tests/test_filetools.py 0.00% <0.00%> (ø)
tests/test_video_building_handlers.py 0.00% <0.00%> (ø)
vikit/video/building/handlers/videogen_handler.py 73.91% <44.44%> (-18.95%) :arrow_down:

... and 4 files with indirect coverage changes