@@ -58,14 +58,10 @@ 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- )
6561
6662 retry_config = None
6763 if isinstance (retries , utils .RetryConfig ):
68- retry_config = (retries , ["503" ])
64+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
6965
7066 http_res = self .do_request (
7167 hook_ctx = HookContext (
@@ -157,14 +153,10 @@ async def text_to_image_async(
157153 if retries == UNSET :
158154 if self .sdk_configuration .retry_config is not UNSET :
159155 retries = self .sdk_configuration .retry_config
160- else :
161- retries = utils .RetryConfig (
162- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
163- )
164156
165157 retry_config = None
166158 if isinstance (retries , utils .RetryConfig ):
167- retry_config = (retries , ["503" ])
159+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
168160
169161 http_res = await self .do_request_async (
170162 hook_ctx = HookContext (
@@ -256,14 +248,10 @@ def image_to_image(
256248 if retries == UNSET :
257249 if self .sdk_configuration .retry_config is not UNSET :
258250 retries = self .sdk_configuration .retry_config
259- else :
260- retries = utils .RetryConfig (
261- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
262- )
263251
264252 retry_config = None
265253 if isinstance (retries , utils .RetryConfig ):
266- retry_config = (retries , ["503" ])
254+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
267255
268256 http_res = self .do_request (
269257 hook_ctx = HookContext (
@@ -355,14 +343,10 @@ async def image_to_image_async(
355343 if retries == UNSET :
356344 if self .sdk_configuration .retry_config is not UNSET :
357345 retries = self .sdk_configuration .retry_config
358- else :
359- retries = utils .RetryConfig (
360- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
361- )
362346
363347 retry_config = None
364348 if isinstance (retries , utils .RetryConfig ):
365- retry_config = (retries , ["503" ])
349+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
366350
367351 http_res = await self .do_request_async (
368352 hook_ctx = HookContext (
@@ -454,14 +438,10 @@ def image_to_video(
454438 if retries == UNSET :
455439 if self .sdk_configuration .retry_config is not UNSET :
456440 retries = self .sdk_configuration .retry_config
457- else :
458- retries = utils .RetryConfig (
459- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
460- )
461441
462442 retry_config = None
463443 if isinstance (retries , utils .RetryConfig ):
464- retry_config = (retries , ["503" ])
444+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
465445
466446 http_res = self .do_request (
467447 hook_ctx = HookContext (
@@ -553,14 +533,10 @@ async def image_to_video_async(
553533 if retries == UNSET :
554534 if self .sdk_configuration .retry_config is not UNSET :
555535 retries = self .sdk_configuration .retry_config
556- else :
557- retries = utils .RetryConfig (
558- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
559- )
560536
561537 retry_config = None
562538 if isinstance (retries , utils .RetryConfig ):
563- retry_config = (retries , ["503" ])
539+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
564540
565541 http_res = await self .do_request_async (
566542 hook_ctx = HookContext (
@@ -652,14 +628,10 @@ def upscale(
652628 if retries == UNSET :
653629 if self .sdk_configuration .retry_config is not UNSET :
654630 retries = self .sdk_configuration .retry_config
655- else :
656- retries = utils .RetryConfig (
657- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
658- )
659631
660632 retry_config = None
661633 if isinstance (retries , utils .RetryConfig ):
662- retry_config = (retries , ["503" ])
634+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
663635
664636 http_res = self .do_request (
665637 hook_ctx = HookContext (
@@ -751,14 +723,10 @@ async def upscale_async(
751723 if retries == UNSET :
752724 if self .sdk_configuration .retry_config is not UNSET :
753725 retries = self .sdk_configuration .retry_config
754- else :
755- retries = utils .RetryConfig (
756- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
757- )
758726
759727 retry_config = None
760728 if isinstance (retries , utils .RetryConfig ):
761- retry_config = (retries , ["503" ])
729+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
762730
763731 http_res = await self .do_request_async (
764732 hook_ctx = HookContext (
@@ -850,14 +818,10 @@ def audio_to_text(
850818 if retries == UNSET :
851819 if self .sdk_configuration .retry_config is not UNSET :
852820 retries = self .sdk_configuration .retry_config
853- else :
854- retries = utils .RetryConfig (
855- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
856- )
857821
858822 retry_config = None
859823 if isinstance (retries , utils .RetryConfig ):
860- retry_config = (retries , ["503" ])
824+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
861825
862826 http_res = self .do_request (
863827 hook_ctx = HookContext (
@@ -951,14 +915,10 @@ async def audio_to_text_async(
951915 if retries == UNSET :
952916 if self .sdk_configuration .retry_config is not UNSET :
953917 retries = self .sdk_configuration .retry_config
954- else :
955- retries = utils .RetryConfig (
956- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
957- )
958918
959919 retry_config = None
960920 if isinstance (retries , utils .RetryConfig ):
961- retry_config = (retries , ["503" ])
921+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
962922
963923 http_res = await self .do_request_async (
964924 hook_ctx = HookContext (
@@ -1054,14 +1014,10 @@ def segment_anything2(
10541014 if retries == UNSET :
10551015 if self .sdk_configuration .retry_config is not UNSET :
10561016 retries = self .sdk_configuration .retry_config
1057- else :
1058- retries = utils .RetryConfig (
1059- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
1060- )
10611017
10621018 retry_config = None
10631019 if isinstance (retries , utils .RetryConfig ):
1064- retry_config = (retries , ["503" ])
1020+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
10651021
10661022 http_res = self .do_request (
10671023 hook_ctx = HookContext (
@@ -1155,14 +1111,10 @@ async def segment_anything2_async(
11551111 if retries == UNSET :
11561112 if self .sdk_configuration .retry_config is not UNSET :
11571113 retries = self .sdk_configuration .retry_config
1158- else :
1159- retries = utils .RetryConfig (
1160- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
1161- )
11621114
11631115 retry_config = None
11641116 if isinstance (retries , utils .RetryConfig ):
1165- retry_config = (retries , ["503" ])
1117+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
11661118
11671119 http_res = await self .do_request_async (
11681120 hook_ctx = HookContext (
0 commit comments