letta-client 1.0.0a8__py3-none-any.whl → 1.0.0a10__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/_version.py +1 -1
- letta_client/pagination.py +174 -1
- letta_client/resources/agents/agents.py +396 -396
- letta_client/resources/agents/blocks.py +200 -190
- letta_client/resources/agents/files.py +13 -10
- letta_client/resources/agents/messages.py +367 -367
- letta_client/resources/agents/tools.py +6 -6
- letta_client/resources/archives.py +121 -111
- letta_client/resources/batches/messages.py +14 -11
- letta_client/resources/blocks/blocks.py +241 -222
- letta_client/resources/folders/folders.py +133 -133
- 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 +141 -141
- letta_client/resources/tools.py +794 -194
- letta_client/types/__init__.py +11 -8
- 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 +6 -3
- letta_client/types/agents/block.py +6 -3
- letta_client/types/agents/block_list_response.py +63 -0
- letta_client/types/agents/{block_update_params.py → block_modify_params.py} +8 -5
- letta_client/types/agents/block_modify_response.py +63 -0
- letta_client/types/agents/block_retrieve_response.py +63 -0
- letta_client/types/agents/file_list_response.py +3 -14
- 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/archive_list_params.py +3 -0
- letta_client/types/{archive_update_params.py → archive_modify_params.py} +2 -2
- letta_client/types/batches/__init__.py +0 -1
- letta_client/types/block_create_params.py +6 -3
- letta_client/types/block_create_response.py +63 -0
- letta_client/types/block_list_response.py +63 -0
- letta_client/types/{block_update_params.py → block_modify_params.py} +8 -5
- letta_client/types/block_modify_response.py +63 -0
- letta_client/types/block_retrieve_response.py +63 -0
- letta_client/types/create_block_param.py +6 -3
- letta_client/types/{folder_update_params.py → folder_modify_params.py} +2 -2
- 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/identities/__init__.py +1 -0
- letta_client/types/identities/block_list_response.py +63 -0
- letta_client/types/{identity_update_params.py → identity_modify_params.py} +2 -2
- letta_client/types/tool.py +106 -2
- letta_client/types/{tool_update_params.py → tool_modify_params.py} +2 -2
- {letta_client-1.0.0a8.dist-info → letta_client-1.0.0a10.dist-info}/METADATA +1 -1
- {letta_client-1.0.0a8.dist-info → letta_client-1.0.0a10.dist-info}/RECORD +52 -46
- letta_client/types/archive_list_response.py +0 -10
- letta_client/types/batches/message_list_response.py +0 -12
- {letta_client-1.0.0a8.dist-info → letta_client-1.0.0a10.dist-info}/WHEEL +0 -0
- {letta_client-1.0.0a8.dist-info → letta_client-1.0.0a10.dist-info}/licenses/LICENSE +0 -0
|
@@ -124,7 +124,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
124
124
|
extra_query: Query | None = None,
|
|
125
125
|
extra_body: Body | None = None,
|
|
126
126
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
127
|
-
) -> AgentState:
|
|
127
|
+
) -> Optional[AgentState]:
|
|
128
128
|
"""
|
|
129
129
|
Attach a tool to an agent.
|
|
130
130
|
|
|
@@ -164,7 +164,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
164
164
|
extra_query: Query | None = None,
|
|
165
165
|
extra_body: Body | None = None,
|
|
166
166
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
167
|
-
) -> AgentState:
|
|
167
|
+
) -> Optional[AgentState]:
|
|
168
168
|
"""
|
|
169
169
|
Detach a tool from an agent.
|
|
170
170
|
|
|
@@ -206,7 +206,7 @@ class ToolsResource(SyncAPIResource):
|
|
|
206
206
|
extra_query: Query | None = None,
|
|
207
207
|
extra_body: Body | None = None,
|
|
208
208
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
209
|
-
) -> AgentState:
|
|
209
|
+
) -> Optional[AgentState]:
|
|
210
210
|
"""
|
|
211
211
|
Modify the approval requirement for a tool attached to an agent.
|
|
212
212
|
|
|
@@ -349,7 +349,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
349
349
|
extra_query: Query | None = None,
|
|
350
350
|
extra_body: Body | None = None,
|
|
351
351
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
352
|
-
) -> AgentState:
|
|
352
|
+
) -> Optional[AgentState]:
|
|
353
353
|
"""
|
|
354
354
|
Attach a tool to an agent.
|
|
355
355
|
|
|
@@ -389,7 +389,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
389
389
|
extra_query: Query | None = None,
|
|
390
390
|
extra_body: Body | None = None,
|
|
391
391
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
392
|
-
) -> AgentState:
|
|
392
|
+
) -> Optional[AgentState]:
|
|
393
393
|
"""
|
|
394
394
|
Detach a tool from an agent.
|
|
395
395
|
|
|
@@ -431,7 +431,7 @@ class AsyncToolsResource(AsyncAPIResource):
|
|
|
431
431
|
extra_query: Query | None = None,
|
|
432
432
|
extra_body: Body | None = None,
|
|
433
433
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
434
|
-
) -> AgentState:
|
|
434
|
+
) -> Optional[AgentState]:
|
|
435
435
|
"""
|
|
436
436
|
Modify the approval requirement for a tool attached to an agent.
|
|
437
437
|
|
|
@@ -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 ..
|
|
21
|
+
from ..pagination import SyncArrayPage, AsyncArrayPage
|
|
22
|
+
from .._base_client import AsyncPaginator, make_request_options
|
|
22
23
|
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
|
*,
|
|
@@ -177,13 +133,14 @@ class ArchivesResource(SyncAPIResource):
|
|
|
177
133
|
limit: Optional[int] | Omit = omit,
|
|
178
134
|
name: Optional[str] | Omit = omit,
|
|
179
135
|
order: Literal["asc", "desc"] | Omit = omit,
|
|
136
|
+
order_by: Literal["created_at"] | Omit = omit,
|
|
180
137
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
181
138
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
182
139
|
extra_headers: Headers | None = None,
|
|
183
140
|
extra_query: Query | None = None,
|
|
184
141
|
extra_body: Body | None = None,
|
|
185
142
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
186
|
-
) ->
|
|
143
|
+
) -> SyncArrayPage[Archive]:
|
|
187
144
|
"""
|
|
188
145
|
Get a list of all archives for the current organization with optional filters
|
|
189
146
|
and pagination.
|
|
@@ -204,6 +161,8 @@ class ArchivesResource(SyncAPIResource):
|
|
|
204
161
|
order: Sort order for archives by creation time. 'asc' for oldest first, 'desc' for
|
|
205
162
|
newest first
|
|
206
163
|
|
|
164
|
+
order_by: Field to sort by
|
|
165
|
+
|
|
207
166
|
extra_headers: Send extra headers
|
|
208
167
|
|
|
209
168
|
extra_query: Add additional query parameters to the request
|
|
@@ -212,8 +171,9 @@ class ArchivesResource(SyncAPIResource):
|
|
|
212
171
|
|
|
213
172
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
214
173
|
"""
|
|
215
|
-
return self.
|
|
174
|
+
return self._get_api_list(
|
|
216
175
|
"/v1/archives/",
|
|
176
|
+
page=SyncArrayPage[Archive],
|
|
217
177
|
options=make_request_options(
|
|
218
178
|
extra_headers=extra_headers,
|
|
219
179
|
extra_query=extra_query,
|
|
@@ -227,11 +187,12 @@ class ArchivesResource(SyncAPIResource):
|
|
|
227
187
|
"limit": limit,
|
|
228
188
|
"name": name,
|
|
229
189
|
"order": order,
|
|
190
|
+
"order_by": order_by,
|
|
230
191
|
},
|
|
231
192
|
archive_list_params.ArchiveListParams,
|
|
232
193
|
),
|
|
233
194
|
),
|
|
234
|
-
|
|
195
|
+
model=Archive,
|
|
235
196
|
)
|
|
236
197
|
|
|
237
198
|
def delete(
|
|
@@ -269,6 +230,50 @@ class ArchivesResource(SyncAPIResource):
|
|
|
269
230
|
cast_to=Archive,
|
|
270
231
|
)
|
|
271
232
|
|
|
233
|
+
def modify(
|
|
234
|
+
self,
|
|
235
|
+
archive_id: str,
|
|
236
|
+
*,
|
|
237
|
+
description: Optional[str] | Omit = omit,
|
|
238
|
+
name: Optional[str] | Omit = omit,
|
|
239
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
240
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
241
|
+
extra_headers: Headers | None = None,
|
|
242
|
+
extra_query: Query | None = None,
|
|
243
|
+
extra_body: Body | None = None,
|
|
244
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
245
|
+
) -> Archive:
|
|
246
|
+
"""
|
|
247
|
+
Update an existing archive's name and/or description.
|
|
248
|
+
|
|
249
|
+
Args:
|
|
250
|
+
archive_id: The ID of the archive in the format 'archive-<uuid4>'
|
|
251
|
+
|
|
252
|
+
extra_headers: Send extra headers
|
|
253
|
+
|
|
254
|
+
extra_query: Add additional query parameters to the request
|
|
255
|
+
|
|
256
|
+
extra_body: Add additional JSON properties to the request
|
|
257
|
+
|
|
258
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
259
|
+
"""
|
|
260
|
+
if not archive_id:
|
|
261
|
+
raise ValueError(f"Expected a non-empty value for `archive_id` but received {archive_id!r}")
|
|
262
|
+
return self._patch(
|
|
263
|
+
f"/v1/archives/{archive_id}",
|
|
264
|
+
body=maybe_transform(
|
|
265
|
+
{
|
|
266
|
+
"description": description,
|
|
267
|
+
"name": name,
|
|
268
|
+
},
|
|
269
|
+
archive_modify_params.ArchiveModifyParams,
|
|
270
|
+
),
|
|
271
|
+
options=make_request_options(
|
|
272
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
273
|
+
),
|
|
274
|
+
cast_to=Archive,
|
|
275
|
+
)
|
|
276
|
+
|
|
272
277
|
|
|
273
278
|
class AsyncArchivesResource(AsyncAPIResource):
|
|
274
279
|
@cached_property
|
|
@@ -368,51 +373,7 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
368
373
|
cast_to=Archive,
|
|
369
374
|
)
|
|
370
375
|
|
|
371
|
-
|
|
372
|
-
self,
|
|
373
|
-
archive_id: str,
|
|
374
|
-
*,
|
|
375
|
-
description: Optional[str] | Omit = omit,
|
|
376
|
-
name: Optional[str] | Omit = omit,
|
|
377
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
378
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
379
|
-
extra_headers: Headers | None = None,
|
|
380
|
-
extra_query: Query | None = None,
|
|
381
|
-
extra_body: Body | None = None,
|
|
382
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
383
|
-
) -> Archive:
|
|
384
|
-
"""
|
|
385
|
-
Update an existing archive's name and/or description.
|
|
386
|
-
|
|
387
|
-
Args:
|
|
388
|
-
archive_id: The ID of the archive in the format 'archive-<uuid4>'
|
|
389
|
-
|
|
390
|
-
extra_headers: Send extra headers
|
|
391
|
-
|
|
392
|
-
extra_query: Add additional query parameters to the request
|
|
393
|
-
|
|
394
|
-
extra_body: Add additional JSON properties to the request
|
|
395
|
-
|
|
396
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
397
|
-
"""
|
|
398
|
-
if not archive_id:
|
|
399
|
-
raise ValueError(f"Expected a non-empty value for `archive_id` but received {archive_id!r}")
|
|
400
|
-
return await self._patch(
|
|
401
|
-
f"/v1/archives/{archive_id}",
|
|
402
|
-
body=await async_maybe_transform(
|
|
403
|
-
{
|
|
404
|
-
"description": description,
|
|
405
|
-
"name": name,
|
|
406
|
-
},
|
|
407
|
-
archive_update_params.ArchiveUpdateParams,
|
|
408
|
-
),
|
|
409
|
-
options=make_request_options(
|
|
410
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
411
|
-
),
|
|
412
|
-
cast_to=Archive,
|
|
413
|
-
)
|
|
414
|
-
|
|
415
|
-
async def list(
|
|
376
|
+
def list(
|
|
416
377
|
self,
|
|
417
378
|
*,
|
|
418
379
|
after: Optional[str] | Omit = omit,
|
|
@@ -421,13 +382,14 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
421
382
|
limit: Optional[int] | Omit = omit,
|
|
422
383
|
name: Optional[str] | Omit = omit,
|
|
423
384
|
order: Literal["asc", "desc"] | Omit = omit,
|
|
385
|
+
order_by: Literal["created_at"] | Omit = omit,
|
|
424
386
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
425
387
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
426
388
|
extra_headers: Headers | None = None,
|
|
427
389
|
extra_query: Query | None = None,
|
|
428
390
|
extra_body: Body | None = None,
|
|
429
391
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
430
|
-
) ->
|
|
392
|
+
) -> AsyncPaginator[Archive, AsyncArrayPage[Archive]]:
|
|
431
393
|
"""
|
|
432
394
|
Get a list of all archives for the current organization with optional filters
|
|
433
395
|
and pagination.
|
|
@@ -448,6 +410,8 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
448
410
|
order: Sort order for archives by creation time. 'asc' for oldest first, 'desc' for
|
|
449
411
|
newest first
|
|
450
412
|
|
|
413
|
+
order_by: Field to sort by
|
|
414
|
+
|
|
451
415
|
extra_headers: Send extra headers
|
|
452
416
|
|
|
453
417
|
extra_query: Add additional query parameters to the request
|
|
@@ -456,14 +420,15 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
456
420
|
|
|
457
421
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
458
422
|
"""
|
|
459
|
-
return
|
|
423
|
+
return self._get_api_list(
|
|
460
424
|
"/v1/archives/",
|
|
425
|
+
page=AsyncArrayPage[Archive],
|
|
461
426
|
options=make_request_options(
|
|
462
427
|
extra_headers=extra_headers,
|
|
463
428
|
extra_query=extra_query,
|
|
464
429
|
extra_body=extra_body,
|
|
465
430
|
timeout=timeout,
|
|
466
|
-
query=
|
|
431
|
+
query=maybe_transform(
|
|
467
432
|
{
|
|
468
433
|
"after": after,
|
|
469
434
|
"agent_id": agent_id,
|
|
@@ -471,11 +436,12 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
471
436
|
"limit": limit,
|
|
472
437
|
"name": name,
|
|
473
438
|
"order": order,
|
|
439
|
+
"order_by": order_by,
|
|
474
440
|
},
|
|
475
441
|
archive_list_params.ArchiveListParams,
|
|
476
442
|
),
|
|
477
443
|
),
|
|
478
|
-
|
|
444
|
+
model=Archive,
|
|
479
445
|
)
|
|
480
446
|
|
|
481
447
|
async def delete(
|
|
@@ -513,6 +479,50 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
513
479
|
cast_to=Archive,
|
|
514
480
|
)
|
|
515
481
|
|
|
482
|
+
async def modify(
|
|
483
|
+
self,
|
|
484
|
+
archive_id: str,
|
|
485
|
+
*,
|
|
486
|
+
description: Optional[str] | Omit = omit,
|
|
487
|
+
name: Optional[str] | Omit = omit,
|
|
488
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
489
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
490
|
+
extra_headers: Headers | None = None,
|
|
491
|
+
extra_query: Query | None = None,
|
|
492
|
+
extra_body: Body | None = None,
|
|
493
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
494
|
+
) -> Archive:
|
|
495
|
+
"""
|
|
496
|
+
Update an existing archive's name and/or description.
|
|
497
|
+
|
|
498
|
+
Args:
|
|
499
|
+
archive_id: The ID of the archive in the format 'archive-<uuid4>'
|
|
500
|
+
|
|
501
|
+
extra_headers: Send extra headers
|
|
502
|
+
|
|
503
|
+
extra_query: Add additional query parameters to the request
|
|
504
|
+
|
|
505
|
+
extra_body: Add additional JSON properties to the request
|
|
506
|
+
|
|
507
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
508
|
+
"""
|
|
509
|
+
if not archive_id:
|
|
510
|
+
raise ValueError(f"Expected a non-empty value for `archive_id` but received {archive_id!r}")
|
|
511
|
+
return await self._patch(
|
|
512
|
+
f"/v1/archives/{archive_id}",
|
|
513
|
+
body=await async_maybe_transform(
|
|
514
|
+
{
|
|
515
|
+
"description": description,
|
|
516
|
+
"name": name,
|
|
517
|
+
},
|
|
518
|
+
archive_modify_params.ArchiveModifyParams,
|
|
519
|
+
),
|
|
520
|
+
options=make_request_options(
|
|
521
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
522
|
+
),
|
|
523
|
+
cast_to=Archive,
|
|
524
|
+
)
|
|
525
|
+
|
|
516
526
|
|
|
517
527
|
class ArchivesResourceWithRawResponse:
|
|
518
528
|
def __init__(self, archives: ArchivesResource) -> None:
|
|
@@ -524,15 +534,15 @@ class ArchivesResourceWithRawResponse:
|
|
|
524
534
|
self.retrieve = to_raw_response_wrapper(
|
|
525
535
|
archives.retrieve,
|
|
526
536
|
)
|
|
527
|
-
self.update = to_raw_response_wrapper(
|
|
528
|
-
archives.update,
|
|
529
|
-
)
|
|
530
537
|
self.list = to_raw_response_wrapper(
|
|
531
538
|
archives.list,
|
|
532
539
|
)
|
|
533
540
|
self.delete = to_raw_response_wrapper(
|
|
534
541
|
archives.delete,
|
|
535
542
|
)
|
|
543
|
+
self.modify = to_raw_response_wrapper(
|
|
544
|
+
archives.modify,
|
|
545
|
+
)
|
|
536
546
|
|
|
537
547
|
|
|
538
548
|
class AsyncArchivesResourceWithRawResponse:
|
|
@@ -545,15 +555,15 @@ class AsyncArchivesResourceWithRawResponse:
|
|
|
545
555
|
self.retrieve = async_to_raw_response_wrapper(
|
|
546
556
|
archives.retrieve,
|
|
547
557
|
)
|
|
548
|
-
self.update = async_to_raw_response_wrapper(
|
|
549
|
-
archives.update,
|
|
550
|
-
)
|
|
551
558
|
self.list = async_to_raw_response_wrapper(
|
|
552
559
|
archives.list,
|
|
553
560
|
)
|
|
554
561
|
self.delete = async_to_raw_response_wrapper(
|
|
555
562
|
archives.delete,
|
|
556
563
|
)
|
|
564
|
+
self.modify = async_to_raw_response_wrapper(
|
|
565
|
+
archives.modify,
|
|
566
|
+
)
|
|
557
567
|
|
|
558
568
|
|
|
559
569
|
class ArchivesResourceWithStreamingResponse:
|
|
@@ -566,15 +576,15 @@ class ArchivesResourceWithStreamingResponse:
|
|
|
566
576
|
self.retrieve = to_streamed_response_wrapper(
|
|
567
577
|
archives.retrieve,
|
|
568
578
|
)
|
|
569
|
-
self.update = to_streamed_response_wrapper(
|
|
570
|
-
archives.update,
|
|
571
|
-
)
|
|
572
579
|
self.list = to_streamed_response_wrapper(
|
|
573
580
|
archives.list,
|
|
574
581
|
)
|
|
575
582
|
self.delete = to_streamed_response_wrapper(
|
|
576
583
|
archives.delete,
|
|
577
584
|
)
|
|
585
|
+
self.modify = to_streamed_response_wrapper(
|
|
586
|
+
archives.modify,
|
|
587
|
+
)
|
|
578
588
|
|
|
579
589
|
|
|
580
590
|
class AsyncArchivesResourceWithStreamingResponse:
|
|
@@ -587,12 +597,12 @@ class AsyncArchivesResourceWithStreamingResponse:
|
|
|
587
597
|
self.retrieve = async_to_streamed_response_wrapper(
|
|
588
598
|
archives.retrieve,
|
|
589
599
|
)
|
|
590
|
-
self.update = async_to_streamed_response_wrapper(
|
|
591
|
-
archives.update,
|
|
592
|
-
)
|
|
593
600
|
self.list = async_to_streamed_response_wrapper(
|
|
594
601
|
archives.list,
|
|
595
602
|
)
|
|
596
603
|
self.delete = async_to_streamed_response_wrapper(
|
|
597
604
|
archives.delete,
|
|
598
605
|
)
|
|
606
|
+
self.modify = async_to_streamed_response_wrapper(
|
|
607
|
+
archives.modify,
|
|
608
|
+
)
|
|
@@ -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
|
|
12
12
|
from ..._compat import cached_property
|
|
13
13
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
14
14
|
from ..._response import (
|
|
@@ -17,9 +17,10 @@ from ..._response import (
|
|
|
17
17
|
async_to_raw_response_wrapper,
|
|
18
18
|
async_to_streamed_response_wrapper,
|
|
19
19
|
)
|
|
20
|
-
from ...
|
|
20
|
+
from ...pagination import SyncObjectPage, AsyncObjectPage
|
|
21
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
21
22
|
from ...types.batches import message_list_params
|
|
22
|
-
from ...types.
|
|
23
|
+
from ...types.agents.message import Message
|
|
23
24
|
|
|
24
25
|
__all__ = ["MessagesResource", "AsyncMessagesResource"]
|
|
25
26
|
|
|
@@ -60,7 +61,7 @@ class MessagesResource(SyncAPIResource):
|
|
|
60
61
|
extra_query: Query | None = None,
|
|
61
62
|
extra_body: Body | None = None,
|
|
62
63
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
63
|
-
) ->
|
|
64
|
+
) -> SyncObjectPage[Message]:
|
|
64
65
|
"""
|
|
65
66
|
Get response messages for a specific batch job.
|
|
66
67
|
|
|
@@ -90,8 +91,9 @@ class MessagesResource(SyncAPIResource):
|
|
|
90
91
|
"""
|
|
91
92
|
if not batch_id:
|
|
92
93
|
raise ValueError(f"Expected a non-empty value for `batch_id` but received {batch_id!r}")
|
|
93
|
-
return self.
|
|
94
|
+
return self._get_api_list(
|
|
94
95
|
f"/v1/messages/batches/{batch_id}/messages",
|
|
96
|
+
page=SyncObjectPage[Message],
|
|
95
97
|
options=make_request_options(
|
|
96
98
|
extra_headers=extra_headers,
|
|
97
99
|
extra_query=extra_query,
|
|
@@ -109,7 +111,7 @@ class MessagesResource(SyncAPIResource):
|
|
|
109
111
|
message_list_params.MessageListParams,
|
|
110
112
|
),
|
|
111
113
|
),
|
|
112
|
-
|
|
114
|
+
model=Message,
|
|
113
115
|
)
|
|
114
116
|
|
|
115
117
|
|
|
@@ -133,7 +135,7 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
133
135
|
"""
|
|
134
136
|
return AsyncMessagesResourceWithStreamingResponse(self)
|
|
135
137
|
|
|
136
|
-
|
|
138
|
+
def list(
|
|
137
139
|
self,
|
|
138
140
|
batch_id: str,
|
|
139
141
|
*,
|
|
@@ -149,7 +151,7 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
149
151
|
extra_query: Query | None = None,
|
|
150
152
|
extra_body: Body | None = None,
|
|
151
153
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
152
|
-
) ->
|
|
154
|
+
) -> AsyncPaginator[Message, AsyncObjectPage[Message]]:
|
|
153
155
|
"""
|
|
154
156
|
Get response messages for a specific batch job.
|
|
155
157
|
|
|
@@ -179,14 +181,15 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
179
181
|
"""
|
|
180
182
|
if not batch_id:
|
|
181
183
|
raise ValueError(f"Expected a non-empty value for `batch_id` but received {batch_id!r}")
|
|
182
|
-
return
|
|
184
|
+
return self._get_api_list(
|
|
183
185
|
f"/v1/messages/batches/{batch_id}/messages",
|
|
186
|
+
page=AsyncObjectPage[Message],
|
|
184
187
|
options=make_request_options(
|
|
185
188
|
extra_headers=extra_headers,
|
|
186
189
|
extra_query=extra_query,
|
|
187
190
|
extra_body=extra_body,
|
|
188
191
|
timeout=timeout,
|
|
189
|
-
query=
|
|
192
|
+
query=maybe_transform(
|
|
190
193
|
{
|
|
191
194
|
"after": after,
|
|
192
195
|
"agent_id": agent_id,
|
|
@@ -198,7 +201,7 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
198
201
|
message_list_params.MessageListParams,
|
|
199
202
|
),
|
|
200
203
|
),
|
|
201
|
-
|
|
204
|
+
model=Message,
|
|
202
205
|
)
|
|
203
206
|
|
|
204
207
|
|