letta-client 0.1.121__py3-none-any.whl → 0.1.122__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.

Potentially problematic release.


This version of letta-client might be problematic. Click here for more details.

Files changed (50) hide show
  1. letta_client/__init__.py +7 -6
  2. letta_client/agents/__init__.py +2 -1
  3. letta_client/agents/client.py +90 -581
  4. letta_client/agents/groups/client.py +167 -0
  5. letta_client/agents/messages/client.py +145 -0
  6. letta_client/agents/passages/client.py +289 -0
  7. letta_client/base_client.py +12 -0
  8. letta_client/batches/__init__.py +2 -0
  9. letta_client/{messages/batches → batches}/client.py +19 -19
  10. letta_client/blocks/__init__.py +3 -0
  11. letta_client/blocks/agents/__init__.py +2 -0
  12. letta_client/blocks/agents/client.py +149 -0
  13. letta_client/blocks/client.py +4 -127
  14. letta_client/core/client_wrapper.py +1 -1
  15. letta_client/embeddings/__init__.py +2 -0
  16. letta_client/embeddings/client.py +108 -0
  17. letta_client/groups/client.py +0 -124
  18. letta_client/groups/messages/client.py +124 -0
  19. letta_client/identities/__init__.py +3 -0
  20. letta_client/identities/client.py +4 -154
  21. letta_client/identities/properties/__init__.py +2 -0
  22. letta_client/identities/properties/client.py +181 -0
  23. letta_client/messages/__init__.py +0 -3
  24. letta_client/messages/client.py +0 -4
  25. letta_client/models/client.py +4 -97
  26. letta_client/providers/client.py +173 -10
  27. letta_client/runs/__init__.py +3 -0
  28. letta_client/runs/client.py +34 -480
  29. letta_client/runs/messages/__init__.py +2 -0
  30. letta_client/runs/messages/client.py +234 -0
  31. letta_client/runs/steps/__init__.py +2 -0
  32. letta_client/runs/steps/client.py +217 -0
  33. letta_client/runs/usage/__init__.py +2 -0
  34. letta_client/runs/usage/client.py +145 -0
  35. letta_client/sources/client.py +6 -4
  36. letta_client/steps/client.py +78 -4
  37. letta_client/tags/__init__.py +2 -0
  38. letta_client/tags/client.py +92 -0
  39. letta_client/templates/__init__.py +5 -6
  40. letta_client/templates/agents/__init__.py +5 -0
  41. letta_client/templates/agents/client.py +208 -0
  42. letta_client/templates/agents/types/__init__.py +5 -0
  43. letta_client/templates/{types/templates_create_agents_response.py → agents/types/agents_create_response.py} +4 -4
  44. letta_client/templates/client.py +6 -191
  45. letta_client/templates/types/__init__.py +1 -6
  46. letta_client/tools/client.py +4 -4
  47. {letta_client-0.1.121.dist-info → letta_client-0.1.122.dist-info}/METADATA +1 -1
  48. {letta_client-0.1.121.dist-info → letta_client-0.1.122.dist-info}/RECORD +50 -31
  49. /letta_client/{messages/batches → agents/groups}/__init__.py +0 -0
  50. {letta_client-0.1.121.dist-info → letta_client-0.1.122.dist-info}/WHEEL +0 -0
@@ -408,64 +408,6 @@ class GroupsClient:
408
408
  raise ApiError(status_code=_response.status_code, body=_response.text)
409
409
  raise ApiError(status_code=_response.status_code, body=_response_json)
410
410
 
411
- def reset_messages(
412
- self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None
413
- ) -> typing.Optional[typing.Any]:
414
- """
415
- Delete the group messages for all agents that are part of the multi-agent group.
416
-
417
- Parameters
418
- ----------
419
- group_id : str
420
-
421
- request_options : typing.Optional[RequestOptions]
422
- Request-specific configuration.
423
-
424
- Returns
425
- -------
426
- typing.Optional[typing.Any]
427
- Successful Response
428
-
429
- Examples
430
- --------
431
- from letta_client import Letta
432
-
433
- client = Letta(
434
- token="YOUR_TOKEN",
435
- )
436
- client.groups.reset_messages(
437
- group_id="group_id",
438
- )
439
- """
440
- _response = self._client_wrapper.httpx_client.request(
441
- f"v1/groups/{jsonable_encoder(group_id)}/reset-messages",
442
- method="PATCH",
443
- request_options=request_options,
444
- )
445
- try:
446
- if 200 <= _response.status_code < 300:
447
- return typing.cast(
448
- typing.Optional[typing.Any],
449
- construct_type(
450
- type_=typing.Optional[typing.Any], # type: ignore
451
- object_=_response.json(),
452
- ),
453
- )
454
- if _response.status_code == 422:
455
- raise UnprocessableEntityError(
456
- typing.cast(
457
- HttpValidationError,
458
- construct_type(
459
- type_=HttpValidationError, # type: ignore
460
- object_=_response.json(),
461
- ),
462
- )
463
- )
464
- _response_json = _response.json()
465
- except JSONDecodeError:
466
- raise ApiError(status_code=_response.status_code, body=_response.text)
467
- raise ApiError(status_code=_response.status_code, body=_response_json)
468
-
469
411
 
470
412
  class AsyncGroupsClient:
471
413
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -892,69 +834,3 @@ class AsyncGroupsClient:
892
834
  except JSONDecodeError:
893
835
  raise ApiError(status_code=_response.status_code, body=_response.text)
894
836
  raise ApiError(status_code=_response.status_code, body=_response_json)
895
-
896
- async def reset_messages(
897
- self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None
898
- ) -> typing.Optional[typing.Any]:
899
- """
900
- Delete the group messages for all agents that are part of the multi-agent group.
901
-
902
- Parameters
903
- ----------
904
- group_id : str
905
-
906
- request_options : typing.Optional[RequestOptions]
907
- Request-specific configuration.
908
-
909
- Returns
910
- -------
911
- typing.Optional[typing.Any]
912
- Successful Response
913
-
914
- Examples
915
- --------
916
- import asyncio
917
-
918
- from letta_client import AsyncLetta
919
-
920
- client = AsyncLetta(
921
- token="YOUR_TOKEN",
922
- )
923
-
924
-
925
- async def main() -> None:
926
- await client.groups.reset_messages(
927
- group_id="group_id",
928
- )
929
-
930
-
931
- asyncio.run(main())
932
- """
933
- _response = await self._client_wrapper.httpx_client.request(
934
- f"v1/groups/{jsonable_encoder(group_id)}/reset-messages",
935
- method="PATCH",
936
- request_options=request_options,
937
- )
938
- try:
939
- if 200 <= _response.status_code < 300:
940
- return typing.cast(
941
- typing.Optional[typing.Any],
942
- construct_type(
943
- type_=typing.Optional[typing.Any], # type: ignore
944
- object_=_response.json(),
945
- ),
946
- )
947
- if _response.status_code == 422:
948
- raise UnprocessableEntityError(
949
- typing.cast(
950
- HttpValidationError,
951
- construct_type(
952
- type_=HttpValidationError, # type: ignore
953
- object_=_response.json(),
954
- ),
955
- )
956
- )
957
- _response_json = _response.json()
958
- except JSONDecodeError:
959
- raise ApiError(status_code=_response.status_code, body=_response.text)
960
- raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -405,6 +405,64 @@ class MessagesClient:
405
405
  raise ApiError(status_code=_response.status_code, body=_response.text)
406
406
  raise ApiError(status_code=_response.status_code, body=_response_json)
407
407
 
408
+ def reset(
409
+ self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None
410
+ ) -> typing.Optional[typing.Any]:
411
+ """
412
+ Delete the group messages for all agents that are part of the multi-agent group.
413
+
414
+ Parameters
415
+ ----------
416
+ group_id : str
417
+
418
+ request_options : typing.Optional[RequestOptions]
419
+ Request-specific configuration.
420
+
421
+ Returns
422
+ -------
423
+ typing.Optional[typing.Any]
424
+ Successful Response
425
+
426
+ Examples
427
+ --------
428
+ from letta_client import Letta
429
+
430
+ client = Letta(
431
+ token="YOUR_TOKEN",
432
+ )
433
+ client.groups.messages.reset(
434
+ group_id="group_id",
435
+ )
436
+ """
437
+ _response = self._client_wrapper.httpx_client.request(
438
+ f"v1/groups/{jsonable_encoder(group_id)}/reset-messages",
439
+ method="PATCH",
440
+ request_options=request_options,
441
+ )
442
+ try:
443
+ if 200 <= _response.status_code < 300:
444
+ return typing.cast(
445
+ typing.Optional[typing.Any],
446
+ construct_type(
447
+ type_=typing.Optional[typing.Any], # type: ignore
448
+ object_=_response.json(),
449
+ ),
450
+ )
451
+ if _response.status_code == 422:
452
+ raise UnprocessableEntityError(
453
+ typing.cast(
454
+ HttpValidationError,
455
+ construct_type(
456
+ type_=HttpValidationError, # type: ignore
457
+ object_=_response.json(),
458
+ ),
459
+ )
460
+ )
461
+ _response_json = _response.json()
462
+ except JSONDecodeError:
463
+ raise ApiError(status_code=_response.status_code, body=_response.text)
464
+ raise ApiError(status_code=_response.status_code, body=_response_json)
465
+
408
466
 
409
467
  class AsyncMessagesClient:
410
468
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -818,3 +876,69 @@ class AsyncMessagesClient:
818
876
  except JSONDecodeError:
819
877
  raise ApiError(status_code=_response.status_code, body=_response.text)
820
878
  raise ApiError(status_code=_response.status_code, body=_response_json)
879
+
880
+ async def reset(
881
+ self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None
882
+ ) -> typing.Optional[typing.Any]:
883
+ """
884
+ Delete the group messages for all agents that are part of the multi-agent group.
885
+
886
+ Parameters
887
+ ----------
888
+ group_id : str
889
+
890
+ request_options : typing.Optional[RequestOptions]
891
+ Request-specific configuration.
892
+
893
+ Returns
894
+ -------
895
+ typing.Optional[typing.Any]
896
+ Successful Response
897
+
898
+ Examples
899
+ --------
900
+ import asyncio
901
+
902
+ from letta_client import AsyncLetta
903
+
904
+ client = AsyncLetta(
905
+ token="YOUR_TOKEN",
906
+ )
907
+
908
+
909
+ async def main() -> None:
910
+ await client.groups.messages.reset(
911
+ group_id="group_id",
912
+ )
913
+
914
+
915
+ asyncio.run(main())
916
+ """
917
+ _response = await self._client_wrapper.httpx_client.request(
918
+ f"v1/groups/{jsonable_encoder(group_id)}/reset-messages",
919
+ method="PATCH",
920
+ request_options=request_options,
921
+ )
922
+ try:
923
+ if 200 <= _response.status_code < 300:
924
+ return typing.cast(
925
+ typing.Optional[typing.Any],
926
+ construct_type(
927
+ type_=typing.Optional[typing.Any], # type: ignore
928
+ object_=_response.json(),
929
+ ),
930
+ )
931
+ if _response.status_code == 422:
932
+ raise UnprocessableEntityError(
933
+ typing.cast(
934
+ HttpValidationError,
935
+ construct_type(
936
+ type_=HttpValidationError, # type: ignore
937
+ object_=_response.json(),
938
+ ),
939
+ )
940
+ )
941
+ _response_json = _response.json()
942
+ except JSONDecodeError:
943
+ raise ApiError(status_code=_response.status_code, body=_response.text)
944
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -1,2 +1,5 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ from . import properties
4
+
5
+ __all__ = ["properties"]
@@ -2,6 +2,7 @@
2
2
 
3
3
  import typing
4
4
  from ..core.client_wrapper import SyncClientWrapper
5
+ from .properties.client import PropertiesClient
5
6
  from ..types.identity_type import IdentityType
6
7
  from ..core.request_options import RequestOptions
7
8
  from ..types.identity import Identity
@@ -14,6 +15,7 @@ from ..types.identity_property import IdentityProperty
14
15
  from ..core.serialization import convert_and_respect_annotation_metadata
15
16
  from ..core.jsonable_encoder import jsonable_encoder
16
17
  from ..core.client_wrapper import AsyncClientWrapper
18
+ from .properties.client import AsyncPropertiesClient
17
19
 
18
20
  # this is used as the default value for optional parameters
19
21
  OMIT = typing.cast(typing.Any, ...)
@@ -22,6 +24,7 @@ OMIT = typing.cast(typing.Any, ...)
22
24
  class IdentitiesClient:
23
25
  def __init__(self, *, client_wrapper: SyncClientWrapper):
24
26
  self._client_wrapper = client_wrapper
27
+ self.properties = PropertiesClient(client_wrapper=self._client_wrapper)
25
28
 
26
29
  def list(
27
30
  self,
@@ -528,83 +531,11 @@ class IdentitiesClient:
528
531
  raise ApiError(status_code=_response.status_code, body=_response.text)
529
532
  raise ApiError(status_code=_response.status_code, body=_response_json)
530
533
 
531
- def upsert_identity_properties(
532
- self,
533
- identity_id: str,
534
- *,
535
- request: typing.Sequence[IdentityProperty],
536
- request_options: typing.Optional[RequestOptions] = None,
537
- ) -> typing.Optional[typing.Any]:
538
- """
539
- Parameters
540
- ----------
541
- identity_id : str
542
-
543
- request : typing.Sequence[IdentityProperty]
544
-
545
- request_options : typing.Optional[RequestOptions]
546
- Request-specific configuration.
547
-
548
- Returns
549
- -------
550
- typing.Optional[typing.Any]
551
- Successful Response
552
-
553
- Examples
554
- --------
555
- from letta_client import IdentityProperty, Letta
556
-
557
- client = Letta(
558
- token="YOUR_TOKEN",
559
- )
560
- client.identities.upsert_identity_properties(
561
- identity_id="identity_id",
562
- request=[
563
- IdentityProperty(
564
- key="key",
565
- value="value",
566
- type="string",
567
- )
568
- ],
569
- )
570
- """
571
- _response = self._client_wrapper.httpx_client.request(
572
- f"v1/identities/{jsonable_encoder(identity_id)}/properties",
573
- method="PUT",
574
- json=convert_and_respect_annotation_metadata(
575
- object_=request, annotation=typing.Sequence[IdentityProperty], direction="write"
576
- ),
577
- request_options=request_options,
578
- omit=OMIT,
579
- )
580
- try:
581
- if 200 <= _response.status_code < 300:
582
- return typing.cast(
583
- typing.Optional[typing.Any],
584
- construct_type(
585
- type_=typing.Optional[typing.Any], # type: ignore
586
- object_=_response.json(),
587
- ),
588
- )
589
- if _response.status_code == 422:
590
- raise UnprocessableEntityError(
591
- typing.cast(
592
- HttpValidationError,
593
- construct_type(
594
- type_=HttpValidationError, # type: ignore
595
- object_=_response.json(),
596
- ),
597
- )
598
- )
599
- _response_json = _response.json()
600
- except JSONDecodeError:
601
- raise ApiError(status_code=_response.status_code, body=_response.text)
602
- raise ApiError(status_code=_response.status_code, body=_response_json)
603
-
604
534
 
605
535
  class AsyncIdentitiesClient:
606
536
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
607
537
  self._client_wrapper = client_wrapper
538
+ self.properties = AsyncPropertiesClient(client_wrapper=self._client_wrapper)
608
539
 
609
540
  async def list(
610
541
  self,
@@ -1158,84 +1089,3 @@ class AsyncIdentitiesClient:
1158
1089
  except JSONDecodeError:
1159
1090
  raise ApiError(status_code=_response.status_code, body=_response.text)
1160
1091
  raise ApiError(status_code=_response.status_code, body=_response_json)
1161
-
1162
- async def upsert_identity_properties(
1163
- self,
1164
- identity_id: str,
1165
- *,
1166
- request: typing.Sequence[IdentityProperty],
1167
- request_options: typing.Optional[RequestOptions] = None,
1168
- ) -> typing.Optional[typing.Any]:
1169
- """
1170
- Parameters
1171
- ----------
1172
- identity_id : str
1173
-
1174
- request : typing.Sequence[IdentityProperty]
1175
-
1176
- request_options : typing.Optional[RequestOptions]
1177
- Request-specific configuration.
1178
-
1179
- Returns
1180
- -------
1181
- typing.Optional[typing.Any]
1182
- Successful Response
1183
-
1184
- Examples
1185
- --------
1186
- import asyncio
1187
-
1188
- from letta_client import AsyncLetta, IdentityProperty
1189
-
1190
- client = AsyncLetta(
1191
- token="YOUR_TOKEN",
1192
- )
1193
-
1194
-
1195
- async def main() -> None:
1196
- await client.identities.upsert_identity_properties(
1197
- identity_id="identity_id",
1198
- request=[
1199
- IdentityProperty(
1200
- key="key",
1201
- value="value",
1202
- type="string",
1203
- )
1204
- ],
1205
- )
1206
-
1207
-
1208
- asyncio.run(main())
1209
- """
1210
- _response = await self._client_wrapper.httpx_client.request(
1211
- f"v1/identities/{jsonable_encoder(identity_id)}/properties",
1212
- method="PUT",
1213
- json=convert_and_respect_annotation_metadata(
1214
- object_=request, annotation=typing.Sequence[IdentityProperty], direction="write"
1215
- ),
1216
- request_options=request_options,
1217
- omit=OMIT,
1218
- )
1219
- try:
1220
- if 200 <= _response.status_code < 300:
1221
- return typing.cast(
1222
- typing.Optional[typing.Any],
1223
- construct_type(
1224
- type_=typing.Optional[typing.Any], # type: ignore
1225
- object_=_response.json(),
1226
- ),
1227
- )
1228
- if _response.status_code == 422:
1229
- raise UnprocessableEntityError(
1230
- typing.cast(
1231
- HttpValidationError,
1232
- construct_type(
1233
- type_=HttpValidationError, # type: ignore
1234
- object_=_response.json(),
1235
- ),
1236
- )
1237
- )
1238
- _response_json = _response.json()
1239
- except JSONDecodeError:
1240
- raise ApiError(status_code=_response.status_code, body=_response.text)
1241
- raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
@@ -0,0 +1,181 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from ...core.client_wrapper import SyncClientWrapper
5
+ from ...types.identity_property import IdentityProperty
6
+ from ...core.request_options import RequestOptions
7
+ from ...core.jsonable_encoder import jsonable_encoder
8
+ from ...core.serialization import convert_and_respect_annotation_metadata
9
+ from ...core.unchecked_base_model import construct_type
10
+ from ...errors.unprocessable_entity_error import UnprocessableEntityError
11
+ from ...types.http_validation_error import HttpValidationError
12
+ from json.decoder import JSONDecodeError
13
+ from ...core.api_error import ApiError
14
+ from ...core.client_wrapper import AsyncClientWrapper
15
+
16
+ # this is used as the default value for optional parameters
17
+ OMIT = typing.cast(typing.Any, ...)
18
+
19
+
20
+ class PropertiesClient:
21
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
22
+ self._client_wrapper = client_wrapper
23
+
24
+ def upsert(
25
+ self,
26
+ identity_id: str,
27
+ *,
28
+ request: typing.Sequence[IdentityProperty],
29
+ request_options: typing.Optional[RequestOptions] = None,
30
+ ) -> typing.Optional[typing.Any]:
31
+ """
32
+ Parameters
33
+ ----------
34
+ identity_id : str
35
+
36
+ request : typing.Sequence[IdentityProperty]
37
+
38
+ request_options : typing.Optional[RequestOptions]
39
+ Request-specific configuration.
40
+
41
+ Returns
42
+ -------
43
+ typing.Optional[typing.Any]
44
+ Successful Response
45
+
46
+ Examples
47
+ --------
48
+ from letta_client import IdentityProperty, Letta
49
+
50
+ client = Letta(
51
+ token="YOUR_TOKEN",
52
+ )
53
+ client.identities.properties.upsert(
54
+ identity_id="identity_id",
55
+ request=[
56
+ IdentityProperty(
57
+ key="key",
58
+ value="value",
59
+ type="string",
60
+ )
61
+ ],
62
+ )
63
+ """
64
+ _response = self._client_wrapper.httpx_client.request(
65
+ f"v1/identities/{jsonable_encoder(identity_id)}/properties",
66
+ method="PUT",
67
+ json=convert_and_respect_annotation_metadata(
68
+ object_=request, annotation=typing.Sequence[IdentityProperty], direction="write"
69
+ ),
70
+ request_options=request_options,
71
+ omit=OMIT,
72
+ )
73
+ try:
74
+ if 200 <= _response.status_code < 300:
75
+ return typing.cast(
76
+ typing.Optional[typing.Any],
77
+ construct_type(
78
+ type_=typing.Optional[typing.Any], # type: ignore
79
+ object_=_response.json(),
80
+ ),
81
+ )
82
+ if _response.status_code == 422:
83
+ raise UnprocessableEntityError(
84
+ typing.cast(
85
+ HttpValidationError,
86
+ construct_type(
87
+ type_=HttpValidationError, # type: ignore
88
+ object_=_response.json(),
89
+ ),
90
+ )
91
+ )
92
+ _response_json = _response.json()
93
+ except JSONDecodeError:
94
+ raise ApiError(status_code=_response.status_code, body=_response.text)
95
+ raise ApiError(status_code=_response.status_code, body=_response_json)
96
+
97
+
98
+ class AsyncPropertiesClient:
99
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
100
+ self._client_wrapper = client_wrapper
101
+
102
+ async def upsert(
103
+ self,
104
+ identity_id: str,
105
+ *,
106
+ request: typing.Sequence[IdentityProperty],
107
+ request_options: typing.Optional[RequestOptions] = None,
108
+ ) -> typing.Optional[typing.Any]:
109
+ """
110
+ Parameters
111
+ ----------
112
+ identity_id : str
113
+
114
+ request : typing.Sequence[IdentityProperty]
115
+
116
+ request_options : typing.Optional[RequestOptions]
117
+ Request-specific configuration.
118
+
119
+ Returns
120
+ -------
121
+ typing.Optional[typing.Any]
122
+ Successful Response
123
+
124
+ Examples
125
+ --------
126
+ import asyncio
127
+
128
+ from letta_client import AsyncLetta, IdentityProperty
129
+
130
+ client = AsyncLetta(
131
+ token="YOUR_TOKEN",
132
+ )
133
+
134
+
135
+ async def main() -> None:
136
+ await client.identities.properties.upsert(
137
+ identity_id="identity_id",
138
+ request=[
139
+ IdentityProperty(
140
+ key="key",
141
+ value="value",
142
+ type="string",
143
+ )
144
+ ],
145
+ )
146
+
147
+
148
+ asyncio.run(main())
149
+ """
150
+ _response = await self._client_wrapper.httpx_client.request(
151
+ f"v1/identities/{jsonable_encoder(identity_id)}/properties",
152
+ method="PUT",
153
+ json=convert_and_respect_annotation_metadata(
154
+ object_=request, annotation=typing.Sequence[IdentityProperty], direction="write"
155
+ ),
156
+ request_options=request_options,
157
+ omit=OMIT,
158
+ )
159
+ try:
160
+ if 200 <= _response.status_code < 300:
161
+ return typing.cast(
162
+ typing.Optional[typing.Any],
163
+ construct_type(
164
+ type_=typing.Optional[typing.Any], # type: ignore
165
+ object_=_response.json(),
166
+ ),
167
+ )
168
+ if _response.status_code == 422:
169
+ raise UnprocessableEntityError(
170
+ typing.cast(
171
+ HttpValidationError,
172
+ construct_type(
173
+ type_=HttpValidationError, # type: ignore
174
+ object_=_response.json(),
175
+ ),
176
+ )
177
+ )
178
+ _response_json = _response.json()
179
+ except JSONDecodeError:
180
+ raise ApiError(status_code=_response.status_code, body=_response.text)
181
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -1,5 +1,2 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from . import batches
4
-
5
- __all__ = ["batches"]
@@ -1,7 +1,6 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  from ..core.client_wrapper import SyncClientWrapper
4
- from .batches.client import BatchesClient
5
4
  import typing
6
5
  from ..core.request_options import RequestOptions
7
6
  from ..core.jsonable_encoder import jsonable_encoder
@@ -11,13 +10,11 @@ from ..types.http_validation_error import HttpValidationError
11
10
  from json.decoder import JSONDecodeError
12
11
  from ..core.api_error import ApiError
13
12
  from ..core.client_wrapper import AsyncClientWrapper
14
- from .batches.client import AsyncBatchesClient
15
13
 
16
14
 
17
15
  class MessagesClient:
18
16
  def __init__(self, *, client_wrapper: SyncClientWrapper):
19
17
  self._client_wrapper = client_wrapper
20
- self.batches = BatchesClient(client_wrapper=self._client_wrapper)
21
18
 
22
19
  def cancel_batch_run(
23
20
  self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None
@@ -81,7 +78,6 @@ class MessagesClient:
81
78
  class AsyncMessagesClient:
82
79
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
83
80
  self._client_wrapper = client_wrapper
84
- self.batches = AsyncBatchesClient(client_wrapper=self._client_wrapper)
85
81
 
86
82
  async def cancel_batch_run(
87
83
  self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None