letta-client 1.0.0a7__py3-none-any.whl → 1.0.0a9__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 +280 -0
- letta_client/resources/agents/agents.py +12 -10
- letta_client/resources/agents/blocks.py +12 -10
- letta_client/resources/agents/files.py +13 -10
- letta_client/resources/agents/folders.py +13 -10
- letta_client/resources/agents/groups.py +14 -11
- letta_client/resources/agents/messages.py +13 -10
- letta_client/resources/agents/tools.py +19 -16
- letta_client/resources/archives.py +20 -10
- letta_client/resources/batches/batches.py +12 -10
- letta_client/resources/batches/messages.py +14 -11
- letta_client/resources/blocks/agents.py +14 -11
- letta_client/resources/blocks/blocks.py +12 -10
- letta_client/resources/folders/agents.py +13 -10
- letta_client/resources/folders/files.py +12 -9
- letta_client/resources/folders/folders.py +12 -10
- letta_client/resources/groups/groups.py +12 -10
- letta_client/resources/groups/messages.py +13 -10
- letta_client/resources/identities/agents.py +14 -11
- letta_client/resources/identities/blocks.py +14 -11
- letta_client/resources/identities/identities.py +12 -10
- letta_client/resources/runs/messages.py +14 -11
- letta_client/resources/runs/runs.py +13 -11
- letta_client/resources/runs/steps.py +14 -11
- letta_client/resources/steps/messages.py +14 -11
- letta_client/resources/steps/steps.py +13 -11
- letta_client/resources/tags.py +13 -10
- letta_client/resources/tools.py +12 -10
- letta_client/types/__init__.py +0 -10
- letta_client/types/agents/__init__.py +0 -4
- letta_client/types/agents/file_list_response.py +3 -14
- letta_client/types/agents/folder_list_response.py +3 -7
- letta_client/types/archive_list_params.py +3 -0
- letta_client/types/batches/__init__.py +0 -1
- letta_client/types/blocks/__init__.py +0 -1
- letta_client/types/folders/agent_list_response.py +1 -2
- letta_client/types/folders/file_list_response.py +4 -7
- letta_client/types/groups/__init__.py +0 -1
- letta_client/types/identities/__init__.py +0 -2
- letta_client/types/runs/__init__.py +0 -2
- letta_client/types/steps/message_list_response.py +3 -5
- letta_client/types/tag_list_response.py +1 -2
- {letta_client-1.0.0a7.dist-info → letta_client-1.0.0a9.dist-info}/METADATA +1 -1
- {letta_client-1.0.0a7.dist-info → letta_client-1.0.0a9.dist-info}/RECORD +47 -67
- letta_client/types/agent_list_response.py +0 -10
- letta_client/types/agents/block_list_response.py +0 -10
- letta_client/types/agents/group_list_response.py +0 -10
- letta_client/types/agents/message_list_response.py +0 -10
- letta_client/types/agents/tool_list_response.py +0 -10
- letta_client/types/archive_list_response.py +0 -10
- letta_client/types/batch_list_response.py +0 -10
- letta_client/types/batches/message_list_response.py +0 -12
- letta_client/types/block_list_response.py +0 -10
- letta_client/types/blocks/agent_list_response.py +0 -10
- letta_client/types/folder_list_response.py +0 -10
- letta_client/types/group_list_response.py +0 -10
- letta_client/types/groups/message_list_response.py +0 -10
- letta_client/types/identities/agent_list_response.py +0 -10
- letta_client/types/identities/block_list_response.py +0 -10
- letta_client/types/identity_list_response.py +0 -10
- letta_client/types/run_list_response.py +0 -10
- letta_client/types/runs/message_list_response.py +0 -10
- letta_client/types/runs/step_list_response.py +0 -10
- letta_client/types/step_list_response.py +0 -10
- letta_client/types/tool_list_response.py +0 -10
- {letta_client-1.0.0a7.dist-info → letta_client-1.0.0a9.dist-info}/WHEEL +0 -0
- {letta_client-1.0.0a7.dist-info → letta_client-1.0.0a9.dist-info}/licenses/LICENSE +0 -0
|
@@ -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, SequenceNotStr, 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 SyncArrayPage, AsyncArrayPage
|
|
21
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
21
22
|
from ...types.blocks import agent_list_params
|
|
22
|
-
from ...types.
|
|
23
|
+
from ...types.agent_state import AgentState
|
|
23
24
|
|
|
24
25
|
__all__ = ["AgentsResource", "AsyncAgentsResource"]
|
|
25
26
|
|
|
@@ -72,7 +73,7 @@ class AgentsResource(SyncAPIResource):
|
|
|
72
73
|
extra_query: Query | None = None,
|
|
73
74
|
extra_body: Body | None = None,
|
|
74
75
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
75
|
-
) ->
|
|
76
|
+
) -> SyncArrayPage[AgentState]:
|
|
76
77
|
"""Retrieves all agents associated with the specified block.
|
|
77
78
|
|
|
78
79
|
Raises a 404 if the
|
|
@@ -112,8 +113,9 @@ class AgentsResource(SyncAPIResource):
|
|
|
112
113
|
"""
|
|
113
114
|
if not block_id:
|
|
114
115
|
raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}")
|
|
115
|
-
return self.
|
|
116
|
+
return self._get_api_list(
|
|
116
117
|
f"/v1/blocks/{block_id}/agents",
|
|
118
|
+
page=SyncArrayPage[AgentState],
|
|
117
119
|
options=make_request_options(
|
|
118
120
|
extra_headers=extra_headers,
|
|
119
121
|
extra_query=extra_query,
|
|
@@ -132,7 +134,7 @@ class AgentsResource(SyncAPIResource):
|
|
|
132
134
|
agent_list_params.AgentListParams,
|
|
133
135
|
),
|
|
134
136
|
),
|
|
135
|
-
|
|
137
|
+
model=AgentState,
|
|
136
138
|
)
|
|
137
139
|
|
|
138
140
|
|
|
@@ -156,7 +158,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
156
158
|
"""
|
|
157
159
|
return AsyncAgentsResourceWithStreamingResponse(self)
|
|
158
160
|
|
|
159
|
-
|
|
161
|
+
def list(
|
|
160
162
|
self,
|
|
161
163
|
block_id: str,
|
|
162
164
|
*,
|
|
@@ -184,7 +186,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
184
186
|
extra_query: Query | None = None,
|
|
185
187
|
extra_body: Body | None = None,
|
|
186
188
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
187
|
-
) ->
|
|
189
|
+
) -> AsyncPaginator[AgentState, AsyncArrayPage[AgentState]]:
|
|
188
190
|
"""Retrieves all agents associated with the specified block.
|
|
189
191
|
|
|
190
192
|
Raises a 404 if the
|
|
@@ -224,14 +226,15 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
224
226
|
"""
|
|
225
227
|
if not block_id:
|
|
226
228
|
raise ValueError(f"Expected a non-empty value for `block_id` but received {block_id!r}")
|
|
227
|
-
return
|
|
229
|
+
return self._get_api_list(
|
|
228
230
|
f"/v1/blocks/{block_id}/agents",
|
|
231
|
+
page=AsyncArrayPage[AgentState],
|
|
229
232
|
options=make_request_options(
|
|
230
233
|
extra_headers=extra_headers,
|
|
231
234
|
extra_query=extra_query,
|
|
232
235
|
extra_body=extra_body,
|
|
233
236
|
timeout=timeout,
|
|
234
|
-
query=
|
|
237
|
+
query=maybe_transform(
|
|
235
238
|
{
|
|
236
239
|
"after": after,
|
|
237
240
|
"before": before,
|
|
@@ -244,7 +247,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
244
247
|
agent_list_params.AgentListParams,
|
|
245
248
|
),
|
|
246
249
|
),
|
|
247
|
-
|
|
250
|
+
model=AgentState,
|
|
248
251
|
)
|
|
249
252
|
|
|
250
253
|
|
|
@@ -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 ...
|
|
29
|
+
from ...pagination import SyncArrayPage, AsyncArrayPage
|
|
30
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
30
31
|
from ...types.agents.block import Block
|
|
31
|
-
from ...types.block_list_response import BlockListResponse
|
|
32
32
|
from ...types.block_count_response import BlockCountResponse
|
|
33
33
|
|
|
34
34
|
__all__ = ["BlocksResource", "AsyncBlocksResource"]
|
|
@@ -304,7 +304,7 @@ class BlocksResource(SyncAPIResource):
|
|
|
304
304
|
extra_query: Query | None = None,
|
|
305
305
|
extra_body: Body | None = None,
|
|
306
306
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
307
|
-
) ->
|
|
307
|
+
) -> SyncArrayPage[Block]:
|
|
308
308
|
"""List Blocks
|
|
309
309
|
|
|
310
310
|
Args:
|
|
@@ -360,8 +360,9 @@ class BlocksResource(SyncAPIResource):
|
|
|
360
360
|
|
|
361
361
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
362
362
|
"""
|
|
363
|
-
return self.
|
|
363
|
+
return self._get_api_list(
|
|
364
364
|
"/v1/blocks/",
|
|
365
|
+
page=SyncArrayPage[Block],
|
|
365
366
|
options=make_request_options(
|
|
366
367
|
extra_headers=extra_headers,
|
|
367
368
|
extra_query=extra_query,
|
|
@@ -390,7 +391,7 @@ class BlocksResource(SyncAPIResource):
|
|
|
390
391
|
block_list_params.BlockListParams,
|
|
391
392
|
),
|
|
392
393
|
),
|
|
393
|
-
|
|
394
|
+
model=Block,
|
|
394
395
|
)
|
|
395
396
|
|
|
396
397
|
def delete(
|
|
@@ -692,7 +693,7 @@ class AsyncBlocksResource(AsyncAPIResource):
|
|
|
692
693
|
cast_to=Block,
|
|
693
694
|
)
|
|
694
695
|
|
|
695
|
-
|
|
696
|
+
def list(
|
|
696
697
|
self,
|
|
697
698
|
*,
|
|
698
699
|
after: Optional[str] | Omit = omit,
|
|
@@ -718,7 +719,7 @@ class AsyncBlocksResource(AsyncAPIResource):
|
|
|
718
719
|
extra_query: Query | None = None,
|
|
719
720
|
extra_body: Body | None = None,
|
|
720
721
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
721
|
-
) ->
|
|
722
|
+
) -> AsyncPaginator[Block, AsyncArrayPage[Block]]:
|
|
722
723
|
"""List Blocks
|
|
723
724
|
|
|
724
725
|
Args:
|
|
@@ -774,14 +775,15 @@ class AsyncBlocksResource(AsyncAPIResource):
|
|
|
774
775
|
|
|
775
776
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
776
777
|
"""
|
|
777
|
-
return
|
|
778
|
+
return self._get_api_list(
|
|
778
779
|
"/v1/blocks/",
|
|
780
|
+
page=AsyncArrayPage[Block],
|
|
779
781
|
options=make_request_options(
|
|
780
782
|
extra_headers=extra_headers,
|
|
781
783
|
extra_query=extra_query,
|
|
782
784
|
extra_body=extra_body,
|
|
783
785
|
timeout=timeout,
|
|
784
|
-
query=
|
|
786
|
+
query=maybe_transform(
|
|
785
787
|
{
|
|
786
788
|
"after": after,
|
|
787
789
|
"before": before,
|
|
@@ -804,7 +806,7 @@ class AsyncBlocksResource(AsyncAPIResource):
|
|
|
804
806
|
block_list_params.BlockListParams,
|
|
805
807
|
),
|
|
806
808
|
),
|
|
807
|
-
|
|
809
|
+
model=Block,
|
|
808
810
|
)
|
|
809
811
|
|
|
810
812
|
async def delete(
|
|
@@ -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,7 +17,8 @@ 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 SyncArrayPage, AsyncArrayPage
|
|
21
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
21
22
|
from ...types.folders import agent_list_params
|
|
22
23
|
from ...types.folders.agent_list_response import AgentListResponse
|
|
23
24
|
|
|
@@ -59,7 +60,7 @@ class AgentsResource(SyncAPIResource):
|
|
|
59
60
|
extra_query: Query | None = None,
|
|
60
61
|
extra_body: Body | None = None,
|
|
61
62
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
62
|
-
) -> AgentListResponse:
|
|
63
|
+
) -> SyncArrayPage[AgentListResponse]:
|
|
63
64
|
"""
|
|
64
65
|
Get all agent IDs that have the specified folder attached.
|
|
65
66
|
|
|
@@ -89,8 +90,9 @@ class AgentsResource(SyncAPIResource):
|
|
|
89
90
|
"""
|
|
90
91
|
if not folder_id:
|
|
91
92
|
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
92
|
-
return self.
|
|
93
|
+
return self._get_api_list(
|
|
93
94
|
f"/v1/folders/{folder_id}/agents",
|
|
95
|
+
page=SyncArrayPage[AgentListResponse],
|
|
94
96
|
options=make_request_options(
|
|
95
97
|
extra_headers=extra_headers,
|
|
96
98
|
extra_query=extra_query,
|
|
@@ -107,7 +109,7 @@ class AgentsResource(SyncAPIResource):
|
|
|
107
109
|
agent_list_params.AgentListParams,
|
|
108
110
|
),
|
|
109
111
|
),
|
|
110
|
-
|
|
112
|
+
model=str,
|
|
111
113
|
)
|
|
112
114
|
|
|
113
115
|
|
|
@@ -131,7 +133,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
131
133
|
"""
|
|
132
134
|
return AsyncAgentsResourceWithStreamingResponse(self)
|
|
133
135
|
|
|
134
|
-
|
|
136
|
+
def list(
|
|
135
137
|
self,
|
|
136
138
|
folder_id: str,
|
|
137
139
|
*,
|
|
@@ -146,7 +148,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
146
148
|
extra_query: Query | None = None,
|
|
147
149
|
extra_body: Body | None = None,
|
|
148
150
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
149
|
-
) -> AgentListResponse:
|
|
151
|
+
) -> AsyncPaginator[AgentListResponse, AsyncArrayPage[AgentListResponse]]:
|
|
150
152
|
"""
|
|
151
153
|
Get all agent IDs that have the specified folder attached.
|
|
152
154
|
|
|
@@ -176,14 +178,15 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
176
178
|
"""
|
|
177
179
|
if not folder_id:
|
|
178
180
|
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
179
|
-
return
|
|
181
|
+
return self._get_api_list(
|
|
180
182
|
f"/v1/folders/{folder_id}/agents",
|
|
183
|
+
page=AsyncArrayPage[AgentListResponse],
|
|
181
184
|
options=make_request_options(
|
|
182
185
|
extra_headers=extra_headers,
|
|
183
186
|
extra_query=extra_query,
|
|
184
187
|
extra_body=extra_body,
|
|
185
188
|
timeout=timeout,
|
|
186
|
-
query=
|
|
189
|
+
query=maybe_transform(
|
|
187
190
|
{
|
|
188
191
|
"after": after,
|
|
189
192
|
"before": before,
|
|
@@ -194,7 +197,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
194
197
|
agent_list_params.AgentListParams,
|
|
195
198
|
),
|
|
196
199
|
),
|
|
197
|
-
|
|
200
|
+
model=str,
|
|
198
201
|
)
|
|
199
202
|
|
|
200
203
|
|
|
@@ -17,7 +17,8 @@ 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 SyncArrayPage, AsyncArrayPage
|
|
21
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
21
22
|
from ...types.folders import file_list_params, file_upload_params
|
|
22
23
|
from ...types.folders.file_list_response import FileListResponse
|
|
23
24
|
from ...types.folders.file_upload_response import FileUploadResponse
|
|
@@ -61,7 +62,7 @@ class FilesResource(SyncAPIResource):
|
|
|
61
62
|
extra_query: Query | None = None,
|
|
62
63
|
extra_body: Body | None = None,
|
|
63
64
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
64
|
-
) -> FileListResponse:
|
|
65
|
+
) -> SyncArrayPage[FileListResponse]:
|
|
65
66
|
"""
|
|
66
67
|
List paginated files associated with a data folder.
|
|
67
68
|
|
|
@@ -93,8 +94,9 @@ class FilesResource(SyncAPIResource):
|
|
|
93
94
|
"""
|
|
94
95
|
if not folder_id:
|
|
95
96
|
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
96
|
-
return self.
|
|
97
|
+
return self._get_api_list(
|
|
97
98
|
f"/v1/folders/{folder_id}/files",
|
|
99
|
+
page=SyncArrayPage[FileListResponse],
|
|
98
100
|
options=make_request_options(
|
|
99
101
|
extra_headers=extra_headers,
|
|
100
102
|
extra_query=extra_query,
|
|
@@ -112,7 +114,7 @@ class FilesResource(SyncAPIResource):
|
|
|
112
114
|
file_list_params.FileListParams,
|
|
113
115
|
),
|
|
114
116
|
),
|
|
115
|
-
|
|
117
|
+
model=FileListResponse,
|
|
116
118
|
)
|
|
117
119
|
|
|
118
120
|
def delete(
|
|
@@ -237,7 +239,7 @@ class AsyncFilesResource(AsyncAPIResource):
|
|
|
237
239
|
"""
|
|
238
240
|
return AsyncFilesResourceWithStreamingResponse(self)
|
|
239
241
|
|
|
240
|
-
|
|
242
|
+
def list(
|
|
241
243
|
self,
|
|
242
244
|
folder_id: str,
|
|
243
245
|
*,
|
|
@@ -253,7 +255,7 @@ class AsyncFilesResource(AsyncAPIResource):
|
|
|
253
255
|
extra_query: Query | None = None,
|
|
254
256
|
extra_body: Body | None = None,
|
|
255
257
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
256
|
-
) -> FileListResponse:
|
|
258
|
+
) -> AsyncPaginator[FileListResponse, AsyncArrayPage[FileListResponse]]:
|
|
257
259
|
"""
|
|
258
260
|
List paginated files associated with a data folder.
|
|
259
261
|
|
|
@@ -285,14 +287,15 @@ class AsyncFilesResource(AsyncAPIResource):
|
|
|
285
287
|
"""
|
|
286
288
|
if not folder_id:
|
|
287
289
|
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
288
|
-
return
|
|
290
|
+
return self._get_api_list(
|
|
289
291
|
f"/v1/folders/{folder_id}/files",
|
|
292
|
+
page=AsyncArrayPage[FileListResponse],
|
|
290
293
|
options=make_request_options(
|
|
291
294
|
extra_headers=extra_headers,
|
|
292
295
|
extra_query=extra_query,
|
|
293
296
|
extra_body=extra_body,
|
|
294
297
|
timeout=timeout,
|
|
295
|
-
query=
|
|
298
|
+
query=maybe_transform(
|
|
296
299
|
{
|
|
297
300
|
"after": after,
|
|
298
301
|
"before": before,
|
|
@@ -304,7 +307,7 @@ class AsyncFilesResource(AsyncAPIResource):
|
|
|
304
307
|
file_list_params.FileListParams,
|
|
305
308
|
),
|
|
306
309
|
),
|
|
307
|
-
|
|
310
|
+
model=FileListResponse,
|
|
308
311
|
)
|
|
309
312
|
|
|
310
313
|
async def delete(
|
|
@@ -34,9 +34,9 @@ from ..._response import (
|
|
|
34
34
|
async_to_raw_response_wrapper,
|
|
35
35
|
async_to_streamed_response_wrapper,
|
|
36
36
|
)
|
|
37
|
-
from ...
|
|
37
|
+
from ...pagination import SyncArrayPage, AsyncArrayPage
|
|
38
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
38
39
|
from ...types.folder import Folder
|
|
39
|
-
from ...types.folder_list_response import FolderListResponse
|
|
40
40
|
from ...types.folder_count_response import FolderCountResponse
|
|
41
41
|
from ...types.embedding_config_param import EmbeddingConfigParam
|
|
42
42
|
|
|
@@ -244,7 +244,7 @@ class FoldersResource(SyncAPIResource):
|
|
|
244
244
|
extra_query: Query | None = None,
|
|
245
245
|
extra_body: Body | None = None,
|
|
246
246
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
247
|
-
) ->
|
|
247
|
+
) -> SyncArrayPage[Folder]:
|
|
248
248
|
"""
|
|
249
249
|
List all data folders created by a user.
|
|
250
250
|
|
|
@@ -272,8 +272,9 @@ class FoldersResource(SyncAPIResource):
|
|
|
272
272
|
|
|
273
273
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
274
274
|
"""
|
|
275
|
-
return self.
|
|
275
|
+
return self._get_api_list(
|
|
276
276
|
"/v1/folders/",
|
|
277
|
+
page=SyncArrayPage[Folder],
|
|
277
278
|
options=make_request_options(
|
|
278
279
|
extra_headers=extra_headers,
|
|
279
280
|
extra_query=extra_query,
|
|
@@ -291,7 +292,7 @@ class FoldersResource(SyncAPIResource):
|
|
|
291
292
|
folder_list_params.FolderListParams,
|
|
292
293
|
),
|
|
293
294
|
),
|
|
294
|
-
|
|
295
|
+
model=Folder,
|
|
295
296
|
)
|
|
296
297
|
|
|
297
298
|
def delete(
|
|
@@ -535,7 +536,7 @@ class AsyncFoldersResource(AsyncAPIResource):
|
|
|
535
536
|
cast_to=Folder,
|
|
536
537
|
)
|
|
537
538
|
|
|
538
|
-
|
|
539
|
+
def list(
|
|
539
540
|
self,
|
|
540
541
|
*,
|
|
541
542
|
after: Optional[str] | Omit = omit,
|
|
@@ -550,7 +551,7 @@ class AsyncFoldersResource(AsyncAPIResource):
|
|
|
550
551
|
extra_query: Query | None = None,
|
|
551
552
|
extra_body: Body | None = None,
|
|
552
553
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
553
|
-
) ->
|
|
554
|
+
) -> AsyncPaginator[Folder, AsyncArrayPage[Folder]]:
|
|
554
555
|
"""
|
|
555
556
|
List all data folders created by a user.
|
|
556
557
|
|
|
@@ -578,14 +579,15 @@ class AsyncFoldersResource(AsyncAPIResource):
|
|
|
578
579
|
|
|
579
580
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
580
581
|
"""
|
|
581
|
-
return
|
|
582
|
+
return self._get_api_list(
|
|
582
583
|
"/v1/folders/",
|
|
584
|
+
page=AsyncArrayPage[Folder],
|
|
583
585
|
options=make_request_options(
|
|
584
586
|
extra_headers=extra_headers,
|
|
585
587
|
extra_query=extra_query,
|
|
586
588
|
extra_body=extra_body,
|
|
587
589
|
timeout=timeout,
|
|
588
|
-
query=
|
|
590
|
+
query=maybe_transform(
|
|
589
591
|
{
|
|
590
592
|
"after": after,
|
|
591
593
|
"before": before,
|
|
@@ -597,7 +599,7 @@ class AsyncFoldersResource(AsyncAPIResource):
|
|
|
597
599
|
folder_list_params.FolderListParams,
|
|
598
600
|
),
|
|
599
601
|
),
|
|
600
|
-
|
|
602
|
+
model=Folder,
|
|
601
603
|
)
|
|
602
604
|
|
|
603
605
|
async def delete(
|
|
@@ -26,10 +26,10 @@ from ..._response import (
|
|
|
26
26
|
async_to_raw_response_wrapper,
|
|
27
27
|
async_to_streamed_response_wrapper,
|
|
28
28
|
)
|
|
29
|
+
from ...pagination import SyncArrayPage, AsyncArrayPage
|
|
29
30
|
from ...types.group import Group
|
|
30
|
-
from ..._base_client import make_request_options
|
|
31
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
31
32
|
from ...types.manager_type import ManagerType
|
|
32
|
-
from ...types.group_list_response import GroupListResponse
|
|
33
33
|
from ...types.group_count_response import GroupCountResponse
|
|
34
34
|
|
|
35
35
|
__all__ = ["GroupsResource", "AsyncGroupsResource"]
|
|
@@ -237,7 +237,7 @@ class GroupsResource(SyncAPIResource):
|
|
|
237
237
|
extra_query: Query | None = None,
|
|
238
238
|
extra_body: Body | None = None,
|
|
239
239
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
240
|
-
) ->
|
|
240
|
+
) -> SyncArrayPage[Group]:
|
|
241
241
|
"""
|
|
242
242
|
Fetch all multi-agent groups matching query.
|
|
243
243
|
|
|
@@ -267,8 +267,9 @@ class GroupsResource(SyncAPIResource):
|
|
|
267
267
|
|
|
268
268
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
269
269
|
"""
|
|
270
|
-
return self.
|
|
270
|
+
return self._get_api_list(
|
|
271
271
|
"/v1/groups/",
|
|
272
|
+
page=SyncArrayPage[Group],
|
|
272
273
|
options=make_request_options(
|
|
273
274
|
extra_headers=extra_headers,
|
|
274
275
|
extra_query=extra_query,
|
|
@@ -287,7 +288,7 @@ class GroupsResource(SyncAPIResource):
|
|
|
287
288
|
group_list_params.GroupListParams,
|
|
288
289
|
),
|
|
289
290
|
),
|
|
290
|
-
|
|
291
|
+
model=Group,
|
|
291
292
|
)
|
|
292
293
|
|
|
293
294
|
def delete(
|
|
@@ -531,7 +532,7 @@ class AsyncGroupsResource(AsyncAPIResource):
|
|
|
531
532
|
cast_to=Group,
|
|
532
533
|
)
|
|
533
534
|
|
|
534
|
-
|
|
535
|
+
def list(
|
|
535
536
|
self,
|
|
536
537
|
*,
|
|
537
538
|
after: Optional[str] | Omit = omit,
|
|
@@ -547,7 +548,7 @@ class AsyncGroupsResource(AsyncAPIResource):
|
|
|
547
548
|
extra_query: Query | None = None,
|
|
548
549
|
extra_body: Body | None = None,
|
|
549
550
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
550
|
-
) ->
|
|
551
|
+
) -> AsyncPaginator[Group, AsyncArrayPage[Group]]:
|
|
551
552
|
"""
|
|
552
553
|
Fetch all multi-agent groups matching query.
|
|
553
554
|
|
|
@@ -577,14 +578,15 @@ class AsyncGroupsResource(AsyncAPIResource):
|
|
|
577
578
|
|
|
578
579
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
579
580
|
"""
|
|
580
|
-
return
|
|
581
|
+
return self._get_api_list(
|
|
581
582
|
"/v1/groups/",
|
|
583
|
+
page=AsyncArrayPage[Group],
|
|
582
584
|
options=make_request_options(
|
|
583
585
|
extra_headers=extra_headers,
|
|
584
586
|
extra_query=extra_query,
|
|
585
587
|
extra_body=extra_body,
|
|
586
588
|
timeout=timeout,
|
|
587
|
-
query=
|
|
589
|
+
query=maybe_transform(
|
|
588
590
|
{
|
|
589
591
|
"after": after,
|
|
590
592
|
"before": before,
|
|
@@ -597,7 +599,7 @@ class AsyncGroupsResource(AsyncAPIResource):
|
|
|
597
599
|
group_list_params.GroupListParams,
|
|
598
600
|
),
|
|
599
601
|
),
|
|
600
|
-
|
|
602
|
+
model=Group,
|
|
601
603
|
)
|
|
602
604
|
|
|
603
605
|
async def delete(
|
|
@@ -17,11 +17,12 @@ 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 SyncArrayPage, AsyncArrayPage
|
|
21
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
21
22
|
from ...types.groups import message_list_params, message_send_params, message_stream_params, message_update_params
|
|
22
23
|
from ...types.agents.message_type import MessageType
|
|
23
24
|
from ...types.agents.letta_response import LettaResponse
|
|
24
|
-
from ...types.
|
|
25
|
+
from ...types.agents.letta_message_union import LettaMessageUnion
|
|
25
26
|
from ...types.groups.message_update_response import MessageUpdateResponse
|
|
26
27
|
from ...types.agents.letta_user_message_content_union_param import LettaUserMessageContentUnionParam
|
|
27
28
|
from ...types.agents.letta_assistant_message_content_union_param import LettaAssistantMessageContentUnionParam
|
|
@@ -253,7 +254,7 @@ class MessagesResource(SyncAPIResource):
|
|
|
253
254
|
extra_query: Query | None = None,
|
|
254
255
|
extra_body: Body | None = None,
|
|
255
256
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
256
|
-
) ->
|
|
257
|
+
) -> SyncArrayPage[LettaMessageUnion]:
|
|
257
258
|
"""
|
|
258
259
|
Retrieve message history for an agent.
|
|
259
260
|
|
|
@@ -289,8 +290,9 @@ class MessagesResource(SyncAPIResource):
|
|
|
289
290
|
"""
|
|
290
291
|
if not group_id:
|
|
291
292
|
raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}")
|
|
292
|
-
return self.
|
|
293
|
+
return self._get_api_list(
|
|
293
294
|
f"/v1/groups/{group_id}/messages",
|
|
295
|
+
page=SyncArrayPage[LettaMessageUnion],
|
|
294
296
|
options=make_request_options(
|
|
295
297
|
extra_headers=extra_headers,
|
|
296
298
|
extra_query=extra_query,
|
|
@@ -310,7 +312,7 @@ class MessagesResource(SyncAPIResource):
|
|
|
310
312
|
message_list_params.MessageListParams,
|
|
311
313
|
),
|
|
312
314
|
),
|
|
313
|
-
|
|
315
|
+
model=cast(Any, LettaMessageUnion), # Union types cannot be passed in as arguments in the type system
|
|
314
316
|
)
|
|
315
317
|
|
|
316
318
|
def reset(
|
|
@@ -722,7 +724,7 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
722
724
|
),
|
|
723
725
|
)
|
|
724
726
|
|
|
725
|
-
|
|
727
|
+
def list(
|
|
726
728
|
self,
|
|
727
729
|
group_id: str,
|
|
728
730
|
*,
|
|
@@ -740,7 +742,7 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
740
742
|
extra_query: Query | None = None,
|
|
741
743
|
extra_body: Body | None = None,
|
|
742
744
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
743
|
-
) ->
|
|
745
|
+
) -> AsyncPaginator[LettaMessageUnion, AsyncArrayPage[LettaMessageUnion]]:
|
|
744
746
|
"""
|
|
745
747
|
Retrieve message history for an agent.
|
|
746
748
|
|
|
@@ -776,14 +778,15 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
776
778
|
"""
|
|
777
779
|
if not group_id:
|
|
778
780
|
raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}")
|
|
779
|
-
return
|
|
781
|
+
return self._get_api_list(
|
|
780
782
|
f"/v1/groups/{group_id}/messages",
|
|
783
|
+
page=AsyncArrayPage[LettaMessageUnion],
|
|
781
784
|
options=make_request_options(
|
|
782
785
|
extra_headers=extra_headers,
|
|
783
786
|
extra_query=extra_query,
|
|
784
787
|
extra_body=extra_body,
|
|
785
788
|
timeout=timeout,
|
|
786
|
-
query=
|
|
789
|
+
query=maybe_transform(
|
|
787
790
|
{
|
|
788
791
|
"after": after,
|
|
789
792
|
"assistant_message_tool_kwarg": assistant_message_tool_kwarg,
|
|
@@ -797,7 +800,7 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
797
800
|
message_list_params.MessageListParams,
|
|
798
801
|
),
|
|
799
802
|
),
|
|
800
|
-
|
|
803
|
+
model=cast(Any, LettaMessageUnion), # Union types cannot be passed in as arguments in the type system
|
|
801
804
|
)
|
|
802
805
|
|
|
803
806
|
async def reset(
|