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