letta-client 1.0.0a9__py3-none-any.whl → 1.0.0a11__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/_client.py +5 -1
- letta_client/_streaming.py +40 -2
- letta_client/_version.py +1 -1
- letta_client/resources/agents/agents.py +396 -396
- letta_client/resources/agents/blocks.py +198 -190
- letta_client/resources/agents/files.py +10 -13
- letta_client/resources/agents/folders.py +10 -13
- letta_client/resources/agents/messages.py +380 -370
- letta_client/resources/agents/tools.py +10 -13
- letta_client/resources/archives.py +111 -113
- letta_client/resources/batches/batches.py +10 -12
- letta_client/resources/batches/messages.py +11 -14
- letta_client/resources/blocks/blocks.py +238 -222
- letta_client/resources/folders/agents.py +10 -13
- letta_client/resources/folders/files.py +9 -12
- letta_client/resources/folders/folders.py +143 -145
- letta_client/resources/groups/groups.py +141 -141
- letta_client/resources/groups/messages.py +198 -198
- letta_client/resources/identities/blocks.py +7 -7
- letta_client/resources/identities/identities.py +151 -153
- letta_client/resources/runs/runs.py +11 -13
- letta_client/resources/tags.py +10 -13
- letta_client/resources/tools.py +802 -204
- letta_client/types/__init__.py +14 -7
- letta_client/types/{agent_update_params.py → agent_modify_params.py} +2 -2
- letta_client/types/agent_state.py +6 -3
- letta_client/types/agents/__init__.py +5 -3
- letta_client/types/agents/block.py +6 -3
- letta_client/types/agents/{block_update_params.py → block_modify_params.py} +8 -5
- letta_client/types/agents/file_list_response.py +14 -3
- letta_client/types/agents/folder_list_response.py +7 -3
- letta_client/types/agents/letta_streaming_response.py +70 -0
- letta_client/types/agents/{message_update_params.py → message_modify_params.py} +2 -2
- letta_client/types/agents/{message_update_response.py → message_modify_response.py} +2 -2
- letta_client/types/agents/tool_list_response.py +10 -0
- letta_client/types/archive_list_response.py +10 -0
- letta_client/types/{archive_update_params.py → archive_modify_params.py} +2 -2
- letta_client/types/batch_list_response.py +10 -0
- letta_client/types/batches/__init__.py +1 -0
- letta_client/types/batches/message_list_response.py +12 -0
- letta_client/types/block_create_params.py +6 -3
- letta_client/types/{block_update_params.py → block_modify_params.py} +8 -5
- letta_client/types/block_response.py +63 -0
- letta_client/types/create_block_param.py +6 -3
- letta_client/types/folder_list_response.py +10 -0
- letta_client/types/{folder_update_params.py → folder_modify_params.py} +2 -2
- letta_client/types/folders/agent_list_response.py +2 -1
- letta_client/types/folders/file_list_response.py +7 -4
- letta_client/types/{group_update_params.py → group_modify_params.py} +2 -2
- letta_client/types/groups/__init__.py +2 -2
- letta_client/types/groups/{message_update_params.py → message_modify_params.py} +2 -2
- letta_client/types/groups/{message_update_response.py → message_modify_response.py} +2 -2
- letta_client/types/identity_list_response.py +10 -0
- letta_client/types/{identity_update_params.py → identity_modify_params.py} +2 -2
- letta_client/types/run_list_response.py +10 -0
- letta_client/types/tag_list_response.py +2 -1
- letta_client/types/tool.py +106 -2
- letta_client/types/tool_list_response.py +10 -0
- letta_client/types/{tool_update_params.py → tool_modify_params.py} +2 -2
- {letta_client-1.0.0a9.dist-info → letta_client-1.0.0a11.dist-info}/METADATA +1 -1
- {letta_client-1.0.0a9.dist-info → letta_client-1.0.0a11.dist-info}/RECORD +63 -53
- {letta_client-1.0.0a9.dist-info → letta_client-1.0.0a11.dist-info}/WHEEL +0 -0
- {letta_client-1.0.0a9.dist-info → letta_client-1.0.0a11.dist-info}/licenses/LICENSE +0 -0
|
@@ -17,11 +17,10 @@ from ..._response import (
|
|
|
17
17
|
async_to_raw_response_wrapper,
|
|
18
18
|
async_to_streamed_response_wrapper,
|
|
19
19
|
)
|
|
20
|
-
from ...
|
|
21
|
-
from ...types.tool import Tool
|
|
22
|
-
from ..._base_client import AsyncPaginator, make_request_options
|
|
20
|
+
from ..._base_client import make_request_options
|
|
23
21
|
from ...types.agents import tool_list_params, tool_update_approval_params
|
|
24
22
|
from ...types.agent_state import AgentState
|
|
23
|
+
from ...types.agents.tool_list_response import ToolListResponse
|
|
25
24
|
|
|
26
25
|
__all__ = ["ToolsResource", "AsyncToolsResource"]
|
|
27
26
|
|
|
@@ -61,7 +60,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
61
60
|
extra_query: Query | None = None,
|
|
62
61
|
extra_body: Body | None = None,
|
|
63
62
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
64
|
-
) ->
|
|
63
|
+
) -> ToolListResponse:
|
|
65
64
|
"""
|
|
66
65
|
Get tools from an existing agent.
|
|
67
66
|
|
|
@@ -91,9 +90,8 @@ class ToolsResource(SyncAPIResource):
|
|
|
91
90
|
"""
|
|
92
91
|
if not agent_id:
|
|
93
92
|
raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
|
|
94
|
-
return self.
|
|
93
|
+
return self._get(
|
|
95
94
|
f"/v1/agents/{agent_id}/tools",
|
|
96
|
-
page=SyncArrayPage[Tool],
|
|
97
95
|
options=make_request_options(
|
|
98
96
|
extra_headers=extra_headers,
|
|
99
97
|
extra_query=extra_query,
|
|
@@ -110,7 +108,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
110
108
|
tool_list_params.ToolListParams,
|
|
111
109
|
),
|
|
112
110
|
),
|
|
113
|
-
|
|
111
|
+
cast_to=ToolListResponse,
|
|
114
112
|
)
|
|
115
113
|
|
|
116
114
|
def attach(
|
|
@@ -271,7 +269,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
271
269
|
"""
|
|
272
270
|
return AsyncToolsResourceWithStreamingResponse(self)
|
|
273
271
|
|
|
274
|
-
def list(
|
|
272
|
+
async def list(
|
|
275
273
|
self,
|
|
276
274
|
agent_id: str,
|
|
277
275
|
*,
|
|
@@ -286,7 +284,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
286
284
|
extra_query: Query | None = None,
|
|
287
285
|
extra_body: Body | None = None,
|
|
288
286
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
289
|
-
) ->
|
|
287
|
+
) -> ToolListResponse:
|
|
290
288
|
"""
|
|
291
289
|
Get tools from an existing agent.
|
|
292
290
|
|
|
@@ -316,15 +314,14 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
316
314
|
"""
|
|
317
315
|
if not agent_id:
|
|
318
316
|
raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
|
|
319
|
-
return self.
|
|
317
|
+
return await self._get(
|
|
320
318
|
f"/v1/agents/{agent_id}/tools",
|
|
321
|
-
page=AsyncArrayPage[Tool],
|
|
322
319
|
options=make_request_options(
|
|
323
320
|
extra_headers=extra_headers,
|
|
324
321
|
extra_query=extra_query,
|
|
325
322
|
extra_body=extra_body,
|
|
326
323
|
timeout=timeout,
|
|
327
|
-
query=
|
|
324
|
+
query=await async_maybe_transform(
|
|
328
325
|
{
|
|
329
326
|
"after": after,
|
|
330
327
|
"before": before,
|
|
@@ -335,7 +332,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
335
332
|
tool_list_params.ToolListParams,
|
|
336
333
|
),
|
|
337
334
|
),
|
|
338
|
-
|
|
335
|
+
cast_to=ToolListResponse,
|
|
339
336
|
)
|
|
340
337
|
|
|
341
338
|
async def attach(
|
|
@@ -7,7 +7,7 @@ from typing_extensions import Literal
|
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
|
-
from ..types import archive_list_params, archive_create_params,
|
|
10
|
+
from ..types import archive_list_params, archive_create_params, archive_modify_params
|
|
11
11
|
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
12
12
|
from .._utils import maybe_transform, async_maybe_transform
|
|
13
13
|
from .._compat import cached_property
|
|
@@ -18,9 +18,9 @@ from .._response import (
|
|
|
18
18
|
async_to_raw_response_wrapper,
|
|
19
19
|
async_to_streamed_response_wrapper,
|
|
20
20
|
)
|
|
21
|
-
from ..
|
|
22
|
-
from .._base_client import AsyncPaginator, make_request_options
|
|
21
|
+
from .._base_client import make_request_options
|
|
23
22
|
from ..types.archive import Archive
|
|
23
|
+
from ..types.archive_list_response import ArchiveListResponse
|
|
24
24
|
from ..types.embedding_config_param import EmbeddingConfigParam
|
|
25
25
|
|
|
26
26
|
__all__ = ["ArchivesResource", "AsyncArchivesResource"]
|
|
@@ -124,50 +124,6 @@ class ArchivesResource(SyncAPIResource):
|
|
|
124
124
|
cast_to=Archive,
|
|
125
125
|
)
|
|
126
126
|
|
|
127
|
-
def update(
|
|
128
|
-
self,
|
|
129
|
-
archive_id: str,
|
|
130
|
-
*,
|
|
131
|
-
description: Optional[str] | Omit = omit,
|
|
132
|
-
name: Optional[str] | Omit = omit,
|
|
133
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
134
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
135
|
-
extra_headers: Headers | None = None,
|
|
136
|
-
extra_query: Query | None = None,
|
|
137
|
-
extra_body: Body | None = None,
|
|
138
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
139
|
-
) -> Archive:
|
|
140
|
-
"""
|
|
141
|
-
Update an existing archive's name and/or description.
|
|
142
|
-
|
|
143
|
-
Args:
|
|
144
|
-
archive_id: The ID of the archive in the format 'archive-<uuid4>'
|
|
145
|
-
|
|
146
|
-
extra_headers: Send extra headers
|
|
147
|
-
|
|
148
|
-
extra_query: Add additional query parameters to the request
|
|
149
|
-
|
|
150
|
-
extra_body: Add additional JSON properties to the request
|
|
151
|
-
|
|
152
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
153
|
-
"""
|
|
154
|
-
if not archive_id:
|
|
155
|
-
raise ValueError(f"Expected a non-empty value for `archive_id` but received {archive_id!r}")
|
|
156
|
-
return self._patch(
|
|
157
|
-
f"/v1/archives/{archive_id}",
|
|
158
|
-
body=maybe_transform(
|
|
159
|
-
{
|
|
160
|
-
"description": description,
|
|
161
|
-
"name": name,
|
|
162
|
-
},
|
|
163
|
-
archive_update_params.ArchiveUpdateParams,
|
|
164
|
-
),
|
|
165
|
-
options=make_request_options(
|
|
166
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
167
|
-
),
|
|
168
|
-
cast_to=Archive,
|
|
169
|
-
)
|
|
170
|
-
|
|
171
127
|
def list(
|
|
172
128
|
self,
|
|
173
129
|
*,
|
|
@@ -184,7 +140,7 @@ class ArchivesResource(SyncAPIResource):
|
|
|
184
140
|
extra_query: Query | None = None,
|
|
185
141
|
extra_body: Body | None = None,
|
|
186
142
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
187
|
-
) ->
|
|
143
|
+
) -> ArchiveListResponse:
|
|
188
144
|
"""
|
|
189
145
|
Get a list of all archives for the current organization with optional filters
|
|
190
146
|
and pagination.
|
|
@@ -215,9 +171,8 @@ class ArchivesResource(SyncAPIResource):
|
|
|
215
171
|
|
|
216
172
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
217
173
|
"""
|
|
218
|
-
return self.
|
|
174
|
+
return self._get(
|
|
219
175
|
"/v1/archives/",
|
|
220
|
-
page=SyncArrayPage[Archive],
|
|
221
176
|
options=make_request_options(
|
|
222
177
|
extra_headers=extra_headers,
|
|
223
178
|
extra_query=extra_query,
|
|
@@ -236,7 +191,7 @@ class ArchivesResource(SyncAPIResource):
|
|
|
236
191
|
archive_list_params.ArchiveListParams,
|
|
237
192
|
),
|
|
238
193
|
),
|
|
239
|
-
|
|
194
|
+
cast_to=ArchiveListResponse,
|
|
240
195
|
)
|
|
241
196
|
|
|
242
197
|
def delete(
|
|
@@ -274,6 +229,50 @@ class ArchivesResource(SyncAPIResource):
|
|
|
274
229
|
cast_to=Archive,
|
|
275
230
|
)
|
|
276
231
|
|
|
232
|
+
def modify(
|
|
233
|
+
self,
|
|
234
|
+
archive_id: str,
|
|
235
|
+
*,
|
|
236
|
+
description: Optional[str] | Omit = omit,
|
|
237
|
+
name: Optional[str] | Omit = omit,
|
|
238
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
239
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
240
|
+
extra_headers: Headers | None = None,
|
|
241
|
+
extra_query: Query | None = None,
|
|
242
|
+
extra_body: Body | None = None,
|
|
243
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
244
|
+
) -> Archive:
|
|
245
|
+
"""
|
|
246
|
+
Update an existing archive's name and/or description.
|
|
247
|
+
|
|
248
|
+
Args:
|
|
249
|
+
archive_id: The ID of the archive in the format 'archive-<uuid4>'
|
|
250
|
+
|
|
251
|
+
extra_headers: Send extra headers
|
|
252
|
+
|
|
253
|
+
extra_query: Add additional query parameters to the request
|
|
254
|
+
|
|
255
|
+
extra_body: Add additional JSON properties to the request
|
|
256
|
+
|
|
257
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
258
|
+
"""
|
|
259
|
+
if not archive_id:
|
|
260
|
+
raise ValueError(f"Expected a non-empty value for `archive_id` but received {archive_id!r}")
|
|
261
|
+
return self._patch(
|
|
262
|
+
f"/v1/archives/{archive_id}",
|
|
263
|
+
body=maybe_transform(
|
|
264
|
+
{
|
|
265
|
+
"description": description,
|
|
266
|
+
"name": name,
|
|
267
|
+
},
|
|
268
|
+
archive_modify_params.ArchiveModifyParams,
|
|
269
|
+
),
|
|
270
|
+
options=make_request_options(
|
|
271
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
272
|
+
),
|
|
273
|
+
cast_to=Archive,
|
|
274
|
+
)
|
|
275
|
+
|
|
277
276
|
|
|
278
277
|
class AsyncArchivesResource(AsyncAPIResource):
|
|
279
278
|
@cached_property
|
|
@@ -373,51 +372,7 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
373
372
|
cast_to=Archive,
|
|
374
373
|
)
|
|
375
374
|
|
|
376
|
-
async def
|
|
377
|
-
self,
|
|
378
|
-
archive_id: str,
|
|
379
|
-
*,
|
|
380
|
-
description: Optional[str] | Omit = omit,
|
|
381
|
-
name: Optional[str] | Omit = omit,
|
|
382
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
383
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
384
|
-
extra_headers: Headers | None = None,
|
|
385
|
-
extra_query: Query | None = None,
|
|
386
|
-
extra_body: Body | None = None,
|
|
387
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
388
|
-
) -> Archive:
|
|
389
|
-
"""
|
|
390
|
-
Update an existing archive's name and/or description.
|
|
391
|
-
|
|
392
|
-
Args:
|
|
393
|
-
archive_id: The ID of the archive in the format 'archive-<uuid4>'
|
|
394
|
-
|
|
395
|
-
extra_headers: Send extra headers
|
|
396
|
-
|
|
397
|
-
extra_query: Add additional query parameters to the request
|
|
398
|
-
|
|
399
|
-
extra_body: Add additional JSON properties to the request
|
|
400
|
-
|
|
401
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
402
|
-
"""
|
|
403
|
-
if not archive_id:
|
|
404
|
-
raise ValueError(f"Expected a non-empty value for `archive_id` but received {archive_id!r}")
|
|
405
|
-
return await self._patch(
|
|
406
|
-
f"/v1/archives/{archive_id}",
|
|
407
|
-
body=await async_maybe_transform(
|
|
408
|
-
{
|
|
409
|
-
"description": description,
|
|
410
|
-
"name": name,
|
|
411
|
-
},
|
|
412
|
-
archive_update_params.ArchiveUpdateParams,
|
|
413
|
-
),
|
|
414
|
-
options=make_request_options(
|
|
415
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
416
|
-
),
|
|
417
|
-
cast_to=Archive,
|
|
418
|
-
)
|
|
419
|
-
|
|
420
|
-
def list(
|
|
375
|
+
async def list(
|
|
421
376
|
self,
|
|
422
377
|
*,
|
|
423
378
|
after: Optional[str] | Omit = omit,
|
|
@@ -433,7 +388,7 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
433
388
|
extra_query: Query | None = None,
|
|
434
389
|
extra_body: Body | None = None,
|
|
435
390
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
436
|
-
) ->
|
|
391
|
+
) -> ArchiveListResponse:
|
|
437
392
|
"""
|
|
438
393
|
Get a list of all archives for the current organization with optional filters
|
|
439
394
|
and pagination.
|
|
@@ -464,15 +419,14 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
464
419
|
|
|
465
420
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
466
421
|
"""
|
|
467
|
-
return self.
|
|
422
|
+
return await self._get(
|
|
468
423
|
"/v1/archives/",
|
|
469
|
-
page=AsyncArrayPage[Archive],
|
|
470
424
|
options=make_request_options(
|
|
471
425
|
extra_headers=extra_headers,
|
|
472
426
|
extra_query=extra_query,
|
|
473
427
|
extra_body=extra_body,
|
|
474
428
|
timeout=timeout,
|
|
475
|
-
query=
|
|
429
|
+
query=await async_maybe_transform(
|
|
476
430
|
{
|
|
477
431
|
"after": after,
|
|
478
432
|
"agent_id": agent_id,
|
|
@@ -485,7 +439,7 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
485
439
|
archive_list_params.ArchiveListParams,
|
|
486
440
|
),
|
|
487
441
|
),
|
|
488
|
-
|
|
442
|
+
cast_to=ArchiveListResponse,
|
|
489
443
|
)
|
|
490
444
|
|
|
491
445
|
async def delete(
|
|
@@ -523,6 +477,50 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
523
477
|
cast_to=Archive,
|
|
524
478
|
)
|
|
525
479
|
|
|
480
|
+
async def modify(
|
|
481
|
+
self,
|
|
482
|
+
archive_id: str,
|
|
483
|
+
*,
|
|
484
|
+
description: Optional[str] | Omit = omit,
|
|
485
|
+
name: Optional[str] | Omit = omit,
|
|
486
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
487
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
488
|
+
extra_headers: Headers | None = None,
|
|
489
|
+
extra_query: Query | None = None,
|
|
490
|
+
extra_body: Body | None = None,
|
|
491
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
492
|
+
) -> Archive:
|
|
493
|
+
"""
|
|
494
|
+
Update an existing archive's name and/or description.
|
|
495
|
+
|
|
496
|
+
Args:
|
|
497
|
+
archive_id: The ID of the archive in the format 'archive-<uuid4>'
|
|
498
|
+
|
|
499
|
+
extra_headers: Send extra headers
|
|
500
|
+
|
|
501
|
+
extra_query: Add additional query parameters to the request
|
|
502
|
+
|
|
503
|
+
extra_body: Add additional JSON properties to the request
|
|
504
|
+
|
|
505
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
506
|
+
"""
|
|
507
|
+
if not archive_id:
|
|
508
|
+
raise ValueError(f"Expected a non-empty value for `archive_id` but received {archive_id!r}")
|
|
509
|
+
return await self._patch(
|
|
510
|
+
f"/v1/archives/{archive_id}",
|
|
511
|
+
body=await async_maybe_transform(
|
|
512
|
+
{
|
|
513
|
+
"description": description,
|
|
514
|
+
"name": name,
|
|
515
|
+
},
|
|
516
|
+
archive_modify_params.ArchiveModifyParams,
|
|
517
|
+
),
|
|
518
|
+
options=make_request_options(
|
|
519
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
520
|
+
),
|
|
521
|
+
cast_to=Archive,
|
|
522
|
+
)
|
|
523
|
+
|
|
526
524
|
|
|
527
525
|
class ArchivesResourceWithRawResponse:
|
|
528
526
|
def __init__(self, archives: ArchivesResource) -> None:
|
|
@@ -534,15 +532,15 @@ class ArchivesResourceWithRawResponse:
|
|
|
534
532
|
self.retrieve = to_raw_response_wrapper(
|
|
535
533
|
archives.retrieve,
|
|
536
534
|
)
|
|
537
|
-
self.update = to_raw_response_wrapper(
|
|
538
|
-
archives.update,
|
|
539
|
-
)
|
|
540
535
|
self.list = to_raw_response_wrapper(
|
|
541
536
|
archives.list,
|
|
542
537
|
)
|
|
543
538
|
self.delete = to_raw_response_wrapper(
|
|
544
539
|
archives.delete,
|
|
545
540
|
)
|
|
541
|
+
self.modify = to_raw_response_wrapper(
|
|
542
|
+
archives.modify,
|
|
543
|
+
)
|
|
546
544
|
|
|
547
545
|
|
|
548
546
|
class AsyncArchivesResourceWithRawResponse:
|
|
@@ -555,15 +553,15 @@ class AsyncArchivesResourceWithRawResponse:
|
|
|
555
553
|
self.retrieve = async_to_raw_response_wrapper(
|
|
556
554
|
archives.retrieve,
|
|
557
555
|
)
|
|
558
|
-
self.update = async_to_raw_response_wrapper(
|
|
559
|
-
archives.update,
|
|
560
|
-
)
|
|
561
556
|
self.list = async_to_raw_response_wrapper(
|
|
562
557
|
archives.list,
|
|
563
558
|
)
|
|
564
559
|
self.delete = async_to_raw_response_wrapper(
|
|
565
560
|
archives.delete,
|
|
566
561
|
)
|
|
562
|
+
self.modify = async_to_raw_response_wrapper(
|
|
563
|
+
archives.modify,
|
|
564
|
+
)
|
|
567
565
|
|
|
568
566
|
|
|
569
567
|
class ArchivesResourceWithStreamingResponse:
|
|
@@ -576,15 +574,15 @@ class ArchivesResourceWithStreamingResponse:
|
|
|
576
574
|
self.retrieve = to_streamed_response_wrapper(
|
|
577
575
|
archives.retrieve,
|
|
578
576
|
)
|
|
579
|
-
self.update = to_streamed_response_wrapper(
|
|
580
|
-
archives.update,
|
|
581
|
-
)
|
|
582
577
|
self.list = to_streamed_response_wrapper(
|
|
583
578
|
archives.list,
|
|
584
579
|
)
|
|
585
580
|
self.delete = to_streamed_response_wrapper(
|
|
586
581
|
archives.delete,
|
|
587
582
|
)
|
|
583
|
+
self.modify = to_streamed_response_wrapper(
|
|
584
|
+
archives.modify,
|
|
585
|
+
)
|
|
588
586
|
|
|
589
587
|
|
|
590
588
|
class AsyncArchivesResourceWithStreamingResponse:
|
|
@@ -597,12 +595,12 @@ class AsyncArchivesResourceWithStreamingResponse:
|
|
|
597
595
|
self.retrieve = async_to_streamed_response_wrapper(
|
|
598
596
|
archives.retrieve,
|
|
599
597
|
)
|
|
600
|
-
self.update = async_to_streamed_response_wrapper(
|
|
601
|
-
archives.update,
|
|
602
|
-
)
|
|
603
598
|
self.list = async_to_streamed_response_wrapper(
|
|
604
599
|
archives.list,
|
|
605
600
|
)
|
|
606
601
|
self.delete = async_to_streamed_response_wrapper(
|
|
607
602
|
archives.delete,
|
|
608
603
|
)
|
|
604
|
+
self.modify = async_to_streamed_response_wrapper(
|
|
605
|
+
archives.modify,
|
|
606
|
+
)
|
|
@@ -26,9 +26,9 @@ from ..._response import (
|
|
|
26
26
|
async_to_raw_response_wrapper,
|
|
27
27
|
async_to_streamed_response_wrapper,
|
|
28
28
|
)
|
|
29
|
-
from ...
|
|
30
|
-
from ..._base_client import AsyncPaginator, make_request_options
|
|
29
|
+
from ..._base_client import make_request_options
|
|
31
30
|
from ...types.batch_job import BatchJob
|
|
31
|
+
from ...types.batch_list_response import BatchListResponse
|
|
32
32
|
|
|
33
33
|
__all__ = ["BatchesResource", "AsyncBatchesResource"]
|
|
34
34
|
|
|
@@ -155,7 +155,7 @@ class BatchesResource(SyncAPIResource):
|
|
|
155
155
|
extra_query: Query | None = None,
|
|
156
156
|
extra_body: Body | None = None,
|
|
157
157
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
158
|
-
) ->
|
|
158
|
+
) -> BatchListResponse:
|
|
159
159
|
"""List all batch runs.
|
|
160
160
|
|
|
161
161
|
Args:
|
|
@@ -182,9 +182,8 @@ class BatchesResource(SyncAPIResource):
|
|
|
182
182
|
|
|
183
183
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
184
184
|
"""
|
|
185
|
-
return self.
|
|
185
|
+
return self._get(
|
|
186
186
|
"/v1/messages/batches",
|
|
187
|
-
page=SyncArrayPage[BatchJob],
|
|
188
187
|
options=make_request_options(
|
|
189
188
|
extra_headers=extra_headers,
|
|
190
189
|
extra_query=extra_query,
|
|
@@ -201,7 +200,7 @@ class BatchesResource(SyncAPIResource):
|
|
|
201
200
|
batch_list_params.BatchListParams,
|
|
202
201
|
),
|
|
203
202
|
),
|
|
204
|
-
|
|
203
|
+
cast_to=BatchListResponse,
|
|
205
204
|
)
|
|
206
205
|
|
|
207
206
|
def cancel(
|
|
@@ -346,7 +345,7 @@ class AsyncBatchesResource(AsyncAPIResource):
|
|
|
346
345
|
cast_to=BatchJob,
|
|
347
346
|
)
|
|
348
347
|
|
|
349
|
-
def list(
|
|
348
|
+
async def list(
|
|
350
349
|
self,
|
|
351
350
|
*,
|
|
352
351
|
after: Optional[str] | Omit = omit,
|
|
@@ -360,7 +359,7 @@ class AsyncBatchesResource(AsyncAPIResource):
|
|
|
360
359
|
extra_query: Query | None = None,
|
|
361
360
|
extra_body: Body | None = None,
|
|
362
361
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
363
|
-
) ->
|
|
362
|
+
) -> BatchListResponse:
|
|
364
363
|
"""List all batch runs.
|
|
365
364
|
|
|
366
365
|
Args:
|
|
@@ -387,15 +386,14 @@ class AsyncBatchesResource(AsyncAPIResource):
|
|
|
387
386
|
|
|
388
387
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
389
388
|
"""
|
|
390
|
-
return self.
|
|
389
|
+
return await self._get(
|
|
391
390
|
"/v1/messages/batches",
|
|
392
|
-
page=AsyncArrayPage[BatchJob],
|
|
393
391
|
options=make_request_options(
|
|
394
392
|
extra_headers=extra_headers,
|
|
395
393
|
extra_query=extra_query,
|
|
396
394
|
extra_body=extra_body,
|
|
397
395
|
timeout=timeout,
|
|
398
|
-
query=
|
|
396
|
+
query=await async_maybe_transform(
|
|
399
397
|
{
|
|
400
398
|
"after": after,
|
|
401
399
|
"before": before,
|
|
@@ -406,7 +404,7 @@ class AsyncBatchesResource(AsyncAPIResource):
|
|
|
406
404
|
batch_list_params.BatchListParams,
|
|
407
405
|
),
|
|
408
406
|
),
|
|
409
|
-
|
|
407
|
+
cast_to=BatchListResponse,
|
|
410
408
|
)
|
|
411
409
|
|
|
412
410
|
async def cancel(
|
|
@@ -8,7 +8,7 @@ from typing_extensions import Literal
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
10
|
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
11
|
-
from ..._utils import maybe_transform
|
|
11
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
12
12
|
from ..._compat import cached_property
|
|
13
13
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
14
14
|
from ..._response import (
|
|
@@ -17,10 +17,9 @@ from ..._response import (
|
|
|
17
17
|
async_to_raw_response_wrapper,
|
|
18
18
|
async_to_streamed_response_wrapper,
|
|
19
19
|
)
|
|
20
|
-
from ...
|
|
21
|
-
from ..._base_client import AsyncPaginator, make_request_options
|
|
20
|
+
from ..._base_client import make_request_options
|
|
22
21
|
from ...types.batches import message_list_params
|
|
23
|
-
from ...types.
|
|
22
|
+
from ...types.batches.message_list_response import MessageListResponse
|
|
24
23
|
|
|
25
24
|
__all__ = ["MessagesResource", "AsyncMessagesResource"]
|
|
26
25
|
|
|
@@ -61,7 +60,7 @@ class MessagesResource(SyncAPIResource):
|
|
|
61
60
|
extra_query: Query | None = None,
|
|
62
61
|
extra_body: Body | None = None,
|
|
63
62
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
64
|
-
) ->
|
|
63
|
+
) -> MessageListResponse:
|
|
65
64
|
"""
|
|
66
65
|
Get response messages for a specific batch job.
|
|
67
66
|
|
|
@@ -91,9 +90,8 @@ class MessagesResource(SyncAPIResource):
|
|
|
91
90
|
"""
|
|
92
91
|
if not batch_id:
|
|
93
92
|
raise ValueError(f"Expected a non-empty value for `batch_id` but received {batch_id!r}")
|
|
94
|
-
return self.
|
|
93
|
+
return self._get(
|
|
95
94
|
f"/v1/messages/batches/{batch_id}/messages",
|
|
96
|
-
page=SyncObjectPage[Message],
|
|
97
95
|
options=make_request_options(
|
|
98
96
|
extra_headers=extra_headers,
|
|
99
97
|
extra_query=extra_query,
|
|
@@ -111,7 +109,7 @@ class MessagesResource(SyncAPIResource):
|
|
|
111
109
|
message_list_params.MessageListParams,
|
|
112
110
|
),
|
|
113
111
|
),
|
|
114
|
-
|
|
112
|
+
cast_to=MessageListResponse,
|
|
115
113
|
)
|
|
116
114
|
|
|
117
115
|
|
|
@@ -135,7 +133,7 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
135
133
|
"""
|
|
136
134
|
return AsyncMessagesResourceWithStreamingResponse(self)
|
|
137
135
|
|
|
138
|
-
def list(
|
|
136
|
+
async def list(
|
|
139
137
|
self,
|
|
140
138
|
batch_id: str,
|
|
141
139
|
*,
|
|
@@ -151,7 +149,7 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
151
149
|
extra_query: Query | None = None,
|
|
152
150
|
extra_body: Body | None = None,
|
|
153
151
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
154
|
-
) ->
|
|
152
|
+
) -> MessageListResponse:
|
|
155
153
|
"""
|
|
156
154
|
Get response messages for a specific batch job.
|
|
157
155
|
|
|
@@ -181,15 +179,14 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
181
179
|
"""
|
|
182
180
|
if not batch_id:
|
|
183
181
|
raise ValueError(f"Expected a non-empty value for `batch_id` but received {batch_id!r}")
|
|
184
|
-
return self.
|
|
182
|
+
return await self._get(
|
|
185
183
|
f"/v1/messages/batches/{batch_id}/messages",
|
|
186
|
-
page=AsyncObjectPage[Message],
|
|
187
184
|
options=make_request_options(
|
|
188
185
|
extra_headers=extra_headers,
|
|
189
186
|
extra_query=extra_query,
|
|
190
187
|
extra_body=extra_body,
|
|
191
188
|
timeout=timeout,
|
|
192
|
-
query=
|
|
189
|
+
query=await async_maybe_transform(
|
|
193
190
|
{
|
|
194
191
|
"after": after,
|
|
195
192
|
"agent_id": agent_id,
|
|
@@ -201,7 +198,7 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
201
198
|
message_list_params.MessageListParams,
|
|
202
199
|
),
|
|
203
200
|
),
|
|
204
|
-
|
|
201
|
+
cast_to=MessageListResponse,
|
|
205
202
|
)
|
|
206
203
|
|
|
207
204
|
|