@@ -58,14 +58,10 @@ def text_to_image(
58
58
if retries == UNSET :
59
59
if self .sdk_configuration .retry_config is not UNSET :
60
60
retries = self .sdk_configuration .retry_config
61
- else :
62
- retries = utils .RetryConfig (
63
- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
64
- )
65
61
66
62
retry_config = None
67
63
if isinstance (retries , utils .RetryConfig ):
68
- retry_config = (retries , ["503" ])
64
+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
69
65
70
66
http_res = self .do_request (
71
67
hook_ctx = HookContext (
@@ -157,14 +153,10 @@ async def text_to_image_async(
157
153
if retries == UNSET :
158
154
if self .sdk_configuration .retry_config is not UNSET :
159
155
retries = self .sdk_configuration .retry_config
160
- else :
161
- retries = utils .RetryConfig (
162
- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
163
- )
164
156
165
157
retry_config = None
166
158
if isinstance (retries , utils .RetryConfig ):
167
- retry_config = (retries , ["503" ])
159
+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
168
160
169
161
http_res = await self .do_request_async (
170
162
hook_ctx = HookContext (
@@ -256,14 +248,10 @@ def image_to_image(
256
248
if retries == UNSET :
257
249
if self .sdk_configuration .retry_config is not UNSET :
258
250
retries = self .sdk_configuration .retry_config
259
- else :
260
- retries = utils .RetryConfig (
261
- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
262
- )
263
251
264
252
retry_config = None
265
253
if isinstance (retries , utils .RetryConfig ):
266
- retry_config = (retries , ["503" ])
254
+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
267
255
268
256
http_res = self .do_request (
269
257
hook_ctx = HookContext (
@@ -355,14 +343,10 @@ async def image_to_image_async(
355
343
if retries == UNSET :
356
344
if self .sdk_configuration .retry_config is not UNSET :
357
345
retries = self .sdk_configuration .retry_config
358
- else :
359
- retries = utils .RetryConfig (
360
- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
361
- )
362
346
363
347
retry_config = None
364
348
if isinstance (retries , utils .RetryConfig ):
365
- retry_config = (retries , ["503" ])
349
+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
366
350
367
351
http_res = await self .do_request_async (
368
352
hook_ctx = HookContext (
@@ -454,14 +438,10 @@ def image_to_video(
454
438
if retries == UNSET :
455
439
if self .sdk_configuration .retry_config is not UNSET :
456
440
retries = self .sdk_configuration .retry_config
457
- else :
458
- retries = utils .RetryConfig (
459
- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
460
- )
461
441
462
442
retry_config = None
463
443
if isinstance (retries , utils .RetryConfig ):
464
- retry_config = (retries , ["503" ])
444
+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
465
445
466
446
http_res = self .do_request (
467
447
hook_ctx = HookContext (
@@ -553,14 +533,10 @@ async def image_to_video_async(
553
533
if retries == UNSET :
554
534
if self .sdk_configuration .retry_config is not UNSET :
555
535
retries = self .sdk_configuration .retry_config
556
- else :
557
- retries = utils .RetryConfig (
558
- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
559
- )
560
536
561
537
retry_config = None
562
538
if isinstance (retries , utils .RetryConfig ):
563
- retry_config = (retries , ["503" ])
539
+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
564
540
565
541
http_res = await self .do_request_async (
566
542
hook_ctx = HookContext (
@@ -652,14 +628,10 @@ def upscale(
652
628
if retries == UNSET :
653
629
if self .sdk_configuration .retry_config is not UNSET :
654
630
retries = self .sdk_configuration .retry_config
655
- else :
656
- retries = utils .RetryConfig (
657
- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
658
- )
659
631
660
632
retry_config = None
661
633
if isinstance (retries , utils .RetryConfig ):
662
- retry_config = (retries , ["503" ])
634
+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
663
635
664
636
http_res = self .do_request (
665
637
hook_ctx = HookContext (
@@ -751,14 +723,10 @@ async def upscale_async(
751
723
if retries == UNSET :
752
724
if self .sdk_configuration .retry_config is not UNSET :
753
725
retries = self .sdk_configuration .retry_config
754
- else :
755
- retries = utils .RetryConfig (
756
- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
757
- )
758
726
759
727
retry_config = None
760
728
if isinstance (retries , utils .RetryConfig ):
761
- retry_config = (retries , ["503" ])
729
+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
762
730
763
731
http_res = await self .do_request_async (
764
732
hook_ctx = HookContext (
@@ -850,14 +818,10 @@ def audio_to_text(
850
818
if retries == UNSET :
851
819
if self .sdk_configuration .retry_config is not UNSET :
852
820
retries = self .sdk_configuration .retry_config
853
- else :
854
- retries = utils .RetryConfig (
855
- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
856
- )
857
821
858
822
retry_config = None
859
823
if isinstance (retries , utils .RetryConfig ):
860
- retry_config = (retries , ["503" ])
824
+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
861
825
862
826
http_res = self .do_request (
863
827
hook_ctx = HookContext (
@@ -951,14 +915,10 @@ async def audio_to_text_async(
951
915
if retries == UNSET :
952
916
if self .sdk_configuration .retry_config is not UNSET :
953
917
retries = self .sdk_configuration .retry_config
954
- else :
955
- retries = utils .RetryConfig (
956
- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
957
- )
958
918
959
919
retry_config = None
960
920
if isinstance (retries , utils .RetryConfig ):
961
- retry_config = (retries , ["503" ])
921
+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
962
922
963
923
http_res = await self .do_request_async (
964
924
hook_ctx = HookContext (
@@ -1054,14 +1014,10 @@ def segment_anything2(
1054
1014
if retries == UNSET :
1055
1015
if self .sdk_configuration .retry_config is not UNSET :
1056
1016
retries = self .sdk_configuration .retry_config
1057
- else :
1058
- retries = utils .RetryConfig (
1059
- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
1060
- )
1061
1017
1062
1018
retry_config = None
1063
1019
if isinstance (retries , utils .RetryConfig ):
1064
- retry_config = (retries , ["503" ])
1020
+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
1065
1021
1066
1022
http_res = self .do_request (
1067
1023
hook_ctx = HookContext (
@@ -1155,14 +1111,10 @@ async def segment_anything2_async(
1155
1111
if retries == UNSET :
1156
1112
if self .sdk_configuration .retry_config is not UNSET :
1157
1113
retries = self .sdk_configuration .retry_config
1158
- else :
1159
- retries = utils .RetryConfig (
1160
- "backoff" , utils .BackoffStrategy (500 , 60000 , 1.5 , 3600000 ), True
1161
- )
1162
1114
1163
1115
retry_config = None
1164
1116
if isinstance (retries , utils .RetryConfig ):
1165
- retry_config = (retries , ["503" ])
1117
+ retry_config = (retries , ["429" , "500" , "502" , " 503" , "504 " ])
1166
1118
1167
1119
http_res = await self .do_request_async (
1168
1120
hook_ctx = HookContext (
0 commit comments