letta-client 0.1.17__py3-none-any.whl → 0.1.19__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.
- letta_client/__init__.py +34 -116
- letta_client/agents/__init__.py +17 -42
- letta_client/agents/archival_memory/client.py +19 -212
- letta_client/agents/client.py +1633 -336
- letta_client/agents/context/client.py +6 -4
- letta_client/agents/core_memory/client.py +97 -499
- letta_client/agents/memory_variables/__init__.py +2 -2
- letta_client/agents/memory_variables/client.py +13 -13
- letta_client/agents/memory_variables/types/__init__.py +2 -2
- letta_client/agents/memory_variables/types/{memory_variables_get_response.py → memory_variables_list_response.py} +1 -1
- letta_client/agents/messages/__init__.py +2 -22
- letta_client/agents/messages/client.py +20 -26
- letta_client/agents/messages/types/__init__.py +2 -21
- letta_client/agents/messages/types/letta_streaming_response.py +16 -139
- letta_client/agents/messages/types/messages_list_response.py +2 -2
- letta_client/agents/sources/client.py +266 -5
- letta_client/agents/tools/client.py +25 -27
- letta_client/agents/types/__init__.py +15 -25
- letta_client/agents/types/agents_search_request_search_item.py +10 -78
- letta_client/agents/types/{agents_search_request_search_item_order_by.py → agents_search_request_search_item_direction.py} +7 -6
- letta_client/agents/types/agents_search_request_search_item_direction_direction.py +5 -0
- letta_client/agents/types/agents_search_request_search_item_direction_value.py +5 -0
- letta_client/agents/types/{agents_search_request_search_item_name.py → agents_search_request_search_item_one.py} +5 -4
- letta_client/agents/types/agents_search_request_search_item_one_operator.py +5 -0
- letta_client/agents/types/{agents_search_request_search_item_tags.py → agents_search_request_search_item_two.py} +2 -1
- letta_client/agents/types/{agents_search_request_search_item_version.py → agents_search_request_search_item_zero.py} +3 -2
- letta_client/blocks/client.py +12 -260
- letta_client/client.py +3 -3
- letta_client/core/client_wrapper.py +1 -1
- letta_client/jobs/client.py +4 -4
- letta_client/providers/client.py +4 -4
- letta_client/runs/client.py +14 -12
- letta_client/sources/client.py +12 -288
- letta_client/tools/client.py +63 -69
- letta_client/types/__init__.py +21 -99
- letta_client/types/agent_state.py +3 -7
- letta_client/types/{assistant_message_output.py → assistant_message.py} +3 -2
- letta_client/types/block.py +2 -6
- letta_client/types/block_update.py +1 -5
- letta_client/types/{create_assistant_file_request.py → chat_completion_message_tool_call.py} +7 -7
- letta_client/types/context_window_overview.py +4 -6
- letta_client/types/create_block.py +1 -5
- letta_client/types/{function_call_output.py → function.py} +1 -1
- letta_client/types/{function_schema.py → function_definition.py} +2 -1
- letta_client/types/{function_call_input.py → function_tool.py} +5 -3
- letta_client/types/job.py +1 -5
- letta_client/types/letta_message_union.py +9 -121
- letta_client/types/letta_usage_statistics.py +1 -0
- letta_client/types/{letta_schemas_message_message.py → message.py} +4 -6
- letta_client/types/passage.py +1 -5
- letta_client/types/reasoning_message.py +2 -1
- letta_client/types/run.py +1 -5
- letta_client/types/source.py +2 -6
- letta_client/types/{system_message_output.py → system_message.py} +3 -2
- letta_client/types/{letta_schemas_tool_tool.py → tool.py} +1 -1
- letta_client/types/{letta_schemas_letta_message_tool_call.py → tool_call.py} +1 -1
- letta_client/types/tool_call_message.py +2 -1
- letta_client/types/tool_call_message_tool_call.py +2 -2
- letta_client/types/tool_return_message.py +2 -1
- letta_client/types/tool_type.py +2 -1
- letta_client/types/{user_message_output.py → user_message.py} +3 -2
- {letta_client-0.1.17.dist-info → letta_client-0.1.19.dist-info}/METADATA +1 -1
- {letta_client-0.1.17.dist-info → letta_client-0.1.19.dist-info}/RECORD +64 -95
- letta_client/agents/types/agents_search_request_search_item_name_operator.py +0 -5
- letta_client/agents/types/agents_search_request_search_item_order_by_direction.py +0 -5
- letta_client/agents/types/agents_search_request_search_item_order_by_value.py +0 -5
- letta_client/types/assistant_file.py +0 -33
- letta_client/types/assistant_message_input.py +0 -23
- letta_client/types/chat_completion_request.py +0 -49
- letta_client/types/chat_completion_request_function_call.py +0 -6
- letta_client/types/chat_completion_request_messages_item.py +0 -11
- letta_client/types/chat_completion_request_stop.py +0 -5
- letta_client/types/chat_completion_request_tool_choice.py +0 -8
- letta_client/types/chat_completion_response.py +0 -32
- letta_client/types/choice.py +0 -25
- letta_client/types/create_assistant_request.py +0 -57
- letta_client/types/delete_assistant_file_response.py +0 -28
- letta_client/types/delete_assistant_response.py +0 -28
- letta_client/types/letta_schemas_openai_chat_completion_request_tool.py +0 -21
- letta_client/types/letta_schemas_openai_chat_completion_request_tool_call.py +0 -24
- letta_client/types/letta_schemas_openai_chat_completion_request_tool_call_function.py +0 -20
- letta_client/types/letta_schemas_openai_chat_completion_response_message.py +0 -24
- letta_client/types/letta_schemas_openai_chat_completion_response_tool_call.py +0 -22
- letta_client/types/letta_schemas_openai_chat_completions_tool_call_function.py +0 -27
- letta_client/types/letta_schemas_openai_chat_completions_tool_call_input.py +0 -29
- letta_client/types/letta_schemas_openai_chat_completions_tool_call_output.py +0 -29
- letta_client/types/log_prob_token.py +0 -21
- letta_client/types/message_content_log_prob.py +0 -23
- letta_client/types/open_ai_assistant.py +0 -67
- letta_client/types/response_format.py +0 -19
- letta_client/types/system_message_input.py +0 -21
- letta_client/types/tool_call_function_output.py +0 -27
- letta_client/types/tool_function_choice.py +0 -21
- letta_client/types/tool_input.py +0 -21
- letta_client/types/tool_message.py +0 -21
- letta_client/types/user_message_input.py +0 -22
- letta_client/types/user_message_input_content.py +0 -5
- {letta_client-0.1.17.dist-info → letta_client-0.1.19.dist-info}/WHEEL +0 -0
|
@@ -1,57 +1,30 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
import typing
|
|
4
3
|
from ...core.client_wrapper import SyncClientWrapper
|
|
4
|
+
import typing
|
|
5
5
|
from ...core.request_options import RequestOptions
|
|
6
|
-
from ...types.passage import Passage
|
|
7
6
|
from ...core.jsonable_encoder import jsonable_encoder
|
|
8
|
-
from ...core.unchecked_base_model import construct_type
|
|
9
|
-
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
10
|
-
from ...types.http_validation_error import HttpValidationError
|
|
11
7
|
from json.decoder import JSONDecodeError
|
|
12
8
|
from ...core.api_error import ApiError
|
|
13
9
|
from ...core.client_wrapper import AsyncClientWrapper
|
|
14
10
|
|
|
15
|
-
# this is used as the default value for optional parameters
|
|
16
|
-
OMIT = typing.cast(typing.Any, ...)
|
|
17
|
-
|
|
18
11
|
|
|
19
12
|
class ArchivalMemoryClient:
|
|
20
13
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
21
14
|
self._client_wrapper = client_wrapper
|
|
22
15
|
|
|
23
|
-
def list(
|
|
24
|
-
self,
|
|
25
|
-
agent_id: str,
|
|
26
|
-
*,
|
|
27
|
-
after: typing.Optional[int] = None,
|
|
28
|
-
before: typing.Optional[int] = None,
|
|
29
|
-
limit: typing.Optional[int] = None,
|
|
30
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
31
|
-
) -> typing.List[Passage]:
|
|
16
|
+
def list(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
32
17
|
"""
|
|
33
|
-
Retrieve the memories in an agent's archival memory store (paginated query).
|
|
34
|
-
|
|
35
18
|
Parameters
|
|
36
19
|
----------
|
|
37
20
|
agent_id : str
|
|
38
21
|
|
|
39
|
-
after : typing.Optional[int]
|
|
40
|
-
Unique ID of the memory to start the query range at.
|
|
41
|
-
|
|
42
|
-
before : typing.Optional[int]
|
|
43
|
-
Unique ID of the memory to end the query range at.
|
|
44
|
-
|
|
45
|
-
limit : typing.Optional[int]
|
|
46
|
-
How many results to include in the response.
|
|
47
|
-
|
|
48
22
|
request_options : typing.Optional[RequestOptions]
|
|
49
23
|
Request-specific configuration.
|
|
50
24
|
|
|
51
25
|
Returns
|
|
52
26
|
-------
|
|
53
|
-
|
|
54
|
-
Successful Response
|
|
27
|
+
None
|
|
55
28
|
|
|
56
29
|
Examples
|
|
57
30
|
--------
|
|
@@ -67,57 +40,28 @@ class ArchivalMemoryClient:
|
|
|
67
40
|
_response = self._client_wrapper.httpx_client.request(
|
|
68
41
|
f"v1/agents/{jsonable_encoder(agent_id)}/archival_memory",
|
|
69
42
|
method="GET",
|
|
70
|
-
params={
|
|
71
|
-
"after": after,
|
|
72
|
-
"before": before,
|
|
73
|
-
"limit": limit,
|
|
74
|
-
},
|
|
75
43
|
request_options=request_options,
|
|
76
44
|
)
|
|
77
45
|
try:
|
|
78
46
|
if 200 <= _response.status_code < 300:
|
|
79
|
-
return
|
|
80
|
-
typing.List[Passage],
|
|
81
|
-
construct_type(
|
|
82
|
-
type_=typing.List[Passage], # type: ignore
|
|
83
|
-
object_=_response.json(),
|
|
84
|
-
),
|
|
85
|
-
)
|
|
86
|
-
if _response.status_code == 422:
|
|
87
|
-
raise UnprocessableEntityError(
|
|
88
|
-
typing.cast(
|
|
89
|
-
HttpValidationError,
|
|
90
|
-
construct_type(
|
|
91
|
-
type_=HttpValidationError, # type: ignore
|
|
92
|
-
object_=_response.json(),
|
|
93
|
-
),
|
|
94
|
-
)
|
|
95
|
-
)
|
|
47
|
+
return
|
|
96
48
|
_response_json = _response.json()
|
|
97
49
|
except JSONDecodeError:
|
|
98
50
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
99
51
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
100
52
|
|
|
101
|
-
def create(
|
|
102
|
-
self, agent_id: str, *, text: str, request_options: typing.Optional[RequestOptions] = None
|
|
103
|
-
) -> typing.List[Passage]:
|
|
53
|
+
def create(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
104
54
|
"""
|
|
105
|
-
Insert a memory into an agent's archival memory store.
|
|
106
|
-
|
|
107
55
|
Parameters
|
|
108
56
|
----------
|
|
109
57
|
agent_id : str
|
|
110
58
|
|
|
111
|
-
text : str
|
|
112
|
-
Text to write to archival memory.
|
|
113
|
-
|
|
114
59
|
request_options : typing.Optional[RequestOptions]
|
|
115
60
|
Request-specific configuration.
|
|
116
61
|
|
|
117
62
|
Returns
|
|
118
63
|
-------
|
|
119
|
-
|
|
120
|
-
Successful Response
|
|
64
|
+
None
|
|
121
65
|
|
|
122
66
|
Examples
|
|
123
67
|
--------
|
|
@@ -128,51 +72,23 @@ class ArchivalMemoryClient:
|
|
|
128
72
|
)
|
|
129
73
|
client.agents.archival_memory.create(
|
|
130
74
|
agent_id="agent_id",
|
|
131
|
-
text="text",
|
|
132
75
|
)
|
|
133
76
|
"""
|
|
134
77
|
_response = self._client_wrapper.httpx_client.request(
|
|
135
78
|
f"v1/agents/{jsonable_encoder(agent_id)}/archival_memory",
|
|
136
79
|
method="POST",
|
|
137
|
-
json={
|
|
138
|
-
"text": text,
|
|
139
|
-
},
|
|
140
|
-
headers={
|
|
141
|
-
"content-type": "application/json",
|
|
142
|
-
},
|
|
143
80
|
request_options=request_options,
|
|
144
|
-
omit=OMIT,
|
|
145
81
|
)
|
|
146
82
|
try:
|
|
147
83
|
if 200 <= _response.status_code < 300:
|
|
148
|
-
return
|
|
149
|
-
typing.List[Passage],
|
|
150
|
-
construct_type(
|
|
151
|
-
type_=typing.List[Passage], # type: ignore
|
|
152
|
-
object_=_response.json(),
|
|
153
|
-
),
|
|
154
|
-
)
|
|
155
|
-
if _response.status_code == 422:
|
|
156
|
-
raise UnprocessableEntityError(
|
|
157
|
-
typing.cast(
|
|
158
|
-
HttpValidationError,
|
|
159
|
-
construct_type(
|
|
160
|
-
type_=HttpValidationError, # type: ignore
|
|
161
|
-
object_=_response.json(),
|
|
162
|
-
),
|
|
163
|
-
)
|
|
164
|
-
)
|
|
84
|
+
return
|
|
165
85
|
_response_json = _response.json()
|
|
166
86
|
except JSONDecodeError:
|
|
167
87
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
168
88
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
169
89
|
|
|
170
|
-
def delete(
|
|
171
|
-
self, agent_id: str, memory_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
172
|
-
) -> typing.Optional[typing.Any]:
|
|
90
|
+
def delete(self, agent_id: str, memory_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
173
91
|
"""
|
|
174
|
-
Delete a memory from an agent's archival memory store.
|
|
175
|
-
|
|
176
92
|
Parameters
|
|
177
93
|
----------
|
|
178
94
|
agent_id : str
|
|
@@ -184,8 +100,7 @@ class ArchivalMemoryClient:
|
|
|
184
100
|
|
|
185
101
|
Returns
|
|
186
102
|
-------
|
|
187
|
-
|
|
188
|
-
Successful Response
|
|
103
|
+
None
|
|
189
104
|
|
|
190
105
|
Examples
|
|
191
106
|
--------
|
|
@@ -206,23 +121,7 @@ class ArchivalMemoryClient:
|
|
|
206
121
|
)
|
|
207
122
|
try:
|
|
208
123
|
if 200 <= _response.status_code < 300:
|
|
209
|
-
return
|
|
210
|
-
typing.Optional[typing.Any],
|
|
211
|
-
construct_type(
|
|
212
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
213
|
-
object_=_response.json(),
|
|
214
|
-
),
|
|
215
|
-
)
|
|
216
|
-
if _response.status_code == 422:
|
|
217
|
-
raise UnprocessableEntityError(
|
|
218
|
-
typing.cast(
|
|
219
|
-
HttpValidationError,
|
|
220
|
-
construct_type(
|
|
221
|
-
type_=HttpValidationError, # type: ignore
|
|
222
|
-
object_=_response.json(),
|
|
223
|
-
),
|
|
224
|
-
)
|
|
225
|
-
)
|
|
124
|
+
return
|
|
226
125
|
_response_json = _response.json()
|
|
227
126
|
except JSONDecodeError:
|
|
228
127
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -233,38 +132,18 @@ class AsyncArchivalMemoryClient:
|
|
|
233
132
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
234
133
|
self._client_wrapper = client_wrapper
|
|
235
134
|
|
|
236
|
-
async def list(
|
|
237
|
-
self,
|
|
238
|
-
agent_id: str,
|
|
239
|
-
*,
|
|
240
|
-
after: typing.Optional[int] = None,
|
|
241
|
-
before: typing.Optional[int] = None,
|
|
242
|
-
limit: typing.Optional[int] = None,
|
|
243
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
244
|
-
) -> typing.List[Passage]:
|
|
135
|
+
async def list(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
245
136
|
"""
|
|
246
|
-
Retrieve the memories in an agent's archival memory store (paginated query).
|
|
247
|
-
|
|
248
137
|
Parameters
|
|
249
138
|
----------
|
|
250
139
|
agent_id : str
|
|
251
140
|
|
|
252
|
-
after : typing.Optional[int]
|
|
253
|
-
Unique ID of the memory to start the query range at.
|
|
254
|
-
|
|
255
|
-
before : typing.Optional[int]
|
|
256
|
-
Unique ID of the memory to end the query range at.
|
|
257
|
-
|
|
258
|
-
limit : typing.Optional[int]
|
|
259
|
-
How many results to include in the response.
|
|
260
|
-
|
|
261
141
|
request_options : typing.Optional[RequestOptions]
|
|
262
142
|
Request-specific configuration.
|
|
263
143
|
|
|
264
144
|
Returns
|
|
265
145
|
-------
|
|
266
|
-
|
|
267
|
-
Successful Response
|
|
146
|
+
None
|
|
268
147
|
|
|
269
148
|
Examples
|
|
270
149
|
--------
|
|
@@ -288,57 +167,28 @@ class AsyncArchivalMemoryClient:
|
|
|
288
167
|
_response = await self._client_wrapper.httpx_client.request(
|
|
289
168
|
f"v1/agents/{jsonable_encoder(agent_id)}/archival_memory",
|
|
290
169
|
method="GET",
|
|
291
|
-
params={
|
|
292
|
-
"after": after,
|
|
293
|
-
"before": before,
|
|
294
|
-
"limit": limit,
|
|
295
|
-
},
|
|
296
170
|
request_options=request_options,
|
|
297
171
|
)
|
|
298
172
|
try:
|
|
299
173
|
if 200 <= _response.status_code < 300:
|
|
300
|
-
return
|
|
301
|
-
typing.List[Passage],
|
|
302
|
-
construct_type(
|
|
303
|
-
type_=typing.List[Passage], # type: ignore
|
|
304
|
-
object_=_response.json(),
|
|
305
|
-
),
|
|
306
|
-
)
|
|
307
|
-
if _response.status_code == 422:
|
|
308
|
-
raise UnprocessableEntityError(
|
|
309
|
-
typing.cast(
|
|
310
|
-
HttpValidationError,
|
|
311
|
-
construct_type(
|
|
312
|
-
type_=HttpValidationError, # type: ignore
|
|
313
|
-
object_=_response.json(),
|
|
314
|
-
),
|
|
315
|
-
)
|
|
316
|
-
)
|
|
174
|
+
return
|
|
317
175
|
_response_json = _response.json()
|
|
318
176
|
except JSONDecodeError:
|
|
319
177
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
320
178
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
321
179
|
|
|
322
|
-
async def create(
|
|
323
|
-
self, agent_id: str, *, text: str, request_options: typing.Optional[RequestOptions] = None
|
|
324
|
-
) -> typing.List[Passage]:
|
|
180
|
+
async def create(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
325
181
|
"""
|
|
326
|
-
Insert a memory into an agent's archival memory store.
|
|
327
|
-
|
|
328
182
|
Parameters
|
|
329
183
|
----------
|
|
330
184
|
agent_id : str
|
|
331
185
|
|
|
332
|
-
text : str
|
|
333
|
-
Text to write to archival memory.
|
|
334
|
-
|
|
335
186
|
request_options : typing.Optional[RequestOptions]
|
|
336
187
|
Request-specific configuration.
|
|
337
188
|
|
|
338
189
|
Returns
|
|
339
190
|
-------
|
|
340
|
-
|
|
341
|
-
Successful Response
|
|
191
|
+
None
|
|
342
192
|
|
|
343
193
|
Examples
|
|
344
194
|
--------
|
|
@@ -354,7 +204,6 @@ class AsyncArchivalMemoryClient:
|
|
|
354
204
|
async def main() -> None:
|
|
355
205
|
await client.agents.archival_memory.create(
|
|
356
206
|
agent_id="agent_id",
|
|
357
|
-
text="text",
|
|
358
207
|
)
|
|
359
208
|
|
|
360
209
|
|
|
@@ -363,34 +212,11 @@ class AsyncArchivalMemoryClient:
|
|
|
363
212
|
_response = await self._client_wrapper.httpx_client.request(
|
|
364
213
|
f"v1/agents/{jsonable_encoder(agent_id)}/archival_memory",
|
|
365
214
|
method="POST",
|
|
366
|
-
json={
|
|
367
|
-
"text": text,
|
|
368
|
-
},
|
|
369
|
-
headers={
|
|
370
|
-
"content-type": "application/json",
|
|
371
|
-
},
|
|
372
215
|
request_options=request_options,
|
|
373
|
-
omit=OMIT,
|
|
374
216
|
)
|
|
375
217
|
try:
|
|
376
218
|
if 200 <= _response.status_code < 300:
|
|
377
|
-
return
|
|
378
|
-
typing.List[Passage],
|
|
379
|
-
construct_type(
|
|
380
|
-
type_=typing.List[Passage], # type: ignore
|
|
381
|
-
object_=_response.json(),
|
|
382
|
-
),
|
|
383
|
-
)
|
|
384
|
-
if _response.status_code == 422:
|
|
385
|
-
raise UnprocessableEntityError(
|
|
386
|
-
typing.cast(
|
|
387
|
-
HttpValidationError,
|
|
388
|
-
construct_type(
|
|
389
|
-
type_=HttpValidationError, # type: ignore
|
|
390
|
-
object_=_response.json(),
|
|
391
|
-
),
|
|
392
|
-
)
|
|
393
|
-
)
|
|
219
|
+
return
|
|
394
220
|
_response_json = _response.json()
|
|
395
221
|
except JSONDecodeError:
|
|
396
222
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -398,10 +224,8 @@ class AsyncArchivalMemoryClient:
|
|
|
398
224
|
|
|
399
225
|
async def delete(
|
|
400
226
|
self, agent_id: str, memory_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
401
|
-
) ->
|
|
227
|
+
) -> None:
|
|
402
228
|
"""
|
|
403
|
-
Delete a memory from an agent's archival memory store.
|
|
404
|
-
|
|
405
229
|
Parameters
|
|
406
230
|
----------
|
|
407
231
|
agent_id : str
|
|
@@ -413,8 +237,7 @@ class AsyncArchivalMemoryClient:
|
|
|
413
237
|
|
|
414
238
|
Returns
|
|
415
239
|
-------
|
|
416
|
-
|
|
417
|
-
Successful Response
|
|
240
|
+
None
|
|
418
241
|
|
|
419
242
|
Examples
|
|
420
243
|
--------
|
|
@@ -443,23 +266,7 @@ class AsyncArchivalMemoryClient:
|
|
|
443
266
|
)
|
|
444
267
|
try:
|
|
445
268
|
if 200 <= _response.status_code < 300:
|
|
446
|
-
return
|
|
447
|
-
typing.Optional[typing.Any],
|
|
448
|
-
construct_type(
|
|
449
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
|
450
|
-
object_=_response.json(),
|
|
451
|
-
),
|
|
452
|
-
)
|
|
453
|
-
if _response.status_code == 422:
|
|
454
|
-
raise UnprocessableEntityError(
|
|
455
|
-
typing.cast(
|
|
456
|
-
HttpValidationError,
|
|
457
|
-
construct_type(
|
|
458
|
-
type_=HttpValidationError, # type: ignore
|
|
459
|
-
object_=_response.json(),
|
|
460
|
-
),
|
|
461
|
-
)
|
|
462
|
-
)
|
|
269
|
+
return
|
|
463
270
|
_response_json = _response.json()
|
|
464
271
|
except JSONDecodeError:
|
|
465
272
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|