letta-client 1.0.0a10__py3-none-any.whl → 1.0.0a12__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 +28 -1
- letta_client/_streaming.py +44 -8
- letta_client/_version.py +1 -1
- letta_client/resources/__init__.py +14 -0
- letta_client/resources/agents/agents.py +0 -8
- letta_client/resources/agents/blocks.py +15 -17
- letta_client/resources/agents/files.py +10 -13
- letta_client/resources/agents/folders.py +10 -13
- letta_client/resources/agents/messages.py +14 -4
- letta_client/resources/agents/tools.py +10 -13
- letta_client/resources/archives.py +10 -12
- letta_client/resources/batches/batches.py +10 -12
- letta_client/resources/batches/messages.py +11 -14
- letta_client/resources/blocks/blocks.py +19 -22
- letta_client/resources/folders/agents.py +10 -13
- letta_client/resources/folders/files.py +9 -12
- letta_client/resources/folders/folders.py +10 -12
- letta_client/resources/groups/groups.py +1 -17
- letta_client/resources/identities/blocks.py +7 -7
- letta_client/resources/identities/identities.py +11 -29
- letta_client/resources/mcp_servers/__init__.py +47 -0
- letta_client/resources/mcp_servers/mcp_servers.py +1165 -0
- letta_client/resources/mcp_servers/refresh.py +192 -0
- letta_client/resources/mcp_servers/tools.py +351 -0
- letta_client/resources/runs/runs.py +11 -13
- letta_client/resources/steps/steps.py +1 -9
- letta_client/resources/tags.py +10 -13
- letta_client/resources/tools.py +14 -16
- letta_client/types/__init__.py +13 -4
- letta_client/types/agent_create_params.py +1 -5
- letta_client/types/agents/__init__.py +2 -3
- 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/tool_list_response.py +10 -0
- letta_client/types/archive_list_response.py +10 -0
- 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_list_response.py → block_response.py} +5 -5
- letta_client/types/folder_list_response.py +10 -0
- letta_client/types/folders/agent_list_response.py +2 -1
- letta_client/types/folders/file_list_response.py +7 -4
- letta_client/types/group_create_params.py +1 -5
- letta_client/types/group_modify_params.py +1 -5
- letta_client/types/identities/__init__.py +0 -1
- letta_client/types/identity_create_params.py +1 -5
- letta_client/types/identity_list_response.py +10 -0
- letta_client/types/identity_upsert_params.py +1 -5
- letta_client/types/mcp_server_create_params.py +67 -0
- letta_client/types/mcp_server_create_response.py +74 -0
- letta_client/types/mcp_server_list_response.py +86 -0
- letta_client/types/mcp_server_modify_params.py +76 -0
- letta_client/types/mcp_server_modify_response.py +74 -0
- letta_client/types/mcp_server_retrieve_response.py +74 -0
- letta_client/types/mcp_servers/__init__.py +8 -0
- letta_client/types/mcp_servers/refresh_trigger_params.py +12 -0
- letta_client/types/mcp_servers/tool_list_response.py +10 -0
- letta_client/types/mcp_servers/tool_run_params.py +15 -0
- letta_client/types/mcp_servers/tool_run_response.py +43 -0
- letta_client/types/run_list_response.py +10 -0
- letta_client/types/step_list_params.py +1 -5
- letta_client/types/tag_list_response.py +2 -1
- letta_client/types/tool.py +28 -28
- letta_client/types/tool_list_response.py +10 -0
- {letta_client-1.0.0a10.dist-info → letta_client-1.0.0a12.dist-info}/METADATA +1 -1
- {letta_client-1.0.0a10.dist-info → letta_client-1.0.0a12.dist-info}/RECORD +69 -52
- letta_client/types/agents/block_list_response.py +0 -63
- letta_client/types/agents/block_modify_response.py +0 -63
- letta_client/types/agents/block_retrieve_response.py +0 -63
- letta_client/types/block_create_response.py +0 -63
- letta_client/types/block_modify_response.py +0 -63
- letta_client/types/block_retrieve_response.py +0 -63
- letta_client/types/identities/block_list_response.py +0 -63
- {letta_client-1.0.0a10.dist-info → letta_client-1.0.0a12.dist-info}/WHEEL +0 -0
- {letta_client-1.0.0a10.dist-info → letta_client-1.0.0a12.dist-info}/licenses/LICENSE +0 -0
|
@@ -17,6 +17,7 @@ from ..._response import (
|
|
|
17
17
|
async_to_raw_response_wrapper,
|
|
18
18
|
async_to_streamed_response_wrapper,
|
|
19
19
|
)
|
|
20
|
+
from ..._streaming import Stream, AsyncStream
|
|
20
21
|
from ...pagination import SyncArrayPage, AsyncArrayPage
|
|
21
22
|
from ..._base_client import AsyncPaginator, make_request_options
|
|
22
23
|
from ...types.agents import (
|
|
@@ -35,6 +36,7 @@ from ...types.agents.letta_response import LettaResponse
|
|
|
35
36
|
from ...types.agents.letta_message_union import LettaMessageUnion
|
|
36
37
|
from ...types.agents.message_cancel_response import MessageCancelResponse
|
|
37
38
|
from ...types.agents.message_modify_response import MessageModifyResponse
|
|
39
|
+
from ...types.agents.letta_streaming_response import LettaStreamingResponse
|
|
38
40
|
from ...types.agents.letta_user_message_content_union_param import LettaUserMessageContentUnionParam
|
|
39
41
|
from ...types.agents.letta_assistant_message_content_union_param import LettaAssistantMessageContentUnionParam
|
|
40
42
|
|
|
@@ -597,7 +599,7 @@ class MessagesResource(SyncAPIResource):
|
|
|
597
599
|
extra_query: Query | None = None,
|
|
598
600
|
extra_body: Body | None = None,
|
|
599
601
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
600
|
-
) ->
|
|
602
|
+
) -> Stream[LettaStreamingResponse]:
|
|
601
603
|
"""Process a user message and return the agent's response.
|
|
602
604
|
|
|
603
605
|
This endpoint accepts a
|
|
@@ -664,7 +666,11 @@ class MessagesResource(SyncAPIResource):
|
|
|
664
666
|
options=make_request_options(
|
|
665
667
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
666
668
|
),
|
|
667
|
-
cast_to=
|
|
669
|
+
cast_to=cast(
|
|
670
|
+
Any, LettaStreamingResponse
|
|
671
|
+
), # Union types cannot be passed in as arguments in the type system
|
|
672
|
+
stream=True,
|
|
673
|
+
stream_cls=Stream[LettaStreamingResponse],
|
|
668
674
|
)
|
|
669
675
|
|
|
670
676
|
def summarize(
|
|
@@ -1260,7 +1266,7 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
1260
1266
|
extra_query: Query | None = None,
|
|
1261
1267
|
extra_body: Body | None = None,
|
|
1262
1268
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1263
|
-
) ->
|
|
1269
|
+
) -> AsyncStream[LettaStreamingResponse]:
|
|
1264
1270
|
"""Process a user message and return the agent's response.
|
|
1265
1271
|
|
|
1266
1272
|
This endpoint accepts a
|
|
@@ -1327,7 +1333,11 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
1327
1333
|
options=make_request_options(
|
|
1328
1334
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1329
1335
|
),
|
|
1330
|
-
cast_to=
|
|
1336
|
+
cast_to=cast(
|
|
1337
|
+
Any, LettaStreamingResponse
|
|
1338
|
+
), # Union types cannot be passed in as arguments in the type system
|
|
1339
|
+
stream=True,
|
|
1340
|
+
stream_cls=AsyncStream[LettaStreamingResponse],
|
|
1331
1341
|
)
|
|
1332
1342
|
|
|
1333
1343
|
async def summarize(
|
|
@@ -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(
|
|
@@ -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"]
|
|
@@ -140,7 +140,7 @@ class ArchivesResource(SyncAPIResource):
|
|
|
140
140
|
extra_query: Query | None = None,
|
|
141
141
|
extra_body: Body | None = None,
|
|
142
142
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
143
|
-
) ->
|
|
143
|
+
) -> ArchiveListResponse:
|
|
144
144
|
"""
|
|
145
145
|
Get a list of all archives for the current organization with optional filters
|
|
146
146
|
and pagination.
|
|
@@ -171,9 +171,8 @@ class ArchivesResource(SyncAPIResource):
|
|
|
171
171
|
|
|
172
172
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
173
173
|
"""
|
|
174
|
-
return self.
|
|
174
|
+
return self._get(
|
|
175
175
|
"/v1/archives/",
|
|
176
|
-
page=SyncArrayPage[Archive],
|
|
177
176
|
options=make_request_options(
|
|
178
177
|
extra_headers=extra_headers,
|
|
179
178
|
extra_query=extra_query,
|
|
@@ -192,7 +191,7 @@ class ArchivesResource(SyncAPIResource):
|
|
|
192
191
|
archive_list_params.ArchiveListParams,
|
|
193
192
|
),
|
|
194
193
|
),
|
|
195
|
-
|
|
194
|
+
cast_to=ArchiveListResponse,
|
|
196
195
|
)
|
|
197
196
|
|
|
198
197
|
def delete(
|
|
@@ -373,7 +372,7 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
373
372
|
cast_to=Archive,
|
|
374
373
|
)
|
|
375
374
|
|
|
376
|
-
def list(
|
|
375
|
+
async def list(
|
|
377
376
|
self,
|
|
378
377
|
*,
|
|
379
378
|
after: Optional[str] | Omit = omit,
|
|
@@ -389,7 +388,7 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
389
388
|
extra_query: Query | None = None,
|
|
390
389
|
extra_body: Body | None = None,
|
|
391
390
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
392
|
-
) ->
|
|
391
|
+
) -> ArchiveListResponse:
|
|
393
392
|
"""
|
|
394
393
|
Get a list of all archives for the current organization with optional filters
|
|
395
394
|
and pagination.
|
|
@@ -420,15 +419,14 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
420
419
|
|
|
421
420
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
422
421
|
"""
|
|
423
|
-
return self.
|
|
422
|
+
return await self._get(
|
|
424
423
|
"/v1/archives/",
|
|
425
|
-
page=AsyncArrayPage[Archive],
|
|
426
424
|
options=make_request_options(
|
|
427
425
|
extra_headers=extra_headers,
|
|
428
426
|
extra_query=extra_query,
|
|
429
427
|
extra_body=extra_body,
|
|
430
428
|
timeout=timeout,
|
|
431
|
-
query=
|
|
429
|
+
query=await async_maybe_transform(
|
|
432
430
|
{
|
|
433
431
|
"after": after,
|
|
434
432
|
"agent_id": agent_id,
|
|
@@ -441,7 +439,7 @@ class AsyncArchivesResource(AsyncAPIResource):
|
|
|
441
439
|
archive_list_params.ArchiveListParams,
|
|
442
440
|
),
|
|
443
441
|
),
|
|
444
|
-
|
|
442
|
+
cast_to=ArchiveListResponse,
|
|
445
443
|
)
|
|
446
444
|
|
|
447
445
|
async def delete(
|
|
@@ -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
|
|
|
@@ -28,11 +28,8 @@ from ..._response import (
|
|
|
28
28
|
)
|
|
29
29
|
from ...pagination import SyncArrayPage, AsyncArrayPage
|
|
30
30
|
from ..._base_client import AsyncPaginator, make_request_options
|
|
31
|
-
from ...types.
|
|
31
|
+
from ...types.block_response import BlockResponse
|
|
32
32
|
from ...types.block_count_response import BlockCountResponse
|
|
33
|
-
from ...types.block_create_response import BlockCreateResponse
|
|
34
|
-
from ...types.block_modify_response import BlockModifyResponse
|
|
35
|
-
from ...types.block_retrieve_response import BlockRetrieveResponse
|
|
36
33
|
|
|
37
34
|
__all__ = ["BlocksResource", "AsyncBlocksResource"]
|
|
38
35
|
|
|
@@ -85,7 +82,7 @@ class BlocksResource(SyncAPIResource):
|
|
|
85
82
|
extra_query: Query | None = None,
|
|
86
83
|
extra_body: Body | None = None,
|
|
87
84
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
88
|
-
) ->
|
|
85
|
+
) -> BlockResponse:
|
|
89
86
|
"""
|
|
90
87
|
Create Block
|
|
91
88
|
|
|
@@ -151,7 +148,7 @@ class BlocksResource(SyncAPIResource):
|
|
|
151
148
|
options=make_request_options(
|
|
152
149
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
153
150
|
),
|
|
154
|
-
cast_to=
|
|
151
|
+
cast_to=BlockResponse,
|
|
155
152
|
)
|
|
156
153
|
|
|
157
154
|
def retrieve(
|
|
@@ -164,7 +161,7 @@ class BlocksResource(SyncAPIResource):
|
|
|
164
161
|
extra_query: Query | None = None,
|
|
165
162
|
extra_body: Body | None = None,
|
|
166
163
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
167
|
-
) ->
|
|
164
|
+
) -> BlockResponse:
|
|
168
165
|
"""
|
|
169
166
|
Retrieve Block
|
|
170
167
|
|
|
@@ -186,7 +183,7 @@ class BlocksResource(SyncAPIResource):
|
|
|
186
183
|
options=make_request_options(
|
|
187
184
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
188
185
|
),
|
|
189
|
-
cast_to=
|
|
186
|
+
cast_to=BlockResponse,
|
|
190
187
|
)
|
|
191
188
|
|
|
192
189
|
def list(
|
|
@@ -215,7 +212,7 @@ class BlocksResource(SyncAPIResource):
|
|
|
215
212
|
extra_query: Query | None = None,
|
|
216
213
|
extra_body: Body | None = None,
|
|
217
214
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
218
|
-
) -> SyncArrayPage[
|
|
215
|
+
) -> SyncArrayPage[BlockResponse]:
|
|
219
216
|
"""List Blocks
|
|
220
217
|
|
|
221
218
|
Args:
|
|
@@ -273,7 +270,7 @@ class BlocksResource(SyncAPIResource):
|
|
|
273
270
|
"""
|
|
274
271
|
return self._get_api_list(
|
|
275
272
|
"/v1/blocks/",
|
|
276
|
-
page=SyncArrayPage[
|
|
273
|
+
page=SyncArrayPage[BlockResponse],
|
|
277
274
|
options=make_request_options(
|
|
278
275
|
extra_headers=extra_headers,
|
|
279
276
|
extra_query=extra_query,
|
|
@@ -302,7 +299,7 @@ class BlocksResource(SyncAPIResource):
|
|
|
302
299
|
block_list_params.BlockListParams,
|
|
303
300
|
),
|
|
304
301
|
),
|
|
305
|
-
model=
|
|
302
|
+
model=BlockResponse,
|
|
306
303
|
)
|
|
307
304
|
|
|
308
305
|
def delete(
|
|
@@ -384,7 +381,7 @@ class BlocksResource(SyncAPIResource):
|
|
|
384
381
|
extra_query: Query | None = None,
|
|
385
382
|
extra_body: Body | None = None,
|
|
386
383
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
387
|
-
) ->
|
|
384
|
+
) -> BlockResponse:
|
|
388
385
|
"""
|
|
389
386
|
Modify Block
|
|
390
387
|
|
|
@@ -456,7 +453,7 @@ class BlocksResource(SyncAPIResource):
|
|
|
456
453
|
options=make_request_options(
|
|
457
454
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
458
455
|
),
|
|
459
|
-
cast_to=
|
|
456
|
+
cast_to=BlockResponse,
|
|
460
457
|
)
|
|
461
458
|
|
|
462
459
|
|
|
@@ -508,7 +505,7 @@ class AsyncBlocksResource(AsyncAPIResource):
|
|
|
508
505
|
extra_query: Query | None = None,
|
|
509
506
|
extra_body: Body | None = None,
|
|
510
507
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
511
|
-
) ->
|
|
508
|
+
) -> BlockResponse:
|
|
512
509
|
"""
|
|
513
510
|
Create Block
|
|
514
511
|
|
|
@@ -574,7 +571,7 @@ class AsyncBlocksResource(AsyncAPIResource):
|
|
|
574
571
|
options=make_request_options(
|
|
575
572
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
576
573
|
),
|
|
577
|
-
cast_to=
|
|
574
|
+
cast_to=BlockResponse,
|
|
578
575
|
)
|
|
579
576
|
|
|
580
577
|
async def retrieve(
|
|
@@ -587,7 +584,7 @@ class AsyncBlocksResource(AsyncAPIResource):
|
|
|
587
584
|
extra_query: Query | None = None,
|
|
588
585
|
extra_body: Body | None = None,
|
|
589
586
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
590
|
-
) ->
|
|
587
|
+
) -> BlockResponse:
|
|
591
588
|
"""
|
|
592
589
|
Retrieve Block
|
|
593
590
|
|
|
@@ -609,7 +606,7 @@ class AsyncBlocksResource(AsyncAPIResource):
|
|
|
609
606
|
options=make_request_options(
|
|
610
607
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
611
608
|
),
|
|
612
|
-
cast_to=
|
|
609
|
+
cast_to=BlockResponse,
|
|
613
610
|
)
|
|
614
611
|
|
|
615
612
|
def list(
|
|
@@ -638,7 +635,7 @@ class AsyncBlocksResource(AsyncAPIResource):
|
|
|
638
635
|
extra_query: Query | None = None,
|
|
639
636
|
extra_body: Body | None = None,
|
|
640
637
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
641
|
-
) -> AsyncPaginator[
|
|
638
|
+
) -> AsyncPaginator[BlockResponse, AsyncArrayPage[BlockResponse]]:
|
|
642
639
|
"""List Blocks
|
|
643
640
|
|
|
644
641
|
Args:
|
|
@@ -696,7 +693,7 @@ class AsyncBlocksResource(AsyncAPIResource):
|
|
|
696
693
|
"""
|
|
697
694
|
return self._get_api_list(
|
|
698
695
|
"/v1/blocks/",
|
|
699
|
-
page=AsyncArrayPage[
|
|
696
|
+
page=AsyncArrayPage[BlockResponse],
|
|
700
697
|
options=make_request_options(
|
|
701
698
|
extra_headers=extra_headers,
|
|
702
699
|
extra_query=extra_query,
|
|
@@ -725,7 +722,7 @@ class AsyncBlocksResource(AsyncAPIResource):
|
|
|
725
722
|
block_list_params.BlockListParams,
|
|
726
723
|
),
|
|
727
724
|
),
|
|
728
|
-
model=
|
|
725
|
+
model=BlockResponse,
|
|
729
726
|
)
|
|
730
727
|
|
|
731
728
|
async def delete(
|
|
@@ -807,7 +804,7 @@ class AsyncBlocksResource(AsyncAPIResource):
|
|
|
807
804
|
extra_query: Query | None = None,
|
|
808
805
|
extra_body: Body | None = None,
|
|
809
806
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
810
|
-
) ->
|
|
807
|
+
) -> BlockResponse:
|
|
811
808
|
"""
|
|
812
809
|
Modify Block
|
|
813
810
|
|
|
@@ -879,7 +876,7 @@ class AsyncBlocksResource(AsyncAPIResource):
|
|
|
879
876
|
options=make_request_options(
|
|
880
877
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
881
878
|
),
|
|
882
|
-
cast_to=
|
|
879
|
+
cast_to=BlockResponse,
|
|
883
880
|
)
|
|
884
881
|
|
|
885
882
|
|
|
@@ -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,8 +17,7 @@ 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.folders import agent_list_params
|
|
23
22
|
from ...types.folders.agent_list_response import AgentListResponse
|
|
24
23
|
|
|
@@ -60,7 +59,7 @@ class AgentsResource(SyncAPIResource):
|
|
|
60
59
|
extra_query: Query | None = None,
|
|
61
60
|
extra_body: Body | None = None,
|
|
62
61
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
63
|
-
) ->
|
|
62
|
+
) -> AgentListResponse:
|
|
64
63
|
"""
|
|
65
64
|
Get all agent IDs that have the specified folder attached.
|
|
66
65
|
|
|
@@ -90,9 +89,8 @@ class AgentsResource(SyncAPIResource):
|
|
|
90
89
|
"""
|
|
91
90
|
if not folder_id:
|
|
92
91
|
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
93
|
-
return self.
|
|
92
|
+
return self._get(
|
|
94
93
|
f"/v1/folders/{folder_id}/agents",
|
|
95
|
-
page=SyncArrayPage[AgentListResponse],
|
|
96
94
|
options=make_request_options(
|
|
97
95
|
extra_headers=extra_headers,
|
|
98
96
|
extra_query=extra_query,
|
|
@@ -109,7 +107,7 @@ class AgentsResource(SyncAPIResource):
|
|
|
109
107
|
agent_list_params.AgentListParams,
|
|
110
108
|
),
|
|
111
109
|
),
|
|
112
|
-
|
|
110
|
+
cast_to=AgentListResponse,
|
|
113
111
|
)
|
|
114
112
|
|
|
115
113
|
|
|
@@ -133,7 +131,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
133
131
|
"""
|
|
134
132
|
return AsyncAgentsResourceWithStreamingResponse(self)
|
|
135
133
|
|
|
136
|
-
def list(
|
|
134
|
+
async def list(
|
|
137
135
|
self,
|
|
138
136
|
folder_id: str,
|
|
139
137
|
*,
|
|
@@ -148,7 +146,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
148
146
|
extra_query: Query | None = None,
|
|
149
147
|
extra_body: Body | None = None,
|
|
150
148
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
151
|
-
) ->
|
|
149
|
+
) -> AgentListResponse:
|
|
152
150
|
"""
|
|
153
151
|
Get all agent IDs that have the specified folder attached.
|
|
154
152
|
|
|
@@ -178,15 +176,14 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
178
176
|
"""
|
|
179
177
|
if not folder_id:
|
|
180
178
|
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
181
|
-
return self.
|
|
179
|
+
return await self._get(
|
|
182
180
|
f"/v1/folders/{folder_id}/agents",
|
|
183
|
-
page=AsyncArrayPage[AgentListResponse],
|
|
184
181
|
options=make_request_options(
|
|
185
182
|
extra_headers=extra_headers,
|
|
186
183
|
extra_query=extra_query,
|
|
187
184
|
extra_body=extra_body,
|
|
188
185
|
timeout=timeout,
|
|
189
|
-
query=
|
|
186
|
+
query=await async_maybe_transform(
|
|
190
187
|
{
|
|
191
188
|
"after": after,
|
|
192
189
|
"before": before,
|
|
@@ -197,7 +194,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
197
194
|
agent_list_params.AgentListParams,
|
|
198
195
|
),
|
|
199
196
|
),
|
|
200
|
-
|
|
197
|
+
cast_to=AgentListResponse,
|
|
201
198
|
)
|
|
202
199
|
|
|
203
200
|
|