usecortex-ai 0.2.1__py3-none-any.whl → 0.3.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.
Files changed (61) hide show
  1. usecortex_ai/__init__.py +18 -3
  2. usecortex_ai/client.py +3 -0
  3. usecortex_ai/document/__init__.py +4 -0
  4. usecortex_ai/document/client.py +139 -0
  5. usecortex_ai/document/raw_client.py +312 -0
  6. usecortex_ai/embeddings/client.py +48 -78
  7. usecortex_ai/embeddings/raw_client.py +44 -74
  8. usecortex_ai/fetch/client.py +2 -2
  9. usecortex_ai/search/client.py +88 -84
  10. usecortex_ai/search/raw_client.py +82 -78
  11. usecortex_ai/sources/client.py +26 -157
  12. usecortex_ai/sources/raw_client.py +22 -501
  13. usecortex_ai/tenant/client.py +154 -6
  14. usecortex_ai/tenant/raw_client.py +502 -4
  15. usecortex_ai/types/__init__.py +16 -2
  16. usecortex_ai/types/add_user_memory_response.py +36 -0
  17. usecortex_ai/types/app_sources_upload_data.py +10 -2
  18. usecortex_ai/types/attachment_model.py +34 -7
  19. usecortex_ai/types/batch_upload_data.py +10 -2
  20. usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -2
  21. usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -2
  22. usecortex_ai/types/content_model.py +33 -6
  23. usecortex_ai/types/delete_memory_request.py +14 -3
  24. usecortex_ai/types/delete_sources.py +20 -0
  25. usecortex_ai/types/delete_sub_tenant_data.py +42 -0
  26. usecortex_ai/types/delete_user_memory_response.py +31 -0
  27. usecortex_ai/types/embeddings_create_collection_data.py +19 -4
  28. usecortex_ai/types/embeddings_delete_data.py +19 -4
  29. usecortex_ai/types/embeddings_get_data.py +19 -4
  30. usecortex_ai/types/embeddings_search_data.py +19 -4
  31. usecortex_ai/types/error_response.py +0 -1
  32. usecortex_ai/types/fetch_content_data.py +19 -5
  33. usecortex_ai/types/file_upload_result.py +9 -2
  34. usecortex_ai/types/generate_user_memory_response.py +32 -0
  35. usecortex_ai/types/list_sources_response.py +14 -3
  36. usecortex_ai/types/list_user_memories_response.py +32 -0
  37. usecortex_ai/types/markdown_upload_request.py +23 -5
  38. usecortex_ai/types/processing_status.py +14 -3
  39. usecortex_ai/types/relations.py +9 -2
  40. usecortex_ai/types/retrieve_user_memory_response.py +32 -0
  41. usecortex_ai/types/search_chunk.py +54 -17
  42. usecortex_ai/types/single_upload_data.py +10 -2
  43. usecortex_ai/types/source.py +34 -15
  44. usecortex_ai/types/source_model.py +63 -14
  45. usecortex_ai/types/sub_tenant_ids_data.py +29 -5
  46. usecortex_ai/types/tenant_create_data.py +19 -4
  47. usecortex_ai/types/tenant_stats.py +24 -5
  48. usecortex_ai/types/user_memory.py +31 -0
  49. usecortex_ai/upload/client.py +486 -111
  50. usecortex_ai/upload/raw_client.py +458 -103
  51. usecortex_ai/user/client.py +30 -10
  52. usecortex_ai/user/raw_client.py +22 -6
  53. usecortex_ai/user_memory/client.py +200 -56
  54. usecortex_ai/user_memory/raw_client.py +921 -94
  55. {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/METADATA +1 -1
  56. usecortex_ai-0.3.0.dist-info/RECORD +101 -0
  57. usecortex_ai/types/source_content.py +0 -26
  58. usecortex_ai-0.2.1.dist-info/RECORD +0 -91
  59. {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/WHEEL +0 -0
  60. {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/licenses/LICENSE +0 -0
  61. {usecortex_ai-0.2.1.dist-info → usecortex_ai-0.3.0.dist-info}/top_level.txt +0 -0
@@ -17,7 +17,6 @@ from ..errors.unauthorized_error import UnauthorizedError
17
17
  from ..errors.unprocessable_entity_error import UnprocessableEntityError
18
18
  from ..types.actual_error_response import ActualErrorResponse
19
19
  from ..types.list_sources_response import ListSourcesResponse
20
- from ..types.sub_tenant_ids_data import SubTenantIdsData
21
20
 
22
21
  # this is used as the default value for optional parameters
23
22
  OMIT = typing.cast(typing.Any, ...)
@@ -31,138 +30,27 @@ class RawSourcesClient:
31
30
  self,
32
31
  *,
33
32
  tenant_id: str,
34
- sub_tenant_id: typing.Optional[str] = None,
33
+ source_ids: typing.Sequence[str],
34
+ sub_tenant_id: typing.Optional[str] = OMIT,
35
35
  request_options: typing.Optional[RequestOptions] = None,
36
36
  ) -> HttpResponse[ListSourcesResponse]:
37
37
  """
38
- Parameters
39
- ----------
40
- tenant_id : str
38
+ Retrieve specific sources by their IDs.
41
39
 
42
- sub_tenant_id : typing.Optional[str]
43
-
44
- request_options : typing.Optional[RequestOptions]
45
- Request-specific configuration.
40
+ Use this endpoint to fetch one or more sources by providing their unique identifiers. This is useful when you need detailed information about specific documents or content you've previously uploaded.
46
41
 
47
- Returns
48
- -------
49
- HttpResponse[ListSourcesResponse]
50
- Successful Response
51
- """
52
- _response = self._client_wrapper.httpx_client.request(
53
- "list/sources",
54
- method="GET",
55
- params={
56
- "tenant_id": tenant_id,
57
- "sub_tenant_id": sub_tenant_id,
58
- },
59
- request_options=request_options,
60
- )
61
- try:
62
- if 200 <= _response.status_code < 300:
63
- _data = typing.cast(
64
- ListSourcesResponse,
65
- parse_obj_as(
66
- type_=ListSourcesResponse, # type: ignore
67
- object_=_response.json(),
68
- ),
69
- )
70
- return HttpResponse(response=_response, data=_data)
71
- if _response.status_code == 400:
72
- raise BadRequestError(
73
- headers=dict(_response.headers),
74
- body=typing.cast(
75
- ActualErrorResponse,
76
- parse_obj_as(
77
- type_=ActualErrorResponse, # type: ignore
78
- object_=_response.json(),
79
- ),
80
- ),
81
- )
82
- if _response.status_code == 401:
83
- raise UnauthorizedError(
84
- headers=dict(_response.headers),
85
- body=typing.cast(
86
- ActualErrorResponse,
87
- parse_obj_as(
88
- type_=ActualErrorResponse, # type: ignore
89
- object_=_response.json(),
90
- ),
91
- ),
92
- )
93
- if _response.status_code == 403:
94
- raise ForbiddenError(
95
- headers=dict(_response.headers),
96
- body=typing.cast(
97
- ActualErrorResponse,
98
- parse_obj_as(
99
- type_=ActualErrorResponse, # type: ignore
100
- object_=_response.json(),
101
- ),
102
- ),
103
- )
104
- if _response.status_code == 404:
105
- raise NotFoundError(
106
- headers=dict(_response.headers),
107
- body=typing.cast(
108
- ActualErrorResponse,
109
- parse_obj_as(
110
- type_=ActualErrorResponse, # type: ignore
111
- object_=_response.json(),
112
- ),
113
- ),
114
- )
115
- if _response.status_code == 422:
116
- raise UnprocessableEntityError(
117
- headers=dict(_response.headers),
118
- body=typing.cast(
119
- typing.Optional[typing.Any],
120
- parse_obj_as(
121
- type_=typing.Optional[typing.Any], # type: ignore
122
- object_=_response.json(),
123
- ),
124
- ),
125
- )
126
- if _response.status_code == 500:
127
- raise InternalServerError(
128
- headers=dict(_response.headers),
129
- body=typing.cast(
130
- ActualErrorResponse,
131
- parse_obj_as(
132
- type_=ActualErrorResponse, # type: ignore
133
- object_=_response.json(),
134
- ),
135
- ),
136
- )
137
- if _response.status_code == 503:
138
- raise ServiceUnavailableError(
139
- headers=dict(_response.headers),
140
- body=typing.cast(
141
- ActualErrorResponse,
142
- parse_obj_as(
143
- type_=ActualErrorResponse, # type: ignore
144
- object_=_response.json(),
145
- ),
146
- ),
147
- )
148
- _response_json = _response.json()
149
- except JSONDecodeError:
150
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
151
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
42
+ Provide the source IDs in the request body along with your tenant information to get the exact sources you need.
152
43
 
153
- def get_by_ids(
154
- self,
155
- *,
156
- tenant_id: str,
157
- source_ids: typing.Sequence[str],
158
- request_options: typing.Optional[RequestOptions] = None,
159
- ) -> HttpResponse[ListSourcesResponse]:
160
- """
161
44
  Parameters
162
45
  ----------
163
46
  tenant_id : str
47
+ Unique identifier for the tenant/organization
164
48
 
165
49
  source_ids : typing.Sequence[str]
50
+ List of source IDs to fetch
51
+
52
+ sub_tenant_id : typing.Optional[str]
53
+ Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
166
54
 
167
55
  request_options : typing.Optional[RequestOptions]
168
56
  Request-specific configuration.
@@ -178,6 +66,7 @@ class RawSourcesClient:
178
66
  json={
179
67
  "tenant_id": tenant_id,
180
68
  "source_ids": source_ids,
69
+ "sub_tenant_id": sub_tenant_id,
181
70
  },
182
71
  headers={
183
72
  "content-type": "application/json",
@@ -277,135 +166,6 @@ class RawSourcesClient:
277
166
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
278
167
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
279
168
 
280
- def get_sub_tenant_ids(
281
- self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
282
- ) -> HttpResponse[SubTenantIdsData]:
283
- """
284
- Get all sub-tenant IDs (tenant IDs) contained within a specific Weaviate collection.
285
- Fetches the tenant IDs directly from Weaviate using default cluster credentials.
286
-
287
- Args:
288
- tenant_id: The tenant ID to fetch sub-tenant IDs for
289
- api_details: Authentication dependency
290
-
291
- Returns:
292
- SubTenantIdsData: Contains collection_name, sub_tenant_ids list, count, and success message
293
-
294
- Example:
295
- GET /list/sub_tenant_ids?tenant_id=my_tenant_123
296
-
297
- Parameters
298
- ----------
299
- tenant_id : str
300
-
301
- request_options : typing.Optional[RequestOptions]
302
- Request-specific configuration.
303
-
304
- Returns
305
- -------
306
- HttpResponse[SubTenantIdsData]
307
- Successful Response
308
- """
309
- _response = self._client_wrapper.httpx_client.request(
310
- "list/sub_tenant_ids",
311
- method="GET",
312
- params={
313
- "tenant_id": tenant_id,
314
- },
315
- request_options=request_options,
316
- )
317
- try:
318
- if 200 <= _response.status_code < 300:
319
- _data = typing.cast(
320
- SubTenantIdsData,
321
- parse_obj_as(
322
- type_=SubTenantIdsData, # type: ignore
323
- object_=_response.json(),
324
- ),
325
- )
326
- return HttpResponse(response=_response, data=_data)
327
- if _response.status_code == 400:
328
- raise BadRequestError(
329
- headers=dict(_response.headers),
330
- body=typing.cast(
331
- ActualErrorResponse,
332
- parse_obj_as(
333
- type_=ActualErrorResponse, # type: ignore
334
- object_=_response.json(),
335
- ),
336
- ),
337
- )
338
- if _response.status_code == 401:
339
- raise UnauthorizedError(
340
- headers=dict(_response.headers),
341
- body=typing.cast(
342
- ActualErrorResponse,
343
- parse_obj_as(
344
- type_=ActualErrorResponse, # type: ignore
345
- object_=_response.json(),
346
- ),
347
- ),
348
- )
349
- if _response.status_code == 403:
350
- raise ForbiddenError(
351
- headers=dict(_response.headers),
352
- body=typing.cast(
353
- ActualErrorResponse,
354
- parse_obj_as(
355
- type_=ActualErrorResponse, # type: ignore
356
- object_=_response.json(),
357
- ),
358
- ),
359
- )
360
- if _response.status_code == 404:
361
- raise NotFoundError(
362
- headers=dict(_response.headers),
363
- body=typing.cast(
364
- ActualErrorResponse,
365
- parse_obj_as(
366
- type_=ActualErrorResponse, # type: ignore
367
- object_=_response.json(),
368
- ),
369
- ),
370
- )
371
- if _response.status_code == 422:
372
- raise UnprocessableEntityError(
373
- headers=dict(_response.headers),
374
- body=typing.cast(
375
- typing.Optional[typing.Any],
376
- parse_obj_as(
377
- type_=typing.Optional[typing.Any], # type: ignore
378
- object_=_response.json(),
379
- ),
380
- ),
381
- )
382
- if _response.status_code == 500:
383
- raise InternalServerError(
384
- headers=dict(_response.headers),
385
- body=typing.cast(
386
- ActualErrorResponse,
387
- parse_obj_as(
388
- type_=ActualErrorResponse, # type: ignore
389
- object_=_response.json(),
390
- ),
391
- ),
392
- )
393
- if _response.status_code == 503:
394
- raise ServiceUnavailableError(
395
- headers=dict(_response.headers),
396
- body=typing.cast(
397
- ActualErrorResponse,
398
- parse_obj_as(
399
- type_=ActualErrorResponse, # type: ignore
400
- object_=_response.json(),
401
- ),
402
- ),
403
- )
404
- _response_json = _response.json()
405
- except JSONDecodeError:
406
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
407
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
408
-
409
169
 
410
170
  class AsyncRawSourcesClient:
411
171
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -415,138 +175,27 @@ class AsyncRawSourcesClient:
415
175
  self,
416
176
  *,
417
177
  tenant_id: str,
418
- sub_tenant_id: typing.Optional[str] = None,
178
+ source_ids: typing.Sequence[str],
179
+ sub_tenant_id: typing.Optional[str] = OMIT,
419
180
  request_options: typing.Optional[RequestOptions] = None,
420
181
  ) -> AsyncHttpResponse[ListSourcesResponse]:
421
182
  """
422
- Parameters
423
- ----------
424
- tenant_id : str
183
+ Retrieve specific sources by their IDs.
425
184
 
426
- sub_tenant_id : typing.Optional[str]
427
-
428
- request_options : typing.Optional[RequestOptions]
429
- Request-specific configuration.
185
+ Use this endpoint to fetch one or more sources by providing their unique identifiers. This is useful when you need detailed information about specific documents or content you've previously uploaded.
430
186
 
431
- Returns
432
- -------
433
- AsyncHttpResponse[ListSourcesResponse]
434
- Successful Response
435
- """
436
- _response = await self._client_wrapper.httpx_client.request(
437
- "list/sources",
438
- method="GET",
439
- params={
440
- "tenant_id": tenant_id,
441
- "sub_tenant_id": sub_tenant_id,
442
- },
443
- request_options=request_options,
444
- )
445
- try:
446
- if 200 <= _response.status_code < 300:
447
- _data = typing.cast(
448
- ListSourcesResponse,
449
- parse_obj_as(
450
- type_=ListSourcesResponse, # type: ignore
451
- object_=_response.json(),
452
- ),
453
- )
454
- return AsyncHttpResponse(response=_response, data=_data)
455
- if _response.status_code == 400:
456
- raise BadRequestError(
457
- headers=dict(_response.headers),
458
- body=typing.cast(
459
- ActualErrorResponse,
460
- parse_obj_as(
461
- type_=ActualErrorResponse, # type: ignore
462
- object_=_response.json(),
463
- ),
464
- ),
465
- )
466
- if _response.status_code == 401:
467
- raise UnauthorizedError(
468
- headers=dict(_response.headers),
469
- body=typing.cast(
470
- ActualErrorResponse,
471
- parse_obj_as(
472
- type_=ActualErrorResponse, # type: ignore
473
- object_=_response.json(),
474
- ),
475
- ),
476
- )
477
- if _response.status_code == 403:
478
- raise ForbiddenError(
479
- headers=dict(_response.headers),
480
- body=typing.cast(
481
- ActualErrorResponse,
482
- parse_obj_as(
483
- type_=ActualErrorResponse, # type: ignore
484
- object_=_response.json(),
485
- ),
486
- ),
487
- )
488
- if _response.status_code == 404:
489
- raise NotFoundError(
490
- headers=dict(_response.headers),
491
- body=typing.cast(
492
- ActualErrorResponse,
493
- parse_obj_as(
494
- type_=ActualErrorResponse, # type: ignore
495
- object_=_response.json(),
496
- ),
497
- ),
498
- )
499
- if _response.status_code == 422:
500
- raise UnprocessableEntityError(
501
- headers=dict(_response.headers),
502
- body=typing.cast(
503
- typing.Optional[typing.Any],
504
- parse_obj_as(
505
- type_=typing.Optional[typing.Any], # type: ignore
506
- object_=_response.json(),
507
- ),
508
- ),
509
- )
510
- if _response.status_code == 500:
511
- raise InternalServerError(
512
- headers=dict(_response.headers),
513
- body=typing.cast(
514
- ActualErrorResponse,
515
- parse_obj_as(
516
- type_=ActualErrorResponse, # type: ignore
517
- object_=_response.json(),
518
- ),
519
- ),
520
- )
521
- if _response.status_code == 503:
522
- raise ServiceUnavailableError(
523
- headers=dict(_response.headers),
524
- body=typing.cast(
525
- ActualErrorResponse,
526
- parse_obj_as(
527
- type_=ActualErrorResponse, # type: ignore
528
- object_=_response.json(),
529
- ),
530
- ),
531
- )
532
- _response_json = _response.json()
533
- except JSONDecodeError:
534
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
535
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
187
+ Provide the source IDs in the request body along with your tenant information to get the exact sources you need.
536
188
 
537
- async def get_by_ids(
538
- self,
539
- *,
540
- tenant_id: str,
541
- source_ids: typing.Sequence[str],
542
- request_options: typing.Optional[RequestOptions] = None,
543
- ) -> AsyncHttpResponse[ListSourcesResponse]:
544
- """
545
189
  Parameters
546
190
  ----------
547
191
  tenant_id : str
192
+ Unique identifier for the tenant/organization
548
193
 
549
194
  source_ids : typing.Sequence[str]
195
+ List of source IDs to fetch
196
+
197
+ sub_tenant_id : typing.Optional[str]
198
+ Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
550
199
 
551
200
  request_options : typing.Optional[RequestOptions]
552
201
  Request-specific configuration.
@@ -562,6 +211,7 @@ class AsyncRawSourcesClient:
562
211
  json={
563
212
  "tenant_id": tenant_id,
564
213
  "source_ids": source_ids,
214
+ "sub_tenant_id": sub_tenant_id,
565
215
  },
566
216
  headers={
567
217
  "content-type": "application/json",
@@ -660,132 +310,3 @@ class AsyncRawSourcesClient:
660
310
  except JSONDecodeError:
661
311
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
662
312
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
663
-
664
- async def get_sub_tenant_ids(
665
- self, *, tenant_id: str, request_options: typing.Optional[RequestOptions] = None
666
- ) -> AsyncHttpResponse[SubTenantIdsData]:
667
- """
668
- Get all sub-tenant IDs (tenant IDs) contained within a specific Weaviate collection.
669
- Fetches the tenant IDs directly from Weaviate using default cluster credentials.
670
-
671
- Args:
672
- tenant_id: The tenant ID to fetch sub-tenant IDs for
673
- api_details: Authentication dependency
674
-
675
- Returns:
676
- SubTenantIdsData: Contains collection_name, sub_tenant_ids list, count, and success message
677
-
678
- Example:
679
- GET /list/sub_tenant_ids?tenant_id=my_tenant_123
680
-
681
- Parameters
682
- ----------
683
- tenant_id : str
684
-
685
- request_options : typing.Optional[RequestOptions]
686
- Request-specific configuration.
687
-
688
- Returns
689
- -------
690
- AsyncHttpResponse[SubTenantIdsData]
691
- Successful Response
692
- """
693
- _response = await self._client_wrapper.httpx_client.request(
694
- "list/sub_tenant_ids",
695
- method="GET",
696
- params={
697
- "tenant_id": tenant_id,
698
- },
699
- request_options=request_options,
700
- )
701
- try:
702
- if 200 <= _response.status_code < 300:
703
- _data = typing.cast(
704
- SubTenantIdsData,
705
- parse_obj_as(
706
- type_=SubTenantIdsData, # type: ignore
707
- object_=_response.json(),
708
- ),
709
- )
710
- return AsyncHttpResponse(response=_response, data=_data)
711
- if _response.status_code == 400:
712
- raise BadRequestError(
713
- headers=dict(_response.headers),
714
- body=typing.cast(
715
- ActualErrorResponse,
716
- parse_obj_as(
717
- type_=ActualErrorResponse, # type: ignore
718
- object_=_response.json(),
719
- ),
720
- ),
721
- )
722
- if _response.status_code == 401:
723
- raise UnauthorizedError(
724
- headers=dict(_response.headers),
725
- body=typing.cast(
726
- ActualErrorResponse,
727
- parse_obj_as(
728
- type_=ActualErrorResponse, # type: ignore
729
- object_=_response.json(),
730
- ),
731
- ),
732
- )
733
- if _response.status_code == 403:
734
- raise ForbiddenError(
735
- headers=dict(_response.headers),
736
- body=typing.cast(
737
- ActualErrorResponse,
738
- parse_obj_as(
739
- type_=ActualErrorResponse, # type: ignore
740
- object_=_response.json(),
741
- ),
742
- ),
743
- )
744
- if _response.status_code == 404:
745
- raise NotFoundError(
746
- headers=dict(_response.headers),
747
- body=typing.cast(
748
- ActualErrorResponse,
749
- parse_obj_as(
750
- type_=ActualErrorResponse, # type: ignore
751
- object_=_response.json(),
752
- ),
753
- ),
754
- )
755
- if _response.status_code == 422:
756
- raise UnprocessableEntityError(
757
- headers=dict(_response.headers),
758
- body=typing.cast(
759
- typing.Optional[typing.Any],
760
- parse_obj_as(
761
- type_=typing.Optional[typing.Any], # type: ignore
762
- object_=_response.json(),
763
- ),
764
- ),
765
- )
766
- if _response.status_code == 500:
767
- raise InternalServerError(
768
- headers=dict(_response.headers),
769
- body=typing.cast(
770
- ActualErrorResponse,
771
- parse_obj_as(
772
- type_=ActualErrorResponse, # type: ignore
773
- object_=_response.json(),
774
- ),
775
- ),
776
- )
777
- if _response.status_code == 503:
778
- raise ServiceUnavailableError(
779
- headers=dict(_response.headers),
780
- body=typing.cast(
781
- ActualErrorResponse,
782
- parse_obj_as(
783
- type_=ActualErrorResponse, # type: ignore
784
- object_=_response.json(),
785
- ),
786
- ),
787
- )
788
- _response_json = _response.json()
789
- except JSONDecodeError:
790
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
791
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)