@@ -58,10 +58,14 @@ def text_to_image(
5858 if retries == UNSET :
5959 if self .sdk_configuration .retry_config is not UNSET :
6060 retries = self .sdk_configuration .retry_config
61+ else :
62+ retries = utils .RetryConfig (
63+ "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
64+ )
6165
6266 retry_config = None
6367 if isinstance (retries , utils .RetryConfig ):
64- retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
68+ retry_config = (retries , ["503" ])
6569
6670 http_res = self .do_request (
6771 hook_ctx = HookContext (
@@ -153,10 +157,14 @@ async def text_to_image_async(
153157 if retries == UNSET :
154158 if self .sdk_configuration .retry_config is not UNSET :
155159 retries = self .sdk_configuration .retry_config
160+ else :
161+ retries = utils .RetryConfig (
162+ "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
163+ )
156164
157165 retry_config = None
158166 if isinstance (retries , utils .RetryConfig ):
159- retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
167+ retry_config = (retries , ["503" ])
160168
161169 http_res = await self .do_request_async (
162170 hook_ctx = HookContext (
@@ -248,10 +256,14 @@ def image_to_image(
248256 if retries == UNSET :
249257 if self .sdk_configuration .retry_config is not UNSET :
250258 retries = self .sdk_configuration .retry_config
259+ else :
260+ retries = utils .RetryConfig (
261+ "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
262+ )
251263
252264 retry_config = None
253265 if isinstance (retries , utils .RetryConfig ):
254- retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
266+ retry_config = (retries , ["503" ])
255267
256268 http_res = self .do_request (
257269 hook_ctx = HookContext (
@@ -343,10 +355,14 @@ async def image_to_image_async(
343355 if retries == UNSET :
344356 if self .sdk_configuration .retry_config is not UNSET :
345357 retries = self .sdk_configuration .retry_config
358+ else :
359+ retries = utils .RetryConfig (
360+ "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
361+ )
346362
347363 retry_config = None
348364 if isinstance (retries , utils .RetryConfig ):
349- retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
365+ retry_config = (retries , ["503" ])
350366
351367 http_res = await self .do_request_async (
352368 hook_ctx = HookContext (
@@ -438,10 +454,14 @@ def image_to_video(
438454 if retries == UNSET :
439455 if self .sdk_configuration .retry_config is not UNSET :
440456 retries = self .sdk_configuration .retry_config
457+ else :
458+ retries = utils .RetryConfig (
459+ "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
460+ )
441461
442462 retry_config = None
443463 if isinstance (retries , utils .RetryConfig ):
444- retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
464+ retry_config = (retries , ["503" ])
445465
446466 http_res = self .do_request (
447467 hook_ctx = HookContext (
@@ -533,10 +553,14 @@ async def image_to_video_async(
533553 if retries == UNSET :
534554 if self .sdk_configuration .retry_config is not UNSET :
535555 retries = self .sdk_configuration .retry_config
556+ else :
557+ retries = utils .RetryConfig (
558+ "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
559+ )
536560
537561 retry_config = None
538562 if isinstance (retries , utils .RetryConfig ):
539- retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
563+ retry_config = (retries , ["503" ])
540564
541565 http_res = await self .do_request_async (
542566 hook_ctx = HookContext (
@@ -628,10 +652,14 @@ def upscale(
628652 if retries == UNSET :
629653 if self .sdk_configuration .retry_config is not UNSET :
630654 retries = self .sdk_configuration .retry_config
655+ else :
656+ retries = utils .RetryConfig (
657+ "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
658+ )
631659
632660 retry_config = None
633661 if isinstance (retries , utils .RetryConfig ):
634- retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
662+ retry_config = (retries , ["503" ])
635663
636664 http_res = self .do_request (
637665 hook_ctx = HookContext (
@@ -723,10 +751,14 @@ async def upscale_async(
723751 if retries == UNSET :
724752 if self .sdk_configuration .retry_config is not UNSET :
725753 retries = self .sdk_configuration .retry_config
754+ else :
755+ retries = utils .RetryConfig (
756+ "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
757+ )
726758
727759 retry_config = None
728760 if isinstance (retries , utils .RetryConfig ):
729- retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
761+ retry_config = (retries , ["503" ])
730762
731763 http_res = await self .do_request_async (
732764 hook_ctx = HookContext (
@@ -818,10 +850,14 @@ def audio_to_text(
818850 if retries == UNSET :
819851 if self .sdk_configuration .retry_config is not UNSET :
820852 retries = self .sdk_configuration .retry_config
853+ else :
854+ retries = utils .RetryConfig (
855+ "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
856+ )
821857
822858 retry_config = None
823859 if isinstance (retries , utils .RetryConfig ):
824- retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
860+ retry_config = (retries , ["503" ])
825861
826862 http_res = self .do_request (
827863 hook_ctx = HookContext (
@@ -915,10 +951,14 @@ async def audio_to_text_async(
915951 if retries == UNSET :
916952 if self .sdk_configuration .retry_config is not UNSET :
917953 retries = self .sdk_configuration .retry_config
954+ else :
955+ retries = utils .RetryConfig (
956+ "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
957+ )
918958
919959 retry_config = None
920960 if isinstance (retries , utils .RetryConfig ):
921- retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
961+ retry_config = (retries , ["503" ])
922962
923963 http_res = await self .do_request_async (
924964 hook_ctx = HookContext (
@@ -1014,10 +1054,14 @@ def segment_anything2(
10141054 if retries == UNSET :
10151055 if self .sdk_configuration .retry_config is not UNSET :
10161056 retries = self .sdk_configuration .retry_config
1057+ else :
1058+ retries = utils .RetryConfig (
1059+ "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
1060+ )
10171061
10181062 retry_config = None
10191063 if isinstance (retries , utils .RetryConfig ):
1020- retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
1064+ retry_config = (retries , ["503" ])
10211065
10221066 http_res = self .do_request (
10231067 hook_ctx = HookContext (
@@ -1111,10 +1155,14 @@ async def segment_anything2_async(
11111155 if retries == UNSET :
11121156 if self .sdk_configuration .retry_config is not UNSET :
11131157 retries = self .sdk_configuration .retry_config
1158+ else :
1159+ retries = utils .RetryConfig (
1160+ "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
1161+ )
11141162
11151163 retry_config = None
11161164 if isinstance (retries , utils .RetryConfig ):
1117- retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
1165+ retry_config = (retries , ["503" ])
11181166
11191167 http_res = await self .do_request_async (
11201168 hook_ctx = HookContext (
0 commit comments