magic_hour 0.41.0__tar.gz → 0.42.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of magic_hour might be problematic. Click here for more details.

Files changed (225) hide show
  1. {magic_hour-0.41.0 → magic_hour-0.42.0}/PKG-INFO +3 -1
  2. {magic_hour-0.41.0 → magic_hour-0.42.0}/README.md +2 -0
  3. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/helpers/download.py +2 -0
  4. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_voice_generator/README.md +56 -0
  5. magic_hour-0.42.0/magic_hour/resources/v1/ai_voice_generator/client.py +241 -0
  6. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/audio_projects/README.md +47 -0
  7. magic_hour-0.42.0/magic_hour/resources/v1/audio_projects/__init__.py +12 -0
  8. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/audio_projects/client.py +137 -0
  9. magic_hour-0.42.0/magic_hour/resources/v1/audio_projects/client_test.py +520 -0
  10. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/lip_sync/README.md +12 -0
  11. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/lip_sync/client.py +5 -0
  12. {magic_hour-0.41.0 → magic_hour-0.42.0}/pyproject.toml +1 -1
  13. magic_hour-0.41.0/magic_hour/resources/v1/ai_voice_generator/client.py +0 -119
  14. magic_hour-0.41.0/magic_hour/resources/v1/audio_projects/__init__.py +0 -4
  15. {magic_hour-0.41.0 → magic_hour-0.42.0}/LICENSE +0 -0
  16. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/README.md +0 -0
  17. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/__init__.py +0 -0
  18. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/client.py +0 -0
  19. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/environment.py +0 -0
  20. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/helpers/__init__.py +0 -0
  21. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/helpers/logger.py +0 -0
  22. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/README.md +0 -0
  23. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/__init__.py +0 -0
  24. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_clothes_changer/README.md +0 -0
  25. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_clothes_changer/__init__.py +0 -0
  26. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_clothes_changer/client.py +0 -0
  27. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_face_editor/README.md +0 -0
  28. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_face_editor/__init__.py +0 -0
  29. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_face_editor/client.py +0 -0
  30. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_gif_generator/README.md +0 -0
  31. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_gif_generator/__init__.py +0 -0
  32. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_gif_generator/client.py +0 -0
  33. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_headshot_generator/README.md +0 -0
  34. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_headshot_generator/__init__.py +0 -0
  35. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_headshot_generator/client.py +0 -0
  36. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_image_editor/README.md +0 -0
  37. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_image_editor/__init__.py +0 -0
  38. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_image_editor/client.py +0 -0
  39. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_image_generator/README.md +0 -0
  40. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_image_generator/__init__.py +0 -0
  41. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_image_generator/client.py +0 -0
  42. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_image_upscaler/README.md +0 -0
  43. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_image_upscaler/__init__.py +0 -0
  44. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_image_upscaler/client.py +0 -0
  45. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_meme_generator/README.md +0 -0
  46. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_meme_generator/__init__.py +0 -0
  47. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_meme_generator/client.py +0 -0
  48. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_photo_editor/README.md +0 -0
  49. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_photo_editor/__init__.py +0 -0
  50. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_photo_editor/client.py +0 -0
  51. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_qr_code_generator/README.md +0 -0
  52. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_qr_code_generator/__init__.py +0 -0
  53. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_qr_code_generator/client.py +0 -0
  54. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_talking_photo/README.md +0 -0
  55. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_talking_photo/__init__.py +0 -0
  56. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_talking_photo/client.py +0 -0
  57. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/ai_voice_generator/__init__.py +0 -0
  58. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/animation/README.md +0 -0
  59. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/animation/__init__.py +0 -0
  60. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/animation/client.py +0 -0
  61. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/auto_subtitle_generator/README.md +0 -0
  62. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/auto_subtitle_generator/__init__.py +0 -0
  63. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/auto_subtitle_generator/client.py +0 -0
  64. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/client.py +0 -0
  65. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/face_detection/README.md +0 -0
  66. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/face_detection/__init__.py +0 -0
  67. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/face_detection/client.py +0 -0
  68. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/face_swap/README.md +0 -0
  69. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/face_swap/__init__.py +0 -0
  70. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/face_swap/client.py +0 -0
  71. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/face_swap_photo/README.md +0 -0
  72. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/face_swap_photo/__init__.py +0 -0
  73. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/face_swap_photo/client.py +0 -0
  74. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/files/README.md +0 -0
  75. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/files/__init__.py +0 -0
  76. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/files/client.py +0 -0
  77. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/files/client_test.py +0 -0
  78. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/files/upload_urls/README.md +0 -0
  79. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/files/upload_urls/__init__.py +0 -0
  80. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/files/upload_urls/client.py +0 -0
  81. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/image_background_remover/README.md +0 -0
  82. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/image_background_remover/__init__.py +0 -0
  83. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/image_background_remover/client.py +0 -0
  84. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/image_projects/README.md +0 -0
  85. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/image_projects/__init__.py +0 -0
  86. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/image_projects/client.py +0 -0
  87. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/image_projects/client_test.py +0 -0
  88. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/image_to_video/README.md +0 -0
  89. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/image_to_video/__init__.py +0 -0
  90. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/image_to_video/client.py +0 -0
  91. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/lip_sync/__init__.py +0 -0
  92. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/photo_colorizer/README.md +0 -0
  93. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/photo_colorizer/__init__.py +0 -0
  94. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/photo_colorizer/client.py +0 -0
  95. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/text_to_video/README.md +0 -0
  96. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/text_to_video/__init__.py +0 -0
  97. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/text_to_video/client.py +0 -0
  98. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/video_projects/README.md +0 -0
  99. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/video_projects/__init__.py +0 -0
  100. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/video_projects/client.py +0 -0
  101. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/video_projects/client_test.py +0 -0
  102. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/video_to_video/README.md +0 -0
  103. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/video_to_video/__init__.py +0 -0
  104. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/resources/v1/video_to_video/client.py +0 -0
  105. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/__init__.py +0 -0
  106. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_ai_clothes_changer_create_response.py +0 -0
  107. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_ai_face_editor_create_response.py +0 -0
  108. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_ai_gif_generator_create_response.py +0 -0
  109. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_ai_headshot_generator_create_response.py +0 -0
  110. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_ai_image_editor_create_response.py +0 -0
  111. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_ai_image_generator_create_response.py +0 -0
  112. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_ai_image_upscaler_create_response.py +0 -0
  113. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_ai_meme_generator_create_response.py +0 -0
  114. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_ai_photo_editor_create_response.py +0 -0
  115. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_ai_qr_code_generator_create_response.py +0 -0
  116. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_ai_talking_photo_create_response.py +0 -0
  117. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_ai_voice_generator_create_response.py +0 -0
  118. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_animation_create_response.py +0 -0
  119. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_audio_projects_get_response.py +0 -0
  120. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_audio_projects_get_response_downloads_item.py +0 -0
  121. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_audio_projects_get_response_error.py +0 -0
  122. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_auto_subtitle_generator_create_response.py +0 -0
  123. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_face_detection_create_response.py +0 -0
  124. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_face_detection_get_response.py +0 -0
  125. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_face_detection_get_response_faces_item.py +0 -0
  126. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_face_swap_create_response.py +0 -0
  127. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_face_swap_photo_create_response.py +0 -0
  128. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_files_upload_urls_create_response.py +0 -0
  129. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_files_upload_urls_create_response_items_item.py +0 -0
  130. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_image_background_remover_create_response.py +0 -0
  131. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_image_projects_get_response.py +0 -0
  132. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_image_projects_get_response_downloads_item.py +0 -0
  133. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_image_projects_get_response_error.py +0 -0
  134. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_image_to_video_create_response.py +0 -0
  135. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_lip_sync_create_response.py +0 -0
  136. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_photo_colorizer_create_response.py +0 -0
  137. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_text_to_video_create_response.py +0 -0
  138. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_video_projects_get_response.py +0 -0
  139. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_video_projects_get_response_download.py +0 -0
  140. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_video_projects_get_response_downloads_item.py +0 -0
  141. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_video_projects_get_response_error.py +0 -0
  142. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/models/v1_video_to_video_create_response.py +0 -0
  143. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/__init__.py +0 -0
  144. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_clothes_changer_create_body.py +0 -0
  145. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_clothes_changer_create_body_assets.py +0 -0
  146. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_clothes_changer_generate_body_assets.py +0 -0
  147. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_face_editor_create_body.py +0 -0
  148. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_face_editor_create_body_assets.py +0 -0
  149. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_face_editor_create_body_style.py +0 -0
  150. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_face_editor_generate_body_assets.py +0 -0
  151. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_gif_generator_create_body.py +0 -0
  152. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_gif_generator_create_body_style.py +0 -0
  153. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body.py +0 -0
  154. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body_assets.py +0 -0
  155. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body_style.py +0 -0
  156. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_headshot_generator_generate_body_assets.py +0 -0
  157. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_image_editor_create_body.py +0 -0
  158. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_image_editor_create_body_assets.py +0 -0
  159. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_image_editor_create_body_style.py +0 -0
  160. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_image_editor_generate_body_assets.py +0 -0
  161. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_image_generator_create_body.py +0 -0
  162. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_image_generator_create_body_style.py +0 -0
  163. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body.py +0 -0
  164. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body_assets.py +0 -0
  165. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body_style.py +0 -0
  166. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_image_upscaler_generate_body_assets.py +0 -0
  167. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_meme_generator_create_body.py +0 -0
  168. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_meme_generator_create_body_style.py +0 -0
  169. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_photo_editor_create_body.py +0 -0
  170. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_photo_editor_create_body_assets.py +0 -0
  171. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_photo_editor_create_body_style.py +0 -0
  172. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_photo_editor_generate_body_assets.py +0 -0
  173. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_qr_code_generator_create_body.py +0 -0
  174. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_qr_code_generator_create_body_style.py +0 -0
  175. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_talking_photo_create_body.py +0 -0
  176. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_talking_photo_create_body_assets.py +0 -0
  177. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_talking_photo_create_body_style.py +0 -0
  178. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_talking_photo_generate_body_assets.py +0 -0
  179. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_voice_generator_create_body.py +0 -0
  180. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_ai_voice_generator_create_body_style.py +0 -0
  181. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_animation_create_body.py +0 -0
  182. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_animation_create_body_assets.py +0 -0
  183. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_animation_create_body_style.py +0 -0
  184. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_animation_generate_body_assets.py +0 -0
  185. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_auto_subtitle_generator_create_body.py +0 -0
  186. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_auto_subtitle_generator_create_body_assets.py +0 -0
  187. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_auto_subtitle_generator_create_body_style.py +0 -0
  188. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_auto_subtitle_generator_create_body_style_custom_config.py +0 -0
  189. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_auto_subtitle_generator_generate_body_assets.py +0 -0
  190. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_detection_create_body.py +0 -0
  191. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_detection_create_body_assets.py +0 -0
  192. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_detection_generate_body_assets.py +0 -0
  193. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_swap_create_body.py +0 -0
  194. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_swap_create_body_assets.py +0 -0
  195. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_swap_create_body_assets_face_mappings_item.py +0 -0
  196. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_swap_create_body_style.py +0 -0
  197. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_swap_generate_body_assets.py +0 -0
  198. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_swap_generate_body_assets_face_mappings_item.py +0 -0
  199. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_swap_photo_create_body.py +0 -0
  200. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_swap_photo_create_body_assets.py +0 -0
  201. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_swap_photo_create_body_assets_face_mappings_item.py +0 -0
  202. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_swap_photo_generate_body_assets.py +0 -0
  203. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_face_swap_photo_generate_body_assets_face_mappings_item.py +0 -0
  204. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_files_upload_urls_create_body.py +0 -0
  205. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_files_upload_urls_create_body_items_item.py +0 -0
  206. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_image_background_remover_create_body.py +0 -0
  207. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_image_background_remover_create_body_assets.py +0 -0
  208. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_image_background_remover_generate_body_assets.py +0 -0
  209. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_image_to_video_create_body.py +0 -0
  210. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_image_to_video_create_body_assets.py +0 -0
  211. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_image_to_video_create_body_style.py +0 -0
  212. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_image_to_video_generate_body_assets.py +0 -0
  213. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_lip_sync_create_body.py +0 -0
  214. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_lip_sync_create_body_assets.py +0 -0
  215. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_lip_sync_create_body_style.py +0 -0
  216. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_lip_sync_generate_body_assets.py +0 -0
  217. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_photo_colorizer_create_body.py +0 -0
  218. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_photo_colorizer_create_body_assets.py +0 -0
  219. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_photo_colorizer_generate_body_assets.py +0 -0
  220. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_text_to_video_create_body.py +0 -0
  221. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_text_to_video_create_body_style.py +0 -0
  222. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_video_to_video_create_body.py +0 -0
  223. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_video_to_video_create_body_assets.py +0 -0
  224. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_video_to_video_create_body_style.py +0 -0
  225. {magic_hour-0.41.0 → magic_hour-0.42.0}/magic_hour/types/params/v1_video_to_video_generate_body_assets.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: magic_hour
3
- Version: 0.41.0
3
+ Version: 0.42.0
4
4
  Summary: Python SDK for Magic Hour API
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -226,6 +226,7 @@ download_urls = result.downloads
226
226
  ### [v1.ai_voice_generator](magic_hour/resources/v1/ai_voice_generator/README.md)
227
227
 
228
228
  * [create](magic_hour/resources/v1/ai_voice_generator/README.md#create) - AI Voice Generator
229
+ * [generate](magic_hour/resources/v1/ai_voice_generator/README.md#generate) - Ai Voice Generator Generate Workflow
229
230
 
230
231
  ### [v1.animation](magic_hour/resources/v1/animation/README.md)
231
232
 
@@ -234,6 +235,7 @@ download_urls = result.downloads
234
235
 
235
236
  ### [v1.audio_projects](magic_hour/resources/v1/audio_projects/README.md)
236
237
 
238
+ * [check-result](magic_hour/resources/v1/audio_projects/README.md#check-result) - Check results
237
239
  * [delete](magic_hour/resources/v1/audio_projects/README.md#delete) - Delete audio
238
240
  * [get](magic_hour/resources/v1/audio_projects/README.md#get) - Get audio details
239
241
 
@@ -211,6 +211,7 @@ download_urls = result.downloads
211
211
  ### [v1.ai_voice_generator](magic_hour/resources/v1/ai_voice_generator/README.md)
212
212
 
213
213
  * [create](magic_hour/resources/v1/ai_voice_generator/README.md#create) - AI Voice Generator
214
+ * [generate](magic_hour/resources/v1/ai_voice_generator/README.md#generate) - Ai Voice Generator Generate Workflow
214
215
 
215
216
  ### [v1.animation](magic_hour/resources/v1/animation/README.md)
216
217
 
@@ -219,6 +220,7 @@ download_urls = result.downloads
219
220
 
220
221
  ### [v1.audio_projects](magic_hour/resources/v1/audio_projects/README.md)
221
222
 
223
+ * [check-result](magic_hour/resources/v1/audio_projects/README.md#check-result) - Check results
222
224
  * [delete](magic_hour/resources/v1/audio_projects/README.md#delete) - Delete audio
223
225
  * [get](magic_hour/resources/v1/audio_projects/README.md#get) - Get audio details
224
226
 
@@ -23,6 +23,7 @@ def download_files_sync(
23
23
  downloads: Union[
24
24
  List[models.V1ImageProjectsGetResponseDownloadsItem],
25
25
  List[models.V1VideoProjectsGetResponseDownloadsItem],
26
+ List[models.V1AudioProjectsGetResponseDownloadsItem],
26
27
  ],
27
28
  download_directory: Union[str, None] = None,
28
29
  ) -> List[str]:
@@ -51,6 +52,7 @@ async def download_files_async(
51
52
  downloads: Union[
52
53
  List[models.V1ImageProjectsGetResponseDownloadsItem],
53
54
  List[models.V1VideoProjectsGetResponseDownloadsItem],
55
+ List[models.V1AudioProjectsGetResponseDownloadsItem],
54
56
  ],
55
57
  download_directory: Union[str, None] = None,
56
58
  ) -> List[str]:
@@ -2,6 +2,62 @@
2
2
 
3
3
  ## Module Functions
4
4
 
5
+ <!-- CUSTOM DOCS START -->
6
+
7
+ ### Ai Talking Photo Generate Workflow <a name="generate"></a>
8
+
9
+ The workflow performs the following action
10
+
11
+ 1. upload local assets to Magic Hour storage. So you can pass in a local path instead of having to upload files yourself
12
+ 2. trigger a generation
13
+ 3. poll for a completion status. This is configurable
14
+ 4. if success, download the output to local directory
15
+
16
+ > [!TIP]
17
+ > This is the recommended way to use the SDK unless you have specific needs where it is necessary to split up the actions.
18
+
19
+ #### Parameters
20
+
21
+ In Additional to the parameters listed in the `.create` section below, `.generate` introduces 3 new parameters:
22
+
23
+ - `wait_for_completion` (bool, default True): Whether to wait for the project to complete.
24
+ - `download_outputs` (bool, default True): Whether to download the generated files
25
+ - `download_directory` (str, optional): Directory to save downloaded files (defaults to current directory)
26
+
27
+ #### Synchronous Client
28
+
29
+ ```python
30
+ from magic_hour import Client
31
+ from os import getenv
32
+
33
+ client = Client(token=getenv("API_TOKEN"))
34
+ res = client.v1.ai_talking_photo.generate(
35
+ style={"prompt": "Hello, how are you?", "voice_name": "Elon Musk"},
36
+ name="Voice Generator audio",
37
+ wait_for_completion=True,
38
+ download_outputs=True,
39
+ download_directory="outputs"
40
+ )
41
+ ```
42
+
43
+ #### Asynchronous Client
44
+
45
+ ```python
46
+ from magic_hour import AsyncClient
47
+ from os import getenv
48
+
49
+ client = AsyncClient(token=getenv("API_TOKEN"))
50
+ res = await client.v1.ai_talking_photo.generate(
51
+ style={"prompt": "Hello, how are you?", "voice_name": "Elon Musk"},
52
+ name="Voice Generator audio",
53
+ wait_for_completion=True,
54
+ download_outputs=True,
55
+ download_directory="outputs"
56
+ )
57
+ ```
58
+
59
+ <!-- CUSTOM DOCS END -->
60
+
5
61
  ### AI Voice Generator <a name="create"></a>
6
62
 
7
63
  Generate speech from text. Each character costs 0.05 credits. The cost is rounded up to the nearest whole number.
@@ -0,0 +1,241 @@
1
+ import typing
2
+
3
+ from magic_hour.helpers.logger import get_sdk_logger
4
+ from magic_hour.resources.v1.audio_projects.client import (
5
+ AsyncAudioProjectsClient,
6
+ AudioProjectsClient,
7
+ )
8
+ from magic_hour.types import models, params
9
+ from make_api_request import (
10
+ AsyncBaseClient,
11
+ RequestOptions,
12
+ SyncBaseClient,
13
+ default_request_options,
14
+ to_encodable,
15
+ type_utils,
16
+ )
17
+
18
+
19
+ logger = get_sdk_logger(__name__)
20
+
21
+
22
+ class AiVoiceGeneratorClient:
23
+ def __init__(self, *, base_client: SyncBaseClient):
24
+ self._base_client = base_client
25
+
26
+ def generate(
27
+ self,
28
+ *,
29
+ style: params.V1AiVoiceGeneratorCreateBodyStyle,
30
+ name: typing.Union[
31
+ typing.Optional[str], type_utils.NotGiven
32
+ ] = type_utils.NOT_GIVEN,
33
+ wait_for_completion: bool = True,
34
+ download_outputs: bool = True,
35
+ download_directory: typing.Optional[str] = None,
36
+ request_options: typing.Optional[RequestOptions] = None,
37
+ ):
38
+ """
39
+ Generate AI voice (alias for create with additional functionality).
40
+
41
+ Generate speech from text. Each character costs 0.05 credits. The cost is rounded up to the nearest whole number.
42
+
43
+ Args:
44
+ style: The content used to generate speech.
45
+ name: The name of audio. This value is mainly used for your own identification of the audio.
46
+ wait_for_completion: Whether to wait for the audio project to complete
47
+ download_outputs: Whether to download the outputs
48
+ download_directory: The directory to download the outputs to. If not provided, the outputs will be downloaded to the current working directory
49
+ request_options: Additional options to customize the HTTP request
50
+
51
+ Returns:
52
+ V1AudioProjectsGetResponseWithDownloads: The response from the AI Voice Generator API with the downloaded paths if `download_outputs` is True.
53
+
54
+ Examples:
55
+ ```py
56
+ response = client.v1.ai_voice_generator.generate(
57
+ style={"prompt": "Hello, how are you?", "voice_name": "Elon Musk"},
58
+ name="Generated Voice",
59
+ wait_for_completion=True,
60
+ download_outputs=True,
61
+ download_directory="outputs/",
62
+ )
63
+ ```
64
+ """
65
+
66
+ create_response = self.create(
67
+ style=style,
68
+ name=name,
69
+ request_options=request_options,
70
+ )
71
+ logger.info(f"AI Voice Generator response: {create_response}")
72
+
73
+ audio_projects_client = AudioProjectsClient(base_client=self._base_client)
74
+ response = audio_projects_client.check_result(
75
+ id=create_response.id,
76
+ wait_for_completion=wait_for_completion,
77
+ download_outputs=download_outputs,
78
+ download_directory=download_directory,
79
+ )
80
+
81
+ return response
82
+
83
+ def create(
84
+ self,
85
+ *,
86
+ style: params.V1AiVoiceGeneratorCreateBodyStyle,
87
+ name: typing.Union[
88
+ typing.Optional[str], type_utils.NotGiven
89
+ ] = type_utils.NOT_GIVEN,
90
+ request_options: typing.Optional[RequestOptions] = None,
91
+ ) -> models.V1AiVoiceGeneratorCreateResponse:
92
+ """
93
+ AI Voice Generator
94
+
95
+ Generate speech from text. Each character costs 0.05 credits. The cost is rounded up to the nearest whole number.
96
+
97
+ POST /v1/ai-voice-generator
98
+
99
+ Args:
100
+ name: The name of audio. This value is mainly used for your own identification of the audio.
101
+ style: The content used to generate speech.
102
+ request_options: Additional options to customize the HTTP request
103
+
104
+ Returns:
105
+ Success
106
+
107
+ Raises:
108
+ ApiError: A custom exception class that provides additional context
109
+ for API errors, including the HTTP status code and response body.
110
+
111
+ Examples:
112
+ ```py
113
+ client.v1.ai_voice_generator.create(
114
+ style={"prompt": "Hello, how are you?", "voice_name": "Elon Musk"},
115
+ name="Voice Generator audio",
116
+ )
117
+ ```
118
+ """
119
+ _json = to_encodable(
120
+ item={"name": name, "style": style},
121
+ dump_with=params._SerializerV1AiVoiceGeneratorCreateBody,
122
+ )
123
+ return self._base_client.request(
124
+ method="POST",
125
+ path="/v1/ai-voice-generator",
126
+ auth_names=["bearerAuth"],
127
+ json=_json,
128
+ cast_to=models.V1AiVoiceGeneratorCreateResponse,
129
+ request_options=request_options or default_request_options(),
130
+ )
131
+
132
+
133
+ class AsyncAiVoiceGeneratorClient:
134
+ def __init__(self, *, base_client: AsyncBaseClient):
135
+ self._base_client = base_client
136
+
137
+ async def generate(
138
+ self,
139
+ *,
140
+ style: params.V1AiVoiceGeneratorCreateBodyStyle,
141
+ name: typing.Union[
142
+ typing.Optional[str], type_utils.NotGiven
143
+ ] = type_utils.NOT_GIVEN,
144
+ wait_for_completion: bool = True,
145
+ download_outputs: bool = True,
146
+ download_directory: typing.Optional[str] = None,
147
+ request_options: typing.Optional[RequestOptions] = None,
148
+ ):
149
+ """
150
+ Generate AI voice (alias for create with additional functionality).
151
+
152
+ Generate speech from text. Each character costs 0.05 credits. The cost is rounded up to the nearest whole number.
153
+
154
+ Args:
155
+ style: The content used to generate speech.
156
+ name: The name of audio. This value is mainly used for your own identification of the audio.
157
+ wait_for_completion: Whether to wait for the audio project to complete
158
+ download_outputs: Whether to download the outputs
159
+ download_directory: The directory to download the outputs to. If not provided, the outputs will be downloaded to the current working directory
160
+ request_options: Additional options to customize the HTTP request
161
+
162
+ Returns:
163
+ V1AudioProjectsGetResponseWithDownloads: The response from the AI Voice Generator API with the downloaded paths if `download_outputs` is True.
164
+
165
+ Examples:
166
+ ```py
167
+ response = await client.v1.ai_voice_generator.generate(
168
+ style={"prompt": "Hello, how are you?", "voice_name": "Elon Musk"},
169
+ name="Generated Voice",
170
+ wait_for_completion=True,
171
+ download_outputs=True,
172
+ download_directory="outputs/",
173
+ )
174
+ ```
175
+ """
176
+
177
+ create_response = await self.create(
178
+ style=style,
179
+ name=name,
180
+ request_options=request_options,
181
+ )
182
+ logger.info(f"AI Voice Generator response: {create_response}")
183
+
184
+ audio_projects_client = AsyncAudioProjectsClient(base_client=self._base_client)
185
+ response = await audio_projects_client.check_result(
186
+ id=create_response.id,
187
+ wait_for_completion=wait_for_completion,
188
+ download_outputs=download_outputs,
189
+ download_directory=download_directory,
190
+ )
191
+
192
+ return response
193
+
194
+ async def create(
195
+ self,
196
+ *,
197
+ style: params.V1AiVoiceGeneratorCreateBodyStyle,
198
+ name: typing.Union[
199
+ typing.Optional[str], type_utils.NotGiven
200
+ ] = type_utils.NOT_GIVEN,
201
+ request_options: typing.Optional[RequestOptions] = None,
202
+ ) -> models.V1AiVoiceGeneratorCreateResponse:
203
+ """
204
+ AI Voice Generator
205
+
206
+ Generate speech from text. Each character costs 0.05 credits. The cost is rounded up to the nearest whole number.
207
+
208
+ POST /v1/ai-voice-generator
209
+
210
+ Args:
211
+ name: The name of audio. This value is mainly used for your own identification of the audio.
212
+ style: The content used to generate speech.
213
+ request_options: Additional options to customize the HTTP request
214
+
215
+ Returns:
216
+ Success
217
+
218
+ Raises:
219
+ ApiError: A custom exception class that provides additional context
220
+ for API errors, including the HTTP status code and response body.
221
+
222
+ Examples:
223
+ ```py
224
+ await client.v1.ai_voice_generator.create(
225
+ style={"prompt": "Hello, how are you?", "voice_name": "Elon Musk"},
226
+ name="Voice Generator audio",
227
+ )
228
+ ```
229
+ """
230
+ _json = to_encodable(
231
+ item={"name": name, "style": style},
232
+ dump_with=params._SerializerV1AiVoiceGeneratorCreateBody,
233
+ )
234
+ return await self._base_client.request(
235
+ method="POST",
236
+ path="/v1/ai-voice-generator",
237
+ auth_names=["bearerAuth"],
238
+ json=_json,
239
+ cast_to=models.V1AiVoiceGeneratorCreateResponse,
240
+ request_options=request_options or default_request_options(),
241
+ )
@@ -2,6 +2,53 @@
2
2
 
3
3
  ## Module Functions
4
4
 
5
+ <!-- CUSTOM DOCS START -->
6
+
7
+ ### Check results <a name="check-result"></a>
8
+
9
+ Poll the details API to check on the status of the rendering. Optionally can also download the output
10
+
11
+ #### Parameters
12
+
13
+ | Parameter | Required | Description | Example |
14
+ | --------------------- | :------: | ---------------------------------------------------------------------------------------------------- | ---------------- |
15
+ | `id` | ✓ | Unique ID of the audio project. This value is returned by all of the POST APIs that create an audio. | `"cuid-example"` |
16
+ | `wait_for_completion` | ✗ | Whether to wait for the project to complete. | `True` |
17
+ | `download_outputs` | ✗ | Whether to download the generated files | `True` |
18
+ | `download_directory` | ✗ | Directory to save downloaded files (defaults to current directory) | `"./outputs"` |
19
+
20
+ #### Synchronous Client
21
+
22
+ ```python
23
+ from magic_hour import Client
24
+ from os import getenv
25
+
26
+ client = Client(token=getenv("API_TOKEN"))
27
+ res = client.v1.audio_projects.check_result(
28
+ id="cuid-example",
29
+ wait_for_completion=True,
30
+ download_outputs=True,
31
+ download_directory="outputs",
32
+ )
33
+
34
+ ```
35
+
36
+ #### Asynchronous Client
37
+
38
+ ```python
39
+ from magic_hour import AsyncClient
40
+ from os import getenv
41
+
42
+ client = AsyncClient(token=getenv("API_TOKEN"))
43
+ res = await client.v1.audio_projects.check_result(
44
+ id="cuid-example",
45
+ wait_for_completion=True,
46
+ download_outputs=True,
47
+ download_directory="outputs",
48
+ )
49
+ ```
50
+
51
+ <!-- CUSTOM DOCS END -->
5
52
  ### Delete audio <a name="delete"></a>
6
53
 
7
54
  Permanently delete the rendered audio file(s). This action is not reversible, please be sure before deleting.
@@ -0,0 +1,12 @@
1
+ from .client import (
2
+ AsyncAudioProjectsClient,
3
+ AudioProjectsClient,
4
+ V1AudioProjectsGetResponseWithDownloads,
5
+ )
6
+
7
+
8
+ __all__ = [
9
+ "AsyncAudioProjectsClient",
10
+ "AudioProjectsClient",
11
+ "V1AudioProjectsGetResponseWithDownloads",
12
+ ]
@@ -1,5 +1,10 @@
1
+ import os
2
+ import pydantic
3
+ import time
1
4
  import typing
2
5
 
6
+ from magic_hour.helpers.download import download_files_async, download_files_sync
7
+ from magic_hour.helpers.logger import get_sdk_logger
3
8
  from magic_hour.types import models
4
9
  from make_api_request import (
5
10
  AsyncBaseClient,
@@ -9,10 +14,83 @@ from make_api_request import (
9
14
  )
10
15
 
11
16
 
17
+ logger = get_sdk_logger(__name__)
18
+
19
+
20
+ class V1AudioProjectsGetResponseWithDownloads(models.V1AudioProjectsGetResponse):
21
+ downloaded_paths: typing.Optional[typing.List[str]] = pydantic.Field(
22
+ default=None, alias="downloaded_paths"
23
+ )
24
+ """
25
+ The paths to the downloaded files.
26
+
27
+ This field is only populated if `download_outputs` is True and the audio project is complete.
28
+ """
29
+
30
+
12
31
  class AudioProjectsClient:
13
32
  def __init__(self, *, base_client: SyncBaseClient):
14
33
  self._base_client = base_client
15
34
 
35
+ def check_result(
36
+ self,
37
+ id: str,
38
+ wait_for_completion: bool,
39
+ download_outputs: bool,
40
+ download_directory: typing.Optional[str] = None,
41
+ ) -> V1AudioProjectsGetResponseWithDownloads:
42
+ """
43
+ Check the result of an audio project with optional waiting and downloading.
44
+
45
+ This method retrieves the status of an audio project and optionally waits for completion
46
+ and downloads the output files.
47
+
48
+ Args:
49
+ id: Unique ID of the audio project
50
+ wait_for_completion: Whether to wait for the audio project to complete
51
+ download_outputs: Whether to download the outputs
52
+ download_directory: The directory to download the outputs to. If not provided,
53
+ the outputs will be downloaded to the current working directory
54
+
55
+ Returns:
56
+ V1AudioProjectsGetResponseWithDownloads: The audio project response with optional
57
+ downloaded file paths included
58
+ """
59
+ api_response = self.get(id=id)
60
+ if not wait_for_completion:
61
+ response = V1AudioProjectsGetResponseWithDownloads(
62
+ **api_response.model_dump()
63
+ )
64
+ return response
65
+
66
+ poll_interval = float(os.getenv("MAGIC_HOUR_POLL_INTERVAL", "0.5"))
67
+
68
+ status = api_response.status
69
+
70
+ while status not in ["complete", "error", "canceled"]:
71
+ api_response = self.get(id=id)
72
+ status = api_response.status
73
+ time.sleep(poll_interval)
74
+
75
+ if api_response.status != "complete":
76
+ log = logger.error if api_response.status == "error" else logger.info
77
+ log(
78
+ f"Audio project {id} has status {api_response.status}: {api_response.error}"
79
+ )
80
+ return V1AudioProjectsGetResponseWithDownloads(**api_response.model_dump())
81
+
82
+ if not download_outputs:
83
+ return V1AudioProjectsGetResponseWithDownloads(**api_response.model_dump())
84
+
85
+ downloaded_paths = download_files_sync(
86
+ downloads=api_response.downloads,
87
+ download_directory=download_directory,
88
+ )
89
+
90
+ return V1AudioProjectsGetResponseWithDownloads(
91
+ **api_response.model_dump(), downloaded_paths=downloaded_paths
92
+ )
93
+
16
94
  def delete(
17
95
  self, *, id: str, request_options: typing.Optional[RequestOptions] = None
18
96
  ) -> None:
@@ -95,6 +173,65 @@ class AsyncAudioProjectsClient:
95
173
  def __init__(self, *, base_client: AsyncBaseClient):
96
174
  self._base_client = base_client
97
175
 
176
+ async def check_result(
177
+ self,
178
+ id: str,
179
+ wait_for_completion: bool,
180
+ download_outputs: bool,
181
+ download_directory: typing.Optional[str] = None,
182
+ ) -> V1AudioProjectsGetResponseWithDownloads:
183
+ """
184
+ Check the result of an audio project with optional waiting and downloading.
185
+
186
+ This method retrieves the status of an audio project and optionally waits for completion
187
+ and downloads the output files.
188
+
189
+ Args:
190
+ id: Unique ID of the audio project
191
+ wait_for_completion: Whether to wait for the audio project to complete
192
+ download_outputs: Whether to download the outputs
193
+ download_directory: The directory to download the outputs to. If not provided,
194
+ the outputs will be downloaded to the current working directory
195
+
196
+ Returns:
197
+ V1AudioProjectsGetResponseWithDownloads: The audio project response with optional
198
+ downloaded file paths included
199
+ """
200
+ api_response = await self.get(id=id)
201
+ if not wait_for_completion:
202
+ response = V1AudioProjectsGetResponseWithDownloads(
203
+ **api_response.model_dump()
204
+ )
205
+ return response
206
+
207
+ poll_interval = float(os.getenv("MAGIC_HOUR_POLL_INTERVAL", "0.5"))
208
+
209
+ status = api_response.status
210
+
211
+ while status not in ["complete", "error", "canceled"]:
212
+ api_response = await self.get(id=id)
213
+ status = api_response.status
214
+ time.sleep(poll_interval)
215
+
216
+ if api_response.status != "complete":
217
+ log = logger.error if api_response.status == "error" else logger.info
218
+ log(
219
+ f"Audio project {id} has status {api_response.status}: {api_response.error}"
220
+ )
221
+ return V1AudioProjectsGetResponseWithDownloads(**api_response.model_dump())
222
+
223
+ if not download_outputs:
224
+ return V1AudioProjectsGetResponseWithDownloads(**api_response.model_dump())
225
+
226
+ downloaded_paths = await download_files_async(
227
+ downloads=api_response.downloads,
228
+ download_directory=download_directory,
229
+ )
230
+
231
+ return V1AudioProjectsGetResponseWithDownloads(
232
+ **api_response.model_dump(), downloaded_paths=downloaded_paths
233
+ )
234
+
98
235
  async def delete(
99
236
  self, *, id: str, request_options: typing.Optional[RequestOptions] = None
100
237
  ) -> None: