14
14
from ..errors .bad_request_error import BadRequestError
15
15
from ..errors .internal_server_error import InternalServerError
16
16
from ..errors .not_found_error import NotFoundError
17
- from ..errors .payment_required_error import PaymentRequiredError
18
17
from ..errors .unprocessable_entity_error import UnprocessableEntityError
19
- from ..types .insufficient_credits_error import InsufficientCreditsError
20
18
from ..types .supported_ll_ms import SupportedLlMs
21
19
from ..types .task_created_response import TaskCreatedResponse
22
20
from ..types .task_list_response import TaskListResponse
@@ -230,17 +228,6 @@ def create_task(
230
228
),
231
229
),
232
230
)
233
- if _response .status_code == 402 :
234
- raise PaymentRequiredError (
235
- headers = dict (_response .headers ),
236
- body = typing .cast (
237
- InsufficientCreditsError ,
238
- construct_type (
239
- type_ = InsufficientCreditsError , # type: ignore
240
- object_ = _response .json (),
241
- ),
242
- ),
243
- )
244
231
if _response .status_code == 404 :
245
232
raise NotFoundError (
246
233
headers = dict (_response .headers ),
@@ -263,17 +250,6 @@ def create_task(
263
250
),
264
251
),
265
252
)
266
- if _response .status_code == 500 :
267
- raise InternalServerError (
268
- headers = dict (_response .headers ),
269
- body = typing .cast (
270
- typing .Optional [typing .Any ],
271
- construct_type (
272
- type_ = typing .Optional [typing .Any ], # type: ignore
273
- object_ = _response .json (),
274
- ),
275
- ),
276
- )
277
253
_response_json = _response .json ()
278
254
except JSONDecodeError :
279
255
raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response .text )
@@ -682,17 +658,6 @@ async def create_task(
682
658
),
683
659
),
684
660
)
685
- if _response .status_code == 402 :
686
- raise PaymentRequiredError (
687
- headers = dict (_response .headers ),
688
- body = typing .cast (
689
- InsufficientCreditsError ,
690
- construct_type (
691
- type_ = InsufficientCreditsError , # type: ignore
692
- object_ = _response .json (),
693
- ),
694
- ),
695
- )
696
661
if _response .status_code == 404 :
697
662
raise NotFoundError (
698
663
headers = dict (_response .headers ),
@@ -715,17 +680,6 @@ async def create_task(
715
680
),
716
681
),
717
682
)
718
- if _response .status_code == 500 :
719
- raise InternalServerError (
720
- headers = dict (_response .headers ),
721
- body = typing .cast (
722
- typing .Optional [typing .Any ],
723
- construct_type (
724
- type_ = typing .Optional [typing .Any ], # type: ignore
725
- object_ = _response .json (),
726
- ),
727
- ),
728
- )
729
683
_response_json = _response .json ()
730
684
except JSONDecodeError :
731
685
raise ApiError (status_code = _response .status_code , headers = dict (_response .headers ), body = _response .text )
0 commit comments