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
|
@@ -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
|
|
|
@@ -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 file_list_params, file_upload_params
|
|
23
22
|
from ...types.folders.file_list_response import FileListResponse
|
|
24
23
|
from ...types.folders.file_upload_response import FileUploadResponse
|
|
@@ -62,7 +61,7 @@ class FilesResource(SyncAPIResource):
|
|
|
62
61
|
extra_query: Query | None = None,
|
|
63
62
|
extra_body: Body | None = None,
|
|
64
63
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
65
|
-
) ->
|
|
64
|
+
) -> FileListResponse:
|
|
66
65
|
"""
|
|
67
66
|
List paginated files associated with a data folder.
|
|
68
67
|
|
|
@@ -94,9 +93,8 @@ class FilesResource(SyncAPIResource):
|
|
|
94
93
|
"""
|
|
95
94
|
if not folder_id:
|
|
96
95
|
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
97
|
-
return self.
|
|
96
|
+
return self._get(
|
|
98
97
|
f"/v1/folders/{folder_id}/files",
|
|
99
|
-
page=SyncArrayPage[FileListResponse],
|
|
100
98
|
options=make_request_options(
|
|
101
99
|
extra_headers=extra_headers,
|
|
102
100
|
extra_query=extra_query,
|
|
@@ -114,7 +112,7 @@ class FilesResource(SyncAPIResource):
|
|
|
114
112
|
file_list_params.FileListParams,
|
|
115
113
|
),
|
|
116
114
|
),
|
|
117
|
-
|
|
115
|
+
cast_to=FileListResponse,
|
|
118
116
|
)
|
|
119
117
|
|
|
120
118
|
def delete(
|
|
@@ -239,7 +237,7 @@ class AsyncFilesResource(AsyncAPIResource):
|
|
|
239
237
|
"""
|
|
240
238
|
return AsyncFilesResourceWithStreamingResponse(self)
|
|
241
239
|
|
|
242
|
-
def list(
|
|
240
|
+
async def list(
|
|
243
241
|
self,
|
|
244
242
|
folder_id: str,
|
|
245
243
|
*,
|
|
@@ -255,7 +253,7 @@ class AsyncFilesResource(AsyncAPIResource):
|
|
|
255
253
|
extra_query: Query | None = None,
|
|
256
254
|
extra_body: Body | None = None,
|
|
257
255
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
258
|
-
) ->
|
|
256
|
+
) -> FileListResponse:
|
|
259
257
|
"""
|
|
260
258
|
List paginated files associated with a data folder.
|
|
261
259
|
|
|
@@ -287,15 +285,14 @@ class AsyncFilesResource(AsyncAPIResource):
|
|
|
287
285
|
"""
|
|
288
286
|
if not folder_id:
|
|
289
287
|
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
290
|
-
return self.
|
|
288
|
+
return await self._get(
|
|
291
289
|
f"/v1/folders/{folder_id}/files",
|
|
292
|
-
page=AsyncArrayPage[FileListResponse],
|
|
293
290
|
options=make_request_options(
|
|
294
291
|
extra_headers=extra_headers,
|
|
295
292
|
extra_query=extra_query,
|
|
296
293
|
extra_body=extra_body,
|
|
297
294
|
timeout=timeout,
|
|
298
|
-
query=
|
|
295
|
+
query=await async_maybe_transform(
|
|
299
296
|
{
|
|
300
297
|
"after": after,
|
|
301
298
|
"before": before,
|
|
@@ -307,7 +304,7 @@ class AsyncFilesResource(AsyncAPIResource):
|
|
|
307
304
|
file_list_params.FileListParams,
|
|
308
305
|
),
|
|
309
306
|
),
|
|
310
|
-
|
|
307
|
+
cast_to=FileListResponse,
|
|
311
308
|
)
|
|
312
309
|
|
|
313
310
|
async def delete(
|
|
@@ -23,7 +23,7 @@ from .agents import (
|
|
|
23
23
|
AgentsResourceWithStreamingResponse,
|
|
24
24
|
AsyncAgentsResourceWithStreamingResponse,
|
|
25
25
|
)
|
|
26
|
-
from ...types import folder_list_params, folder_create_params,
|
|
26
|
+
from ...types import folder_list_params, folder_create_params, folder_modify_params
|
|
27
27
|
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
28
28
|
from ..._utils import maybe_transform, async_maybe_transform
|
|
29
29
|
from ..._compat import cached_property
|
|
@@ -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 ...
|
|
38
|
-
from ..._base_client import AsyncPaginator, make_request_options
|
|
37
|
+
from ..._base_client import make_request_options
|
|
39
38
|
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
|
|
|
@@ -169,66 +169,6 @@ class FoldersResource(SyncAPIResource):
|
|
|
169
169
|
cast_to=Folder,
|
|
170
170
|
)
|
|
171
171
|
|
|
172
|
-
def update(
|
|
173
|
-
self,
|
|
174
|
-
folder_id: str,
|
|
175
|
-
*,
|
|
176
|
-
description: Optional[str] | Omit = omit,
|
|
177
|
-
embedding_config: Optional[EmbeddingConfigParam] | Omit = omit,
|
|
178
|
-
instructions: Optional[str] | Omit = omit,
|
|
179
|
-
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
180
|
-
name: Optional[str] | Omit = omit,
|
|
181
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
182
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
183
|
-
extra_headers: Headers | None = None,
|
|
184
|
-
extra_query: Query | None = None,
|
|
185
|
-
extra_body: Body | None = None,
|
|
186
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
187
|
-
) -> Folder:
|
|
188
|
-
"""
|
|
189
|
-
Update the name or documentation of an existing data folder.
|
|
190
|
-
|
|
191
|
-
Args:
|
|
192
|
-
folder_id: The ID of the source in the format 'source-<uuid4>'
|
|
193
|
-
|
|
194
|
-
description: The description of the source.
|
|
195
|
-
|
|
196
|
-
embedding_config: Configuration for embedding model connection and processing parameters.
|
|
197
|
-
|
|
198
|
-
instructions: Instructions for how to use the source.
|
|
199
|
-
|
|
200
|
-
metadata: Metadata associated with the source.
|
|
201
|
-
|
|
202
|
-
name: The name of the source.
|
|
203
|
-
|
|
204
|
-
extra_headers: Send extra headers
|
|
205
|
-
|
|
206
|
-
extra_query: Add additional query parameters to the request
|
|
207
|
-
|
|
208
|
-
extra_body: Add additional JSON properties to the request
|
|
209
|
-
|
|
210
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
211
|
-
"""
|
|
212
|
-
if not folder_id:
|
|
213
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
214
|
-
return self._patch(
|
|
215
|
-
f"/v1/folders/{folder_id}",
|
|
216
|
-
body=maybe_transform(
|
|
217
|
-
{
|
|
218
|
-
"description": description,
|
|
219
|
-
"embedding_config": embedding_config,
|
|
220
|
-
"instructions": instructions,
|
|
221
|
-
"metadata": metadata,
|
|
222
|
-
"name": name,
|
|
223
|
-
},
|
|
224
|
-
folder_update_params.FolderUpdateParams,
|
|
225
|
-
),
|
|
226
|
-
options=make_request_options(
|
|
227
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
228
|
-
),
|
|
229
|
-
cast_to=Folder,
|
|
230
|
-
)
|
|
231
|
-
|
|
232
172
|
def list(
|
|
233
173
|
self,
|
|
234
174
|
*,
|
|
@@ -244,7 +184,7 @@ class FoldersResource(SyncAPIResource):
|
|
|
244
184
|
extra_query: Query | None = None,
|
|
245
185
|
extra_body: Body | None = None,
|
|
246
186
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
247
|
-
) ->
|
|
187
|
+
) -> FolderListResponse:
|
|
248
188
|
"""
|
|
249
189
|
List all data folders created by a user.
|
|
250
190
|
|
|
@@ -272,9 +212,8 @@ class FoldersResource(SyncAPIResource):
|
|
|
272
212
|
|
|
273
213
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
274
214
|
"""
|
|
275
|
-
return self.
|
|
215
|
+
return self._get(
|
|
276
216
|
"/v1/folders/",
|
|
277
|
-
page=SyncArrayPage[Folder],
|
|
278
217
|
options=make_request_options(
|
|
279
218
|
extra_headers=extra_headers,
|
|
280
219
|
extra_query=extra_query,
|
|
@@ -292,7 +231,7 @@ class FoldersResource(SyncAPIResource):
|
|
|
292
231
|
folder_list_params.FolderListParams,
|
|
293
232
|
),
|
|
294
233
|
),
|
|
295
|
-
|
|
234
|
+
cast_to=FolderListResponse,
|
|
296
235
|
)
|
|
297
236
|
|
|
298
237
|
def delete(
|
|
@@ -349,6 +288,66 @@ class FoldersResource(SyncAPIResource):
|
|
|
349
288
|
cast_to=int,
|
|
350
289
|
)
|
|
351
290
|
|
|
291
|
+
def modify(
|
|
292
|
+
self,
|
|
293
|
+
folder_id: str,
|
|
294
|
+
*,
|
|
295
|
+
description: Optional[str] | Omit = omit,
|
|
296
|
+
embedding_config: Optional[EmbeddingConfigParam] | Omit = omit,
|
|
297
|
+
instructions: Optional[str] | Omit = omit,
|
|
298
|
+
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
299
|
+
name: Optional[str] | Omit = omit,
|
|
300
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
301
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
302
|
+
extra_headers: Headers | None = None,
|
|
303
|
+
extra_query: Query | None = None,
|
|
304
|
+
extra_body: Body | None = None,
|
|
305
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
306
|
+
) -> Folder:
|
|
307
|
+
"""
|
|
308
|
+
Update the name or documentation of an existing data folder.
|
|
309
|
+
|
|
310
|
+
Args:
|
|
311
|
+
folder_id: The ID of the source in the format 'source-<uuid4>'
|
|
312
|
+
|
|
313
|
+
description: The description of the source.
|
|
314
|
+
|
|
315
|
+
embedding_config: Configuration for embedding model connection and processing parameters.
|
|
316
|
+
|
|
317
|
+
instructions: Instructions for how to use the source.
|
|
318
|
+
|
|
319
|
+
metadata: Metadata associated with the source.
|
|
320
|
+
|
|
321
|
+
name: The name of the source.
|
|
322
|
+
|
|
323
|
+
extra_headers: Send extra headers
|
|
324
|
+
|
|
325
|
+
extra_query: Add additional query parameters to the request
|
|
326
|
+
|
|
327
|
+
extra_body: Add additional JSON properties to the request
|
|
328
|
+
|
|
329
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
330
|
+
"""
|
|
331
|
+
if not folder_id:
|
|
332
|
+
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
333
|
+
return self._patch(
|
|
334
|
+
f"/v1/folders/{folder_id}",
|
|
335
|
+
body=maybe_transform(
|
|
336
|
+
{
|
|
337
|
+
"description": description,
|
|
338
|
+
"embedding_config": embedding_config,
|
|
339
|
+
"instructions": instructions,
|
|
340
|
+
"metadata": metadata,
|
|
341
|
+
"name": name,
|
|
342
|
+
},
|
|
343
|
+
folder_modify_params.FolderModifyParams,
|
|
344
|
+
),
|
|
345
|
+
options=make_request_options(
|
|
346
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
347
|
+
),
|
|
348
|
+
cast_to=Folder,
|
|
349
|
+
)
|
|
350
|
+
|
|
352
351
|
|
|
353
352
|
class AsyncFoldersResource(AsyncAPIResource):
|
|
354
353
|
@cached_property
|
|
@@ -476,67 +475,7 @@ class AsyncFoldersResource(AsyncAPIResource):
|
|
|
476
475
|
cast_to=Folder,
|
|
477
476
|
)
|
|
478
477
|
|
|
479
|
-
async def
|
|
480
|
-
self,
|
|
481
|
-
folder_id: str,
|
|
482
|
-
*,
|
|
483
|
-
description: Optional[str] | Omit = omit,
|
|
484
|
-
embedding_config: Optional[EmbeddingConfigParam] | Omit = omit,
|
|
485
|
-
instructions: Optional[str] | Omit = omit,
|
|
486
|
-
metadata: Optional[Dict[str, object]] | 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
|
-
) -> Folder:
|
|
495
|
-
"""
|
|
496
|
-
Update the name or documentation of an existing data folder.
|
|
497
|
-
|
|
498
|
-
Args:
|
|
499
|
-
folder_id: The ID of the source in the format 'source-<uuid4>'
|
|
500
|
-
|
|
501
|
-
description: The description of the source.
|
|
502
|
-
|
|
503
|
-
embedding_config: Configuration for embedding model connection and processing parameters.
|
|
504
|
-
|
|
505
|
-
instructions: Instructions for how to use the source.
|
|
506
|
-
|
|
507
|
-
metadata: Metadata associated with the source.
|
|
508
|
-
|
|
509
|
-
name: The name of the source.
|
|
510
|
-
|
|
511
|
-
extra_headers: Send extra headers
|
|
512
|
-
|
|
513
|
-
extra_query: Add additional query parameters to the request
|
|
514
|
-
|
|
515
|
-
extra_body: Add additional JSON properties to the request
|
|
516
|
-
|
|
517
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
518
|
-
"""
|
|
519
|
-
if not folder_id:
|
|
520
|
-
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
521
|
-
return await self._patch(
|
|
522
|
-
f"/v1/folders/{folder_id}",
|
|
523
|
-
body=await async_maybe_transform(
|
|
524
|
-
{
|
|
525
|
-
"description": description,
|
|
526
|
-
"embedding_config": embedding_config,
|
|
527
|
-
"instructions": instructions,
|
|
528
|
-
"metadata": metadata,
|
|
529
|
-
"name": name,
|
|
530
|
-
},
|
|
531
|
-
folder_update_params.FolderUpdateParams,
|
|
532
|
-
),
|
|
533
|
-
options=make_request_options(
|
|
534
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
535
|
-
),
|
|
536
|
-
cast_to=Folder,
|
|
537
|
-
)
|
|
538
|
-
|
|
539
|
-
def list(
|
|
478
|
+
async def list(
|
|
540
479
|
self,
|
|
541
480
|
*,
|
|
542
481
|
after: Optional[str] | Omit = omit,
|
|
@@ -551,7 +490,7 @@ class AsyncFoldersResource(AsyncAPIResource):
|
|
|
551
490
|
extra_query: Query | None = None,
|
|
552
491
|
extra_body: Body | None = None,
|
|
553
492
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
554
|
-
) ->
|
|
493
|
+
) -> FolderListResponse:
|
|
555
494
|
"""
|
|
556
495
|
List all data folders created by a user.
|
|
557
496
|
|
|
@@ -579,15 +518,14 @@ class AsyncFoldersResource(AsyncAPIResource):
|
|
|
579
518
|
|
|
580
519
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
581
520
|
"""
|
|
582
|
-
return self.
|
|
521
|
+
return await self._get(
|
|
583
522
|
"/v1/folders/",
|
|
584
|
-
page=AsyncArrayPage[Folder],
|
|
585
523
|
options=make_request_options(
|
|
586
524
|
extra_headers=extra_headers,
|
|
587
525
|
extra_query=extra_query,
|
|
588
526
|
extra_body=extra_body,
|
|
589
527
|
timeout=timeout,
|
|
590
|
-
query=
|
|
528
|
+
query=await async_maybe_transform(
|
|
591
529
|
{
|
|
592
530
|
"after": after,
|
|
593
531
|
"before": before,
|
|
@@ -599,7 +537,7 @@ class AsyncFoldersResource(AsyncAPIResource):
|
|
|
599
537
|
folder_list_params.FolderListParams,
|
|
600
538
|
),
|
|
601
539
|
),
|
|
602
|
-
|
|
540
|
+
cast_to=FolderListResponse,
|
|
603
541
|
)
|
|
604
542
|
|
|
605
543
|
async def delete(
|
|
@@ -656,6 +594,66 @@ class AsyncFoldersResource(AsyncAPIResource):
|
|
|
656
594
|
cast_to=int,
|
|
657
595
|
)
|
|
658
596
|
|
|
597
|
+
async def modify(
|
|
598
|
+
self,
|
|
599
|
+
folder_id: str,
|
|
600
|
+
*,
|
|
601
|
+
description: Optional[str] | Omit = omit,
|
|
602
|
+
embedding_config: Optional[EmbeddingConfigParam] | Omit = omit,
|
|
603
|
+
instructions: Optional[str] | Omit = omit,
|
|
604
|
+
metadata: Optional[Dict[str, object]] | Omit = omit,
|
|
605
|
+
name: Optional[str] | Omit = omit,
|
|
606
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
607
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
608
|
+
extra_headers: Headers | None = None,
|
|
609
|
+
extra_query: Query | None = None,
|
|
610
|
+
extra_body: Body | None = None,
|
|
611
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
612
|
+
) -> Folder:
|
|
613
|
+
"""
|
|
614
|
+
Update the name or documentation of an existing data folder.
|
|
615
|
+
|
|
616
|
+
Args:
|
|
617
|
+
folder_id: The ID of the source in the format 'source-<uuid4>'
|
|
618
|
+
|
|
619
|
+
description: The description of the source.
|
|
620
|
+
|
|
621
|
+
embedding_config: Configuration for embedding model connection and processing parameters.
|
|
622
|
+
|
|
623
|
+
instructions: Instructions for how to use the source.
|
|
624
|
+
|
|
625
|
+
metadata: Metadata associated with the source.
|
|
626
|
+
|
|
627
|
+
name: The name of the source.
|
|
628
|
+
|
|
629
|
+
extra_headers: Send extra headers
|
|
630
|
+
|
|
631
|
+
extra_query: Add additional query parameters to the request
|
|
632
|
+
|
|
633
|
+
extra_body: Add additional JSON properties to the request
|
|
634
|
+
|
|
635
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
636
|
+
"""
|
|
637
|
+
if not folder_id:
|
|
638
|
+
raise ValueError(f"Expected a non-empty value for `folder_id` but received {folder_id!r}")
|
|
639
|
+
return await self._patch(
|
|
640
|
+
f"/v1/folders/{folder_id}",
|
|
641
|
+
body=await async_maybe_transform(
|
|
642
|
+
{
|
|
643
|
+
"description": description,
|
|
644
|
+
"embedding_config": embedding_config,
|
|
645
|
+
"instructions": instructions,
|
|
646
|
+
"metadata": metadata,
|
|
647
|
+
"name": name,
|
|
648
|
+
},
|
|
649
|
+
folder_modify_params.FolderModifyParams,
|
|
650
|
+
),
|
|
651
|
+
options=make_request_options(
|
|
652
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
653
|
+
),
|
|
654
|
+
cast_to=Folder,
|
|
655
|
+
)
|
|
656
|
+
|
|
659
657
|
|
|
660
658
|
class FoldersResourceWithRawResponse:
|
|
661
659
|
def __init__(self, folders: FoldersResource) -> None:
|
|
@@ -667,9 +665,6 @@ class FoldersResourceWithRawResponse:
|
|
|
667
665
|
self.retrieve = to_raw_response_wrapper(
|
|
668
666
|
folders.retrieve,
|
|
669
667
|
)
|
|
670
|
-
self.update = to_raw_response_wrapper(
|
|
671
|
-
folders.update,
|
|
672
|
-
)
|
|
673
668
|
self.list = to_raw_response_wrapper(
|
|
674
669
|
folders.list,
|
|
675
670
|
)
|
|
@@ -679,6 +674,9 @@ class FoldersResourceWithRawResponse:
|
|
|
679
674
|
self.count = to_raw_response_wrapper(
|
|
680
675
|
folders.count,
|
|
681
676
|
)
|
|
677
|
+
self.modify = to_raw_response_wrapper(
|
|
678
|
+
folders.modify,
|
|
679
|
+
)
|
|
682
680
|
|
|
683
681
|
@cached_property
|
|
684
682
|
def files(self) -> FilesResourceWithRawResponse:
|
|
@@ -699,9 +697,6 @@ class AsyncFoldersResourceWithRawResponse:
|
|
|
699
697
|
self.retrieve = async_to_raw_response_wrapper(
|
|
700
698
|
folders.retrieve,
|
|
701
699
|
)
|
|
702
|
-
self.update = async_to_raw_response_wrapper(
|
|
703
|
-
folders.update,
|
|
704
|
-
)
|
|
705
700
|
self.list = async_to_raw_response_wrapper(
|
|
706
701
|
folders.list,
|
|
707
702
|
)
|
|
@@ -711,6 +706,9 @@ class AsyncFoldersResourceWithRawResponse:
|
|
|
711
706
|
self.count = async_to_raw_response_wrapper(
|
|
712
707
|
folders.count,
|
|
713
708
|
)
|
|
709
|
+
self.modify = async_to_raw_response_wrapper(
|
|
710
|
+
folders.modify,
|
|
711
|
+
)
|
|
714
712
|
|
|
715
713
|
@cached_property
|
|
716
714
|
def files(self) -> AsyncFilesResourceWithRawResponse:
|
|
@@ -731,9 +729,6 @@ class FoldersResourceWithStreamingResponse:
|
|
|
731
729
|
self.retrieve = to_streamed_response_wrapper(
|
|
732
730
|
folders.retrieve,
|
|
733
731
|
)
|
|
734
|
-
self.update = to_streamed_response_wrapper(
|
|
735
|
-
folders.update,
|
|
736
|
-
)
|
|
737
732
|
self.list = to_streamed_response_wrapper(
|
|
738
733
|
folders.list,
|
|
739
734
|
)
|
|
@@ -743,6 +738,9 @@ class FoldersResourceWithStreamingResponse:
|
|
|
743
738
|
self.count = to_streamed_response_wrapper(
|
|
744
739
|
folders.count,
|
|
745
740
|
)
|
|
741
|
+
self.modify = to_streamed_response_wrapper(
|
|
742
|
+
folders.modify,
|
|
743
|
+
)
|
|
746
744
|
|
|
747
745
|
@cached_property
|
|
748
746
|
def files(self) -> FilesResourceWithStreamingResponse:
|
|
@@ -763,9 +761,6 @@ class AsyncFoldersResourceWithStreamingResponse:
|
|
|
763
761
|
self.retrieve = async_to_streamed_response_wrapper(
|
|
764
762
|
folders.retrieve,
|
|
765
763
|
)
|
|
766
|
-
self.update = async_to_streamed_response_wrapper(
|
|
767
|
-
folders.update,
|
|
768
|
-
)
|
|
769
764
|
self.list = async_to_streamed_response_wrapper(
|
|
770
765
|
folders.list,
|
|
771
766
|
)
|
|
@@ -775,6 +770,9 @@ class AsyncFoldersResourceWithStreamingResponse:
|
|
|
775
770
|
self.count = async_to_streamed_response_wrapper(
|
|
776
771
|
folders.count,
|
|
777
772
|
)
|
|
773
|
+
self.modify = async_to_streamed_response_wrapper(
|
|
774
|
+
folders.modify,
|
|
775
|
+
)
|
|
778
776
|
|
|
779
777
|
@cached_property
|
|
780
778
|
def files(self) -> AsyncFilesResourceWithStreamingResponse:
|