mistralai 1.9.10__py3-none-any.whl → 1.10.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mistralai/_hooks/registration.py +5 -0
- mistralai/_hooks/tracing.py +50 -0
- mistralai/_version.py +3 -3
- mistralai/accesses.py +51 -116
- mistralai/agents.py +58 -85
- mistralai/audio.py +8 -3
- mistralai/basesdk.py +15 -5
- mistralai/batch.py +6 -3
- mistralai/beta.py +10 -5
- mistralai/chat.py +70 -97
- mistralai/classifiers.py +57 -144
- mistralai/conversations.py +435 -412
- mistralai/documents.py +156 -359
- mistralai/embeddings.py +21 -42
- mistralai/extra/observability/__init__.py +15 -0
- mistralai/extra/observability/otel.py +393 -0
- mistralai/extra/run/tools.py +28 -16
- mistralai/files.py +53 -176
- mistralai/fim.py +46 -73
- mistralai/fine_tuning.py +6 -3
- mistralai/jobs.py +49 -158
- mistralai/libraries.py +71 -178
- mistralai/mistral_agents.py +298 -179
- mistralai/mistral_jobs.py +51 -138
- mistralai/models/__init__.py +94 -5
- mistralai/models/agent.py +15 -2
- mistralai/models/agentconversation.py +11 -3
- mistralai/models/agentcreationrequest.py +6 -2
- mistralai/models/agents_api_v1_agents_deleteop.py +16 -0
- mistralai/models/agents_api_v1_agents_getop.py +40 -3
- mistralai/models/agents_api_v1_agents_listop.py +72 -2
- mistralai/models/agents_api_v1_conversations_deleteop.py +18 -0
- mistralai/models/agents_api_v1_conversations_listop.py +39 -2
- mistralai/models/agentscompletionrequest.py +21 -6
- mistralai/models/agentscompletionstreamrequest.py +21 -6
- mistralai/models/agentupdaterequest.py +18 -2
- mistralai/models/audiotranscriptionrequest.py +2 -0
- mistralai/models/batchjobin.py +10 -0
- mistralai/models/chatcompletionrequest.py +22 -5
- mistralai/models/chatcompletionstreamrequest.py +22 -5
- mistralai/models/conversationrequest.py +15 -4
- mistralai/models/conversationrestartrequest.py +50 -2
- mistralai/models/conversationrestartstreamrequest.py +50 -2
- mistralai/models/conversationstreamrequest.py +15 -4
- mistralai/models/documentout.py +26 -10
- mistralai/models/documentupdatein.py +24 -3
- mistralai/models/embeddingrequest.py +8 -8
- mistralai/models/files_api_routes_list_filesop.py +7 -0
- mistralai/models/fimcompletionrequest.py +8 -9
- mistralai/models/fimcompletionstreamrequest.py +8 -9
- mistralai/models/httpvalidationerror.py +11 -6
- mistralai/models/libraries_documents_list_v1op.py +15 -2
- mistralai/models/libraryout.py +10 -7
- mistralai/models/listfilesout.py +35 -4
- mistralai/models/mistralerror.py +26 -0
- mistralai/models/modelcapabilities.py +13 -4
- mistralai/models/modelconversation.py +8 -2
- mistralai/models/no_response_error.py +13 -0
- mistralai/models/ocrpageobject.py +26 -5
- mistralai/models/ocrrequest.py +17 -1
- mistralai/models/ocrtableobject.py +31 -0
- mistralai/models/prediction.py +4 -0
- mistralai/models/requestsource.py +7 -0
- mistralai/models/responseformat.py +4 -2
- mistralai/models/responseformats.py +0 -1
- mistralai/models/responsevalidationerror.py +25 -0
- mistralai/models/sdkerror.py +30 -14
- mistralai/models/sharingdelete.py +36 -5
- mistralai/models/sharingin.py +36 -5
- mistralai/models/sharingout.py +3 -3
- mistralai/models/toolexecutiondeltaevent.py +13 -4
- mistralai/models/toolexecutiondoneevent.py +13 -4
- mistralai/models/toolexecutionentry.py +9 -4
- mistralai/models/toolexecutionstartedevent.py +13 -4
- mistralai/models_.py +67 -212
- mistralai/ocr.py +33 -36
- mistralai/sdk.py +15 -2
- mistralai/transcriptions.py +21 -60
- mistralai/utils/__init__.py +18 -5
- mistralai/utils/eventstreaming.py +10 -0
- mistralai/utils/serializers.py +3 -2
- mistralai/utils/unmarshal_json_response.py +24 -0
- {mistralai-1.9.10.dist-info → mistralai-1.10.0.dist-info}/METADATA +89 -40
- {mistralai-1.9.10.dist-info → mistralai-1.10.0.dist-info}/RECORD +86 -75
- {mistralai-1.9.10.dist-info → mistralai-1.10.0.dist-info}/WHEEL +1 -1
- {mistralai-1.9.10.dist-info → mistralai-1.10.0.dist-info/licenses}/LICENSE +0 -0
mistralai/libraries.py
CHANGED
|
@@ -8,6 +8,7 @@ from mistralai.accesses import Accesses
|
|
|
8
8
|
from mistralai.documents import Documents
|
|
9
9
|
from mistralai.types import OptionalNullable, UNSET
|
|
10
10
|
from mistralai.utils import get_security_from_env
|
|
11
|
+
from mistralai.utils.unmarshal_json_response import unmarshal_json_response
|
|
11
12
|
from typing import Any, Mapping, Optional
|
|
12
13
|
|
|
13
14
|
|
|
@@ -19,14 +20,16 @@ class Libraries(BaseSDK):
|
|
|
19
20
|
accesses: Accesses
|
|
20
21
|
r"""(beta) Libraries API - manage access to a library."""
|
|
21
22
|
|
|
22
|
-
def __init__(
|
|
23
|
-
|
|
23
|
+
def __init__(
|
|
24
|
+
self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
|
|
25
|
+
) -> None:
|
|
26
|
+
BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
|
|
24
27
|
self.sdk_configuration = sdk_config
|
|
25
28
|
self._init_sdks()
|
|
26
29
|
|
|
27
30
|
def _init_sdks(self):
|
|
28
|
-
self.documents = Documents(self.sdk_configuration)
|
|
29
|
-
self.accesses = Accesses(self.sdk_configuration)
|
|
31
|
+
self.documents = Documents(self.sdk_configuration, parent_ref=self.parent_ref)
|
|
32
|
+
self.accesses = Accesses(self.sdk_configuration, parent_ref=self.parent_ref)
|
|
30
33
|
|
|
31
34
|
def list(
|
|
32
35
|
self,
|
|
@@ -94,26 +97,15 @@ class Libraries(BaseSDK):
|
|
|
94
97
|
)
|
|
95
98
|
|
|
96
99
|
if utils.match_response(http_res, "200", "application/json"):
|
|
97
|
-
return
|
|
100
|
+
return unmarshal_json_response(models.ListLibraryOut, http_res)
|
|
98
101
|
if utils.match_response(http_res, "4XX", "*"):
|
|
99
102
|
http_res_text = utils.stream_to_text(http_res)
|
|
100
|
-
raise models.SDKError(
|
|
101
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
102
|
-
)
|
|
103
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
103
104
|
if utils.match_response(http_res, "5XX", "*"):
|
|
104
105
|
http_res_text = utils.stream_to_text(http_res)
|
|
105
|
-
raise models.SDKError(
|
|
106
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
107
|
-
)
|
|
106
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
108
107
|
|
|
109
|
-
|
|
110
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
111
|
-
raise models.SDKError(
|
|
112
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
113
|
-
http_res.status_code,
|
|
114
|
-
http_res_text,
|
|
115
|
-
http_res,
|
|
116
|
-
)
|
|
108
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
117
109
|
|
|
118
110
|
async def list_async(
|
|
119
111
|
self,
|
|
@@ -181,26 +173,15 @@ class Libraries(BaseSDK):
|
|
|
181
173
|
)
|
|
182
174
|
|
|
183
175
|
if utils.match_response(http_res, "200", "application/json"):
|
|
184
|
-
return
|
|
176
|
+
return unmarshal_json_response(models.ListLibraryOut, http_res)
|
|
185
177
|
if utils.match_response(http_res, "4XX", "*"):
|
|
186
178
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
187
|
-
raise models.SDKError(
|
|
188
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
189
|
-
)
|
|
179
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
190
180
|
if utils.match_response(http_res, "5XX", "*"):
|
|
191
181
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
192
|
-
raise models.SDKError(
|
|
193
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
194
|
-
)
|
|
182
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
195
183
|
|
|
196
|
-
|
|
197
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
198
|
-
raise models.SDKError(
|
|
199
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
200
|
-
http_res.status_code,
|
|
201
|
-
http_res_text,
|
|
202
|
-
http_res,
|
|
203
|
-
)
|
|
184
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
204
185
|
|
|
205
186
|
def create(
|
|
206
187
|
self,
|
|
@@ -285,31 +266,20 @@ class Libraries(BaseSDK):
|
|
|
285
266
|
|
|
286
267
|
response_data: Any = None
|
|
287
268
|
if utils.match_response(http_res, "201", "application/json"):
|
|
288
|
-
return
|
|
269
|
+
return unmarshal_json_response(models.LibraryOut, http_res)
|
|
289
270
|
if utils.match_response(http_res, "422", "application/json"):
|
|
290
|
-
response_data =
|
|
291
|
-
|
|
271
|
+
response_data = unmarshal_json_response(
|
|
272
|
+
models.HTTPValidationErrorData, http_res
|
|
292
273
|
)
|
|
293
|
-
raise models.HTTPValidationError(
|
|
274
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
294
275
|
if utils.match_response(http_res, "4XX", "*"):
|
|
295
276
|
http_res_text = utils.stream_to_text(http_res)
|
|
296
|
-
raise models.SDKError(
|
|
297
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
298
|
-
)
|
|
277
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
299
278
|
if utils.match_response(http_res, "5XX", "*"):
|
|
300
279
|
http_res_text = utils.stream_to_text(http_res)
|
|
301
|
-
raise models.SDKError(
|
|
302
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
303
|
-
)
|
|
280
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
304
281
|
|
|
305
|
-
|
|
306
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
307
|
-
raise models.SDKError(
|
|
308
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
309
|
-
http_res.status_code,
|
|
310
|
-
http_res_text,
|
|
311
|
-
http_res,
|
|
312
|
-
)
|
|
282
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
313
283
|
|
|
314
284
|
async def create_async(
|
|
315
285
|
self,
|
|
@@ -394,31 +364,20 @@ class Libraries(BaseSDK):
|
|
|
394
364
|
|
|
395
365
|
response_data: Any = None
|
|
396
366
|
if utils.match_response(http_res, "201", "application/json"):
|
|
397
|
-
return
|
|
367
|
+
return unmarshal_json_response(models.LibraryOut, http_res)
|
|
398
368
|
if utils.match_response(http_res, "422", "application/json"):
|
|
399
|
-
response_data =
|
|
400
|
-
|
|
369
|
+
response_data = unmarshal_json_response(
|
|
370
|
+
models.HTTPValidationErrorData, http_res
|
|
401
371
|
)
|
|
402
|
-
raise models.HTTPValidationError(
|
|
372
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
403
373
|
if utils.match_response(http_res, "4XX", "*"):
|
|
404
374
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
405
|
-
raise models.SDKError(
|
|
406
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
407
|
-
)
|
|
375
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
408
376
|
if utils.match_response(http_res, "5XX", "*"):
|
|
409
377
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
410
|
-
raise models.SDKError(
|
|
411
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
412
|
-
)
|
|
378
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
413
379
|
|
|
414
|
-
|
|
415
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
416
|
-
raise models.SDKError(
|
|
417
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
418
|
-
http_res.status_code,
|
|
419
|
-
http_res_text,
|
|
420
|
-
http_res,
|
|
421
|
-
)
|
|
380
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
422
381
|
|
|
423
382
|
def get(
|
|
424
383
|
self,
|
|
@@ -494,31 +453,20 @@ class Libraries(BaseSDK):
|
|
|
494
453
|
|
|
495
454
|
response_data: Any = None
|
|
496
455
|
if utils.match_response(http_res, "200", "application/json"):
|
|
497
|
-
return
|
|
456
|
+
return unmarshal_json_response(models.LibraryOut, http_res)
|
|
498
457
|
if utils.match_response(http_res, "422", "application/json"):
|
|
499
|
-
response_data =
|
|
500
|
-
|
|
458
|
+
response_data = unmarshal_json_response(
|
|
459
|
+
models.HTTPValidationErrorData, http_res
|
|
501
460
|
)
|
|
502
|
-
raise models.HTTPValidationError(
|
|
461
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
503
462
|
if utils.match_response(http_res, "4XX", "*"):
|
|
504
463
|
http_res_text = utils.stream_to_text(http_res)
|
|
505
|
-
raise models.SDKError(
|
|
506
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
507
|
-
)
|
|
464
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
508
465
|
if utils.match_response(http_res, "5XX", "*"):
|
|
509
466
|
http_res_text = utils.stream_to_text(http_res)
|
|
510
|
-
raise models.SDKError(
|
|
511
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
512
|
-
)
|
|
467
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
513
468
|
|
|
514
|
-
|
|
515
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
516
|
-
raise models.SDKError(
|
|
517
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
518
|
-
http_res.status_code,
|
|
519
|
-
http_res_text,
|
|
520
|
-
http_res,
|
|
521
|
-
)
|
|
469
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
522
470
|
|
|
523
471
|
async def get_async(
|
|
524
472
|
self,
|
|
@@ -594,31 +542,20 @@ class Libraries(BaseSDK):
|
|
|
594
542
|
|
|
595
543
|
response_data: Any = None
|
|
596
544
|
if utils.match_response(http_res, "200", "application/json"):
|
|
597
|
-
return
|
|
545
|
+
return unmarshal_json_response(models.LibraryOut, http_res)
|
|
598
546
|
if utils.match_response(http_res, "422", "application/json"):
|
|
599
|
-
response_data =
|
|
600
|
-
|
|
547
|
+
response_data = unmarshal_json_response(
|
|
548
|
+
models.HTTPValidationErrorData, http_res
|
|
601
549
|
)
|
|
602
|
-
raise models.HTTPValidationError(
|
|
550
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
603
551
|
if utils.match_response(http_res, "4XX", "*"):
|
|
604
552
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
605
|
-
raise models.SDKError(
|
|
606
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
607
|
-
)
|
|
553
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
608
554
|
if utils.match_response(http_res, "5XX", "*"):
|
|
609
555
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
610
|
-
raise models.SDKError(
|
|
611
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
612
|
-
)
|
|
556
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
613
557
|
|
|
614
|
-
|
|
615
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
616
|
-
raise models.SDKError(
|
|
617
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
618
|
-
http_res.status_code,
|
|
619
|
-
http_res_text,
|
|
620
|
-
http_res,
|
|
621
|
-
)
|
|
558
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
622
559
|
|
|
623
560
|
def delete(
|
|
624
561
|
self,
|
|
@@ -694,31 +631,20 @@ class Libraries(BaseSDK):
|
|
|
694
631
|
|
|
695
632
|
response_data: Any = None
|
|
696
633
|
if utils.match_response(http_res, "200", "application/json"):
|
|
697
|
-
return
|
|
634
|
+
return unmarshal_json_response(models.LibraryOut, http_res)
|
|
698
635
|
if utils.match_response(http_res, "422", "application/json"):
|
|
699
|
-
response_data =
|
|
700
|
-
|
|
636
|
+
response_data = unmarshal_json_response(
|
|
637
|
+
models.HTTPValidationErrorData, http_res
|
|
701
638
|
)
|
|
702
|
-
raise models.HTTPValidationError(
|
|
639
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
703
640
|
if utils.match_response(http_res, "4XX", "*"):
|
|
704
641
|
http_res_text = utils.stream_to_text(http_res)
|
|
705
|
-
raise models.SDKError(
|
|
706
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
707
|
-
)
|
|
642
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
708
643
|
if utils.match_response(http_res, "5XX", "*"):
|
|
709
644
|
http_res_text = utils.stream_to_text(http_res)
|
|
710
|
-
raise models.SDKError(
|
|
711
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
712
|
-
)
|
|
645
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
713
646
|
|
|
714
|
-
|
|
715
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
716
|
-
raise models.SDKError(
|
|
717
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
718
|
-
http_res.status_code,
|
|
719
|
-
http_res_text,
|
|
720
|
-
http_res,
|
|
721
|
-
)
|
|
647
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
722
648
|
|
|
723
649
|
async def delete_async(
|
|
724
650
|
self,
|
|
@@ -794,31 +720,20 @@ class Libraries(BaseSDK):
|
|
|
794
720
|
|
|
795
721
|
response_data: Any = None
|
|
796
722
|
if utils.match_response(http_res, "200", "application/json"):
|
|
797
|
-
return
|
|
723
|
+
return unmarshal_json_response(models.LibraryOut, http_res)
|
|
798
724
|
if utils.match_response(http_res, "422", "application/json"):
|
|
799
|
-
response_data =
|
|
800
|
-
|
|
725
|
+
response_data = unmarshal_json_response(
|
|
726
|
+
models.HTTPValidationErrorData, http_res
|
|
801
727
|
)
|
|
802
|
-
raise models.HTTPValidationError(
|
|
728
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
803
729
|
if utils.match_response(http_res, "4XX", "*"):
|
|
804
730
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
805
|
-
raise models.SDKError(
|
|
806
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
807
|
-
)
|
|
731
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
808
732
|
if utils.match_response(http_res, "5XX", "*"):
|
|
809
733
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
810
|
-
raise models.SDKError(
|
|
811
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
812
|
-
)
|
|
734
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
813
735
|
|
|
814
|
-
|
|
815
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
816
|
-
raise models.SDKError(
|
|
817
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
818
|
-
http_res.status_code,
|
|
819
|
-
http_res_text,
|
|
820
|
-
http_res,
|
|
821
|
-
)
|
|
736
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
822
737
|
|
|
823
738
|
def update(
|
|
824
739
|
self,
|
|
@@ -905,31 +820,20 @@ class Libraries(BaseSDK):
|
|
|
905
820
|
|
|
906
821
|
response_data: Any = None
|
|
907
822
|
if utils.match_response(http_res, "200", "application/json"):
|
|
908
|
-
return
|
|
823
|
+
return unmarshal_json_response(models.LibraryOut, http_res)
|
|
909
824
|
if utils.match_response(http_res, "422", "application/json"):
|
|
910
|
-
response_data =
|
|
911
|
-
|
|
825
|
+
response_data = unmarshal_json_response(
|
|
826
|
+
models.HTTPValidationErrorData, http_res
|
|
912
827
|
)
|
|
913
|
-
raise models.HTTPValidationError(
|
|
828
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
914
829
|
if utils.match_response(http_res, "4XX", "*"):
|
|
915
830
|
http_res_text = utils.stream_to_text(http_res)
|
|
916
|
-
raise models.SDKError(
|
|
917
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
918
|
-
)
|
|
831
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
919
832
|
if utils.match_response(http_res, "5XX", "*"):
|
|
920
833
|
http_res_text = utils.stream_to_text(http_res)
|
|
921
|
-
raise models.SDKError(
|
|
922
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
923
|
-
)
|
|
834
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
924
835
|
|
|
925
|
-
|
|
926
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
927
|
-
raise models.SDKError(
|
|
928
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
929
|
-
http_res.status_code,
|
|
930
|
-
http_res_text,
|
|
931
|
-
http_res,
|
|
932
|
-
)
|
|
836
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
933
837
|
|
|
934
838
|
async def update_async(
|
|
935
839
|
self,
|
|
@@ -1016,28 +920,17 @@ class Libraries(BaseSDK):
|
|
|
1016
920
|
|
|
1017
921
|
response_data: Any = None
|
|
1018
922
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1019
|
-
return
|
|
923
|
+
return unmarshal_json_response(models.LibraryOut, http_res)
|
|
1020
924
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1021
|
-
response_data =
|
|
1022
|
-
|
|
925
|
+
response_data = unmarshal_json_response(
|
|
926
|
+
models.HTTPValidationErrorData, http_res
|
|
1023
927
|
)
|
|
1024
|
-
raise models.HTTPValidationError(
|
|
928
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1025
929
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1026
930
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1027
|
-
raise models.SDKError(
|
|
1028
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1029
|
-
)
|
|
931
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1030
932
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1031
933
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1032
|
-
raise models.SDKError(
|
|
1033
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1034
|
-
)
|
|
934
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1035
935
|
|
|
1036
|
-
|
|
1037
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1038
|
-
raise models.SDKError(
|
|
1039
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1040
|
-
http_res.status_code,
|
|
1041
|
-
http_res_text,
|
|
1042
|
-
http_res,
|
|
1043
|
-
)
|
|
936
|
+
raise models.SDKError("Unexpected response received", http_res)
|