letta-client 1.0.0a12__py3-none-any.whl → 1.0.0a14__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 +16 -2
- letta_client/_utils/_utils.py +1 -1
- letta_client/_version.py +1 -1
- letta_client/pagination.py +9 -9
- letta_client/resources/agents/files.py +13 -10
- letta_client/resources/groups/messages.py +8 -2
- letta_client/resources/runs/messages.py +8 -2
- letta_client/resources/templates/agents.py +2 -8
- letta_client/types/agents/file_list_response.py +3 -14
- letta_client/types/templates/agent_create_params.py +0 -2
- {letta_client-1.0.0a12.dist-info → letta_client-1.0.0a14.dist-info}/METADATA +1 -1
- {letta_client-1.0.0a12.dist-info → letta_client-1.0.0a14.dist-info}/RECORD +14 -14
- {letta_client-1.0.0a12.dist-info → letta_client-1.0.0a14.dist-info}/WHEEL +0 -0
- {letta_client-1.0.0a12.dist-info → letta_client-1.0.0a14.dist-info}/licenses/LICENSE +0 -0
letta_client/_client.py
CHANGED
|
@@ -91,6 +91,7 @@ class Letta(SyncAPIClient):
|
|
|
91
91
|
# client options
|
|
92
92
|
api_key: str
|
|
93
93
|
project_id: str | None
|
|
94
|
+
project: str | None
|
|
94
95
|
|
|
95
96
|
_environment: Literal["cloud", "local"] | NotGiven
|
|
96
97
|
|
|
@@ -99,6 +100,7 @@ class Letta(SyncAPIClient):
|
|
|
99
100
|
*,
|
|
100
101
|
api_key: str | None = None,
|
|
101
102
|
project_id: str | None = None,
|
|
103
|
+
project: str | None = None,
|
|
102
104
|
environment: Literal["cloud", "local"] | NotGiven = not_given,
|
|
103
105
|
base_url: str | httpx.URL | None | NotGiven = not_given,
|
|
104
106
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
@@ -133,6 +135,8 @@ class Letta(SyncAPIClient):
|
|
|
133
135
|
|
|
134
136
|
self.project_id = project_id
|
|
135
137
|
|
|
138
|
+
self.project = project
|
|
139
|
+
|
|
136
140
|
self._environment = environment
|
|
137
141
|
|
|
138
142
|
base_url_env = os.environ.get("LETTA_BASE_URL")
|
|
@@ -206,7 +210,8 @@ class Letta(SyncAPIClient):
|
|
|
206
210
|
return {
|
|
207
211
|
**super().default_headers,
|
|
208
212
|
"X-Stainless-Async": "false",
|
|
209
|
-
"X-Project": self.project_id if self.project_id is not None else Omit(),
|
|
213
|
+
"X-Project-Id": self.project_id if self.project_id is not None else Omit(),
|
|
214
|
+
"X-Project": self.project if self.project is not None else Omit(),
|
|
210
215
|
**self._custom_headers,
|
|
211
216
|
}
|
|
212
217
|
|
|
@@ -215,6 +220,7 @@ class Letta(SyncAPIClient):
|
|
|
215
220
|
*,
|
|
216
221
|
api_key: str | None = None,
|
|
217
222
|
project_id: str | None = None,
|
|
223
|
+
project: str | None = None,
|
|
218
224
|
environment: Literal["cloud", "local"] | None = None,
|
|
219
225
|
base_url: str | httpx.URL | None = None,
|
|
220
226
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
@@ -251,6 +257,7 @@ class Letta(SyncAPIClient):
|
|
|
251
257
|
return self.__class__(
|
|
252
258
|
api_key=api_key or self.api_key,
|
|
253
259
|
project_id=project_id or self.project_id,
|
|
260
|
+
project=project or self.project,
|
|
254
261
|
base_url=base_url or self.base_url,
|
|
255
262
|
environment=environment or self._environment,
|
|
256
263
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
|
@@ -339,6 +346,7 @@ class AsyncLetta(AsyncAPIClient):
|
|
|
339
346
|
# client options
|
|
340
347
|
api_key: str
|
|
341
348
|
project_id: str | None
|
|
349
|
+
project: str | None
|
|
342
350
|
|
|
343
351
|
_environment: Literal["cloud", "local"] | NotGiven
|
|
344
352
|
|
|
@@ -347,6 +355,7 @@ class AsyncLetta(AsyncAPIClient):
|
|
|
347
355
|
*,
|
|
348
356
|
api_key: str | None = None,
|
|
349
357
|
project_id: str | None = None,
|
|
358
|
+
project: str | None = None,
|
|
350
359
|
environment: Literal["cloud", "local"] | NotGiven = not_given,
|
|
351
360
|
base_url: str | httpx.URL | None | NotGiven = not_given,
|
|
352
361
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
@@ -381,6 +390,8 @@ class AsyncLetta(AsyncAPIClient):
|
|
|
381
390
|
|
|
382
391
|
self.project_id = project_id
|
|
383
392
|
|
|
393
|
+
self.project = project
|
|
394
|
+
|
|
384
395
|
self._environment = environment
|
|
385
396
|
|
|
386
397
|
base_url_env = os.environ.get("LETTA_BASE_URL")
|
|
@@ -454,7 +465,8 @@ class AsyncLetta(AsyncAPIClient):
|
|
|
454
465
|
return {
|
|
455
466
|
**super().default_headers,
|
|
456
467
|
"X-Stainless-Async": f"async:{get_async_library()}",
|
|
457
|
-
"X-Project": self.project_id if self.project_id is not None else Omit(),
|
|
468
|
+
"X-Project-Id": self.project_id if self.project_id is not None else Omit(),
|
|
469
|
+
"X-Project": self.project if self.project is not None else Omit(),
|
|
458
470
|
**self._custom_headers,
|
|
459
471
|
}
|
|
460
472
|
|
|
@@ -463,6 +475,7 @@ class AsyncLetta(AsyncAPIClient):
|
|
|
463
475
|
*,
|
|
464
476
|
api_key: str | None = None,
|
|
465
477
|
project_id: str | None = None,
|
|
478
|
+
project: str | None = None,
|
|
466
479
|
environment: Literal["cloud", "local"] | None = None,
|
|
467
480
|
base_url: str | httpx.URL | None = None,
|
|
468
481
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
@@ -499,6 +512,7 @@ class AsyncLetta(AsyncAPIClient):
|
|
|
499
512
|
return self.__class__(
|
|
500
513
|
api_key=api_key or self.api_key,
|
|
501
514
|
project_id=project_id or self.project_id,
|
|
515
|
+
project=project or self.project,
|
|
502
516
|
base_url=base_url or self.base_url,
|
|
503
517
|
environment=environment or self._environment,
|
|
504
518
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
letta_client/_utils/_utils.py
CHANGED
|
@@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
|
|
|
133
133
|
# Type safe methods for narrowing types with TypeVars.
|
|
134
134
|
# The default narrowing for isinstance(obj, dict) is dict[unknown, unknown],
|
|
135
135
|
# however this cause Pyright to rightfully report errors. As we know we don't
|
|
136
|
-
# care about the contained types we can safely use `object` in
|
|
136
|
+
# care about the contained types we can safely use `object` in its place.
|
|
137
137
|
#
|
|
138
138
|
# There are two separate functions defined, `is_*` and `is_*_t` for different use cases.
|
|
139
139
|
# `is_*` is for when you're dealing with an unknown input
|
letta_client/_version.py
CHANGED
letta_client/pagination.py
CHANGED
|
@@ -35,7 +35,7 @@ class ObjectPageItem(Protocol):
|
|
|
35
35
|
|
|
36
36
|
@runtime_checkable
|
|
37
37
|
class NextFilesPageItem(Protocol):
|
|
38
|
-
|
|
38
|
+
id: Optional[str]
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
class SyncArrayPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
|
|
@@ -222,18 +222,18 @@ class SyncNextFilesPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
|
|
|
222
222
|
|
|
223
223
|
if is_forwards:
|
|
224
224
|
item = cast(Any, files[-1])
|
|
225
|
-
if not isinstance(item, NextFilesPageItem) or item.
|
|
225
|
+
if not isinstance(item, NextFilesPageItem) or item.id is None:
|
|
226
226
|
# TODO emit warning log
|
|
227
227
|
return None
|
|
228
228
|
|
|
229
|
-
return PageInfo(params={"after": item.
|
|
229
|
+
return PageInfo(params={"after": item.id})
|
|
230
230
|
else:
|
|
231
231
|
item = cast(Any, self.files[0])
|
|
232
|
-
if not isinstance(item, NextFilesPageItem) or item.
|
|
232
|
+
if not isinstance(item, NextFilesPageItem) or item.id is None:
|
|
233
233
|
# TODO emit warning log
|
|
234
234
|
return None
|
|
235
235
|
|
|
236
|
-
return PageInfo(params={"before": item.
|
|
236
|
+
return PageInfo(params={"before": item.id})
|
|
237
237
|
|
|
238
238
|
|
|
239
239
|
class AsyncNextFilesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
|
|
@@ -266,15 +266,15 @@ class AsyncNextFilesPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
|
|
|
266
266
|
|
|
267
267
|
if is_forwards:
|
|
268
268
|
item = cast(Any, files[-1])
|
|
269
|
-
if not isinstance(item, NextFilesPageItem) or item.
|
|
269
|
+
if not isinstance(item, NextFilesPageItem) or item.id is None:
|
|
270
270
|
# TODO emit warning log
|
|
271
271
|
return None
|
|
272
272
|
|
|
273
|
-
return PageInfo(params={"after": item.
|
|
273
|
+
return PageInfo(params={"after": item.id})
|
|
274
274
|
else:
|
|
275
275
|
item = cast(Any, self.files[0])
|
|
276
|
-
if not isinstance(item, NextFilesPageItem) or item.
|
|
276
|
+
if not isinstance(item, NextFilesPageItem) or item.id is None:
|
|
277
277
|
# TODO emit warning log
|
|
278
278
|
return None
|
|
279
279
|
|
|
280
|
-
return PageInfo(params={"before": item.
|
|
280
|
+
return PageInfo(params={"before": item.id})
|
|
@@ -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 SyncNextFilesPage, AsyncNextFilesPage
|
|
21
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
21
22
|
from ...types.agents import file_list_params
|
|
22
23
|
from ...types.agents.file_list_response import FileListResponse
|
|
23
24
|
from ...types.agents.file_open_response import FileOpenResponse
|
|
@@ -63,7 +64,7 @@ class FilesResource(SyncAPIResource):
|
|
|
63
64
|
extra_query: Query | None = None,
|
|
64
65
|
extra_body: Body | None = None,
|
|
65
66
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
66
|
-
) -> FileListResponse:
|
|
67
|
+
) -> SyncNextFilesPage[FileListResponse]:
|
|
67
68
|
"""
|
|
68
69
|
Get the files attached to an agent with their open/closed status.
|
|
69
70
|
|
|
@@ -97,8 +98,9 @@ class FilesResource(SyncAPIResource):
|
|
|
97
98
|
"""
|
|
98
99
|
if not agent_id:
|
|
99
100
|
raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
|
|
100
|
-
return self.
|
|
101
|
+
return self._get_api_list(
|
|
101
102
|
f"/v1/agents/{agent_id}/files",
|
|
103
|
+
page=SyncNextFilesPage[FileListResponse],
|
|
102
104
|
options=make_request_options(
|
|
103
105
|
extra_headers=extra_headers,
|
|
104
106
|
extra_query=extra_query,
|
|
@@ -117,7 +119,7 @@ class FilesResource(SyncAPIResource):
|
|
|
117
119
|
file_list_params.FileListParams,
|
|
118
120
|
),
|
|
119
121
|
),
|
|
120
|
-
|
|
122
|
+
model=FileListResponse,
|
|
121
123
|
)
|
|
122
124
|
|
|
123
125
|
def close(
|
|
@@ -266,7 +268,7 @@ class AsyncFilesResource(AsyncAPIResource):
|
|
|
266
268
|
"""
|
|
267
269
|
return AsyncFilesResourceWithStreamingResponse(self)
|
|
268
270
|
|
|
269
|
-
|
|
271
|
+
def list(
|
|
270
272
|
self,
|
|
271
273
|
agent_id: str,
|
|
272
274
|
*,
|
|
@@ -283,7 +285,7 @@ class AsyncFilesResource(AsyncAPIResource):
|
|
|
283
285
|
extra_query: Query | None = None,
|
|
284
286
|
extra_body: Body | None = None,
|
|
285
287
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
286
|
-
) -> FileListResponse:
|
|
288
|
+
) -> AsyncPaginator[FileListResponse, AsyncNextFilesPage[FileListResponse]]:
|
|
287
289
|
"""
|
|
288
290
|
Get the files attached to an agent with their open/closed status.
|
|
289
291
|
|
|
@@ -317,14 +319,15 @@ class AsyncFilesResource(AsyncAPIResource):
|
|
|
317
319
|
"""
|
|
318
320
|
if not agent_id:
|
|
319
321
|
raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}")
|
|
320
|
-
return
|
|
322
|
+
return self._get_api_list(
|
|
321
323
|
f"/v1/agents/{agent_id}/files",
|
|
324
|
+
page=AsyncNextFilesPage[FileListResponse],
|
|
322
325
|
options=make_request_options(
|
|
323
326
|
extra_headers=extra_headers,
|
|
324
327
|
extra_query=extra_query,
|
|
325
328
|
extra_body=extra_body,
|
|
326
329
|
timeout=timeout,
|
|
327
|
-
query=
|
|
330
|
+
query=maybe_transform(
|
|
328
331
|
{
|
|
329
332
|
"after": after,
|
|
330
333
|
"before": before,
|
|
@@ -337,7 +340,7 @@ class AsyncFilesResource(AsyncAPIResource):
|
|
|
337
340
|
file_list_params.FileListParams,
|
|
338
341
|
),
|
|
339
342
|
),
|
|
340
|
-
|
|
343
|
+
model=FileListResponse,
|
|
341
344
|
)
|
|
342
345
|
|
|
343
346
|
async def close(
|
|
@@ -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.groups import message_list_params, message_send_params, message_modify_params, message_stream_params
|
|
@@ -24,6 +25,7 @@ from ...types.agents.message_type import MessageType
|
|
|
24
25
|
from ...types.agents.letta_response import LettaResponse
|
|
25
26
|
from ...types.agents.letta_message_union import LettaMessageUnion
|
|
26
27
|
from ...types.groups.message_modify_response import MessageModifyResponse
|
|
28
|
+
from ...types.agents.letta_streaming_response import LettaStreamingResponse
|
|
27
29
|
from ...types.agents.letta_user_message_content_union_param import LettaUserMessageContentUnionParam
|
|
28
30
|
from ...types.agents.letta_assistant_message_content_union_param import LettaAssistantMessageContentUnionParam
|
|
29
31
|
|
|
@@ -446,7 +448,7 @@ class MessagesResource(SyncAPIResource):
|
|
|
446
448
|
extra_query: Query | None = None,
|
|
447
449
|
extra_body: Body | None = None,
|
|
448
450
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
449
|
-
) ->
|
|
451
|
+
) -> Stream[LettaStreamingResponse]:
|
|
450
452
|
"""Process a user message and return the group's responses.
|
|
451
453
|
|
|
452
454
|
This endpoint accepts a
|
|
@@ -515,6 +517,8 @@ class MessagesResource(SyncAPIResource):
|
|
|
515
517
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
516
518
|
),
|
|
517
519
|
cast_to=object,
|
|
520
|
+
stream=True,
|
|
521
|
+
stream_cls=Stream[LettaStreamingResponse],
|
|
518
522
|
)
|
|
519
523
|
|
|
520
524
|
|
|
@@ -934,7 +938,7 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
934
938
|
extra_query: Query | None = None,
|
|
935
939
|
extra_body: Body | None = None,
|
|
936
940
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
937
|
-
) ->
|
|
941
|
+
) -> AsyncStream[LettaStreamingResponse]:
|
|
938
942
|
"""Process a user message and return the group's responses.
|
|
939
943
|
|
|
940
944
|
This endpoint accepts a
|
|
@@ -1003,6 +1007,8 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
1003
1007
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1004
1008
|
),
|
|
1005
1009
|
cast_to=object,
|
|
1010
|
+
stream=True,
|
|
1011
|
+
stream_cls=AsyncStream[LettaStreamingResponse],
|
|
1006
1012
|
)
|
|
1007
1013
|
|
|
1008
1014
|
|
|
@@ -17,10 +17,12 @@ 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 ...types.runs import message_list_params, message_stream_params
|
|
22
23
|
from ..._base_client import AsyncPaginator, make_request_options
|
|
23
24
|
from ...types.agents.letta_message_union import LettaMessageUnion
|
|
25
|
+
from ...types.agents.letta_streaming_response import LettaStreamingResponse
|
|
24
26
|
|
|
25
27
|
__all__ = ["MessagesResource", "AsyncMessagesResource"]
|
|
26
28
|
|
|
@@ -124,7 +126,7 @@ class MessagesResource(SyncAPIResource):
|
|
|
124
126
|
extra_query: Query | None = None,
|
|
125
127
|
extra_body: Body | None = None,
|
|
126
128
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
127
|
-
) ->
|
|
129
|
+
) -> Stream[LettaStreamingResponse]:
|
|
128
130
|
"""
|
|
129
131
|
Retrieve Stream
|
|
130
132
|
|
|
@@ -164,6 +166,8 @@ class MessagesResource(SyncAPIResource):
|
|
|
164
166
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
165
167
|
),
|
|
166
168
|
cast_to=object,
|
|
169
|
+
stream=True,
|
|
170
|
+
stream_cls=Stream[LettaStreamingResponse],
|
|
167
171
|
)
|
|
168
172
|
|
|
169
173
|
|
|
@@ -266,7 +270,7 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
266
270
|
extra_query: Query | None = None,
|
|
267
271
|
extra_body: Body | None = None,
|
|
268
272
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
269
|
-
) ->
|
|
273
|
+
) -> AsyncStream[LettaStreamingResponse]:
|
|
270
274
|
"""
|
|
271
275
|
Retrieve Stream
|
|
272
276
|
|
|
@@ -306,6 +310,8 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
306
310
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
307
311
|
),
|
|
308
312
|
cast_to=object,
|
|
313
|
+
stream=True,
|
|
314
|
+
stream_cls=AsyncStream[LettaStreamingResponse],
|
|
309
315
|
)
|
|
310
316
|
|
|
311
317
|
|
|
@@ -46,7 +46,6 @@ class AgentsResource(SyncAPIResource):
|
|
|
46
46
|
self,
|
|
47
47
|
template_version: str,
|
|
48
48
|
*,
|
|
49
|
-
project_id: str,
|
|
50
49
|
agent_name: str | Omit = omit,
|
|
51
50
|
identity_ids: SequenceNotStr[str] | Omit = omit,
|
|
52
51
|
initial_message_sequence: Iterable[agent_create_params.InitialMessageSequence] | Omit = omit,
|
|
@@ -86,13 +85,11 @@ class AgentsResource(SyncAPIResource):
|
|
|
86
85
|
|
|
87
86
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
88
87
|
"""
|
|
89
|
-
if not project_id:
|
|
90
|
-
raise ValueError(f"Expected a non-empty value for `project_id` but received {project_id!r}")
|
|
91
88
|
if not template_version:
|
|
92
89
|
raise ValueError(f"Expected a non-empty value for `template_version` but received {template_version!r}")
|
|
93
90
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
94
91
|
return self._post(
|
|
95
|
-
f"/v1/templates/{
|
|
92
|
+
f"/v1/templates/{template_version}/agents",
|
|
96
93
|
body=maybe_transform(
|
|
97
94
|
{
|
|
98
95
|
"agent_name": agent_name,
|
|
@@ -135,7 +132,6 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
135
132
|
self,
|
|
136
133
|
template_version: str,
|
|
137
134
|
*,
|
|
138
|
-
project_id: str,
|
|
139
135
|
agent_name: str | Omit = omit,
|
|
140
136
|
identity_ids: SequenceNotStr[str] | Omit = omit,
|
|
141
137
|
initial_message_sequence: Iterable[agent_create_params.InitialMessageSequence] | Omit = omit,
|
|
@@ -175,13 +171,11 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
|
175
171
|
|
|
176
172
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
177
173
|
"""
|
|
178
|
-
if not project_id:
|
|
179
|
-
raise ValueError(f"Expected a non-empty value for `project_id` but received {project_id!r}")
|
|
180
174
|
if not template_version:
|
|
181
175
|
raise ValueError(f"Expected a non-empty value for `template_version` but received {template_version!r}")
|
|
182
176
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
183
177
|
return await self._post(
|
|
184
|
-
f"/v1/templates/{
|
|
178
|
+
f"/v1/templates/{template_version}/agents",
|
|
185
179
|
body=await async_maybe_transform(
|
|
186
180
|
{
|
|
187
181
|
"agent_name": agent_name,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
from typing import
|
|
3
|
+
from typing import Optional
|
|
4
4
|
from datetime import datetime
|
|
5
5
|
|
|
6
6
|
from ..._models import BaseModel
|
|
7
7
|
|
|
8
|
-
__all__ = ["FileListResponse"
|
|
8
|
+
__all__ = ["FileListResponse"]
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
11
|
+
class FileListResponse(BaseModel):
|
|
12
12
|
id: str
|
|
13
13
|
"""Unique identifier of the file-agent relationship"""
|
|
14
14
|
|
|
@@ -38,14 +38,3 @@ class File(BaseModel):
|
|
|
38
38
|
|
|
39
39
|
visible_content: Optional[str] = None
|
|
40
40
|
"""Portion of the file visible to the agent if open"""
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class FileListResponse(BaseModel):
|
|
44
|
-
files: List[File]
|
|
45
|
-
"""List of file attachments for the agent"""
|
|
46
|
-
|
|
47
|
-
has_more: bool
|
|
48
|
-
"""Whether more results exist after this page"""
|
|
49
|
-
|
|
50
|
-
next_cursor: Optional[str] = None
|
|
51
|
-
"""Cursor for fetching the next page (file-agent relationship ID)"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: letta-client
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.0a14
|
|
4
4
|
Summary: The official Python library for the letta API
|
|
5
5
|
Project-URL: Homepage, https://github.com/letta-ai/letta-python
|
|
6
6
|
Project-URL: Repository, https://github.com/letta-ai/letta-python
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
letta_client/__init__.py,sha256=qGnQpgLF2IeCkTBNc7P5VwhcqjKS_Gs90jsb2et5a-w,2715
|
|
2
2
|
letta_client/_base_client.py,sha256=baHmwqnnDXr5ZRC9OXhVBA8LT3B8nD_vlRHwlWkDz0k,67053
|
|
3
|
-
letta_client/_client.py,sha256=
|
|
3
|
+
letta_client/_client.py,sha256=29NDt9eDHOctZFoFYa9Qhnw1L5z51yiEALWPebpv9g8,28135
|
|
4
4
|
letta_client/_compat.py,sha256=DQBVORjFb33zch24jzkhM14msvnzY7mmSmgDLaVFUM8,6562
|
|
5
5
|
letta_client/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
|
|
6
6
|
letta_client/_exceptions.py,sha256=30Z6OdknKex-stJOwtC_5naV8ozjHcX7-IIAqvKB0xY,3218
|
|
@@ -11,8 +11,8 @@ letta_client/_resource.py,sha256=usdu71d9SVBhsKu3-JpcwE4ZYyIZJTEIFhNNUR2i-qI,109
|
|
|
11
11
|
letta_client/_response.py,sha256=BKfNWi9r9l3FTwBirPt64_mnVss9gK8OYZkHb0MLL1A,28840
|
|
12
12
|
letta_client/_streaming.py,sha256=IhQrxmf7HMjkKLynITPcJBzqg30SI5e2O35zFOP1AMk,11283
|
|
13
13
|
letta_client/_types.py,sha256=dz_siM5FFPTKJs3m9q2ocNjY26xAZ98zPp7sQlsSm0U,7242
|
|
14
|
-
letta_client/_version.py,sha256=
|
|
15
|
-
letta_client/pagination.py,sha256=
|
|
14
|
+
letta_client/_version.py,sha256=c882ivQ0EsWk_xj54UZzKA0Mg7cBedgU_Px8Ht69g60,173
|
|
15
|
+
letta_client/pagination.py,sha256=UGlH6YPy6FPl7N1IEk33HkVB-2l0YvR74SFO_kyyogo,7886
|
|
16
16
|
letta_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
letta_client/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
|
|
18
18
|
letta_client/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
|
|
@@ -25,7 +25,7 @@ letta_client/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noM
|
|
|
25
25
|
letta_client/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
|
|
26
26
|
letta_client/_utils/_transform.py,sha256=NjCzmnfqYrsAikUHQig6N9QfuTVbKipuP3ur9mcNF-E,15951
|
|
27
27
|
letta_client/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,4786
|
|
28
|
-
letta_client/_utils/_utils.py,sha256=
|
|
28
|
+
letta_client/_utils/_utils.py,sha256=ugfUaneOK7I8h9b3656flwf5u_kthY0gvNuqvgOLoSU,12252
|
|
29
29
|
letta_client/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
|
30
30
|
letta_client/resources/__init__.py,sha256=5f9u41Tj5QuVrmX5lhI5zDt6FG_Qxzm4gIRnw4cidfU,6520
|
|
31
31
|
letta_client/resources/archives.py,sha256=_YWmXSr_GkmGCDjfGU_EdSIFB9e0qC_BeCg0EF2YM70,22484
|
|
@@ -34,7 +34,7 @@ letta_client/resources/tools.py,sha256=LxGMgcPoACs-rtaEfKs_RNSluLPA0kjoMX2oBZvSd
|
|
|
34
34
|
letta_client/resources/agents/__init__.py,sha256=kMBB1oA9e0oxT91T6Ck4AT-BKIBFQPKTENALxMNHN3g,3265
|
|
35
35
|
letta_client/resources/agents/agents.py,sha256=UolbAMRbQ5VFvWhus5tvnVceGQ08YZBROK8x2l0-NpM,81800
|
|
36
36
|
letta_client/resources/agents/blocks.py,sha256=NUFcRR5A4yGwplmy_ldSTP_rNkKHuTjs88xOL3n2zqk,27944
|
|
37
|
-
letta_client/resources/agents/files.py,sha256=
|
|
37
|
+
letta_client/resources/agents/files.py,sha256=zUFsoI7d0OlFKJ3QhdJ2HwkGUfVnQ8U3DuzNvOgQ2R4,20905
|
|
38
38
|
letta_client/resources/agents/folders.py,sha256=dkHlFE_oZ3dcXXhmOkqBzglrpLUSEeyXGH00qIcM0pA,15727
|
|
39
39
|
letta_client/resources/agents/groups.py,sha256=Mre1J9LdVE78mW2R-xxtd66FY8_aFK-rRMglE7zP0Hg,8865
|
|
40
40
|
letta_client/resources/agents/messages.py,sha256=0Z72_G0b7HVo0VHUE46SF19ZIcOmnjB1rc3z0m9AaaU,62684
|
|
@@ -51,7 +51,7 @@ letta_client/resources/folders/files.py,sha256=nNtsVaok4mIxkNWuW-coZipFQGLGemkuV
|
|
|
51
51
|
letta_client/resources/folders/folders.py,sha256=9WGYvy0b-3EwLLh87K5XoW2eqvPUZ35R8XrYNJ9svxQ,29045
|
|
52
52
|
letta_client/resources/groups/__init__.py,sha256=XRg7EgECFtIm8h8RjGcNEJyiZpw6XJqoG0aJwGsUADw,1028
|
|
53
53
|
letta_client/resources/groups/groups.py,sha256=ieqdZUSFtm7-svHEMFQ85tt4VSGJt45lyVGgSTRf8Sw,27542
|
|
54
|
-
letta_client/resources/groups/messages.py,sha256=
|
|
54
|
+
letta_client/resources/groups/messages.py,sha256=Gb9ZbK2ftCGVgEFAgJJBMb9rUON0fBO4I_ICcHllxIA,45765
|
|
55
55
|
letta_client/resources/identities/__init__.py,sha256=DaxkyrCra0xPWgEyZVRgVapuasUybvZokYssYq_QnyM,2006
|
|
56
56
|
letta_client/resources/identities/agents.py,sha256=KeejDcc4xDrqCQMV79QvK1VDRTCSIS4GqvgQUCFQRIc,9709
|
|
57
57
|
letta_client/resources/identities/blocks.py,sha256=JnvtUXjXQe_SyWlLqljAAc8tZ68rLj-3Hof4ccca2YA,8720
|
|
@@ -65,7 +65,7 @@ letta_client/resources/models/__init__.py,sha256=Tvswac6gTvPG6C45MOrEYYjWY6dEdWa
|
|
|
65
65
|
letta_client/resources/models/embeddings.py,sha256=1y7h-pd_LW7Dyf9q_7CV1MF6KVfSRHCfLlPuaM5B-KE,5238
|
|
66
66
|
letta_client/resources/models/models.py,sha256=hL_X-WVFOIzxpbnfgeAU-yPTSOn0mj5YTaiqKKcVIL4,8217
|
|
67
67
|
letta_client/resources/runs/__init__.py,sha256=Oz3VS4QWQ-W1ZkMdw1EuuH33QdUIgyxFhtAROdmI7RQ,1876
|
|
68
|
-
letta_client/resources/runs/messages.py,sha256=
|
|
68
|
+
letta_client/resources/runs/messages.py,sha256=UqdiizM0A4OGq6oIZObQT3K5H6SjJ9E53WqnJoesb9Y,14005
|
|
69
69
|
letta_client/resources/runs/runs.py,sha256=x79KGrUTCePKG1XYhn4fQgDrZRyqgyfdiOSLSzplceA,16614
|
|
70
70
|
letta_client/resources/runs/steps.py,sha256=hR33PtnoHUFrxLSj8-Rb3kAMRebyzlYjaSxqn8vyEXc,7981
|
|
71
71
|
letta_client/resources/runs/usage.py,sha256=rsarShRjn8sylRDfsO2BcM25dk2xGr0Njal9CKbeDgs,5824
|
|
@@ -76,7 +76,7 @@ letta_client/resources/steps/metrics.py,sha256=_oFTnx8VS1-H4TkBaqWcxuxjjO_SuAdsh
|
|
|
76
76
|
letta_client/resources/steps/steps.py,sha256=6rNNRNgp0bQYie-FUfQ9hs82tCL_tcj7aHW7p2K9yMk,18204
|
|
77
77
|
letta_client/resources/steps/trace.py,sha256=Q11XSAoMKkEnePvm4eIUZ-UZeMu6QxmQedgH4TI8swQ,5951
|
|
78
78
|
letta_client/resources/templates/__init__.py,sha256=4wWq5EBTkiBFzEIzLMP5rkzQ94peMZkl1roLp8iPK_g,1041
|
|
79
|
-
letta_client/resources/templates/agents.py,sha256=
|
|
79
|
+
letta_client/resources/templates/agents.py,sha256=kgn3rXy7JzP1mAD_Ea6z7NdL0wmVAPvLRfpMjqGENDs,9011
|
|
80
80
|
letta_client/resources/templates/templates.py,sha256=ATGrBCFSA06XpjR5rbWtXAT4vq66DwnDia5_XcM8z7Q,3695
|
|
81
81
|
letta_client/types/__init__.py,sha256=17n1efIhPXCKUWjmO0PnQM3dTvEzaj_5m1ku9Shhrok,8923
|
|
82
82
|
letta_client/types/agent_count_response.py,sha256=SdUd1SYP0pwONLc_7_bESZm1mwsgrNP93JiWq47bKdo,198
|
|
@@ -208,7 +208,7 @@ letta_client/types/agents/block_list_params.py,sha256=Z8EahHM0Q4qrEjxiLdmwOJT4Zj
|
|
|
208
208
|
letta_client/types/agents/block_modify_params.py,sha256=nowldbVlbanKYdA87Pk70OnZB9R15vG6WPx4dXx3DV8,1560
|
|
209
209
|
letta_client/types/agents/file_close_all_response.py,sha256=yq3AN8M749mivM6T7WS6iNKCrBRANafXXHsB3NuQRsc,232
|
|
210
210
|
letta_client/types/agents/file_list_params.py,sha256=ltjR-n7z_ZiOCO_nNPmSyH7DQUxdUB_jEuSXnnLWMmE,1067
|
|
211
|
-
letta_client/types/agents/file_list_response.py,sha256=
|
|
211
|
+
letta_client/types/agents/file_list_response.py,sha256=SILYgNMYWxdWsY6Nn1oxec5b12B2Eu6-yDTVB9RFRN0,1041
|
|
212
212
|
letta_client/types/agents/file_open_response.py,sha256=QnOUmArtPRRFAlSqfCzcQX_Mj9J7_YfSSCdjOdA7dhk,224
|
|
213
213
|
letta_client/types/agents/folder_list_params.py,sha256=ch6sBSUu88lyAm7RWAaHjVKOJ5gmH4sJh_d6q6RZ46E,871
|
|
214
214
|
letta_client/types/agents/folder_list_response.py,sha256=-99lBKZTBV1K5nTuKSUbLbWfM890oabNxBjOgvl86Hk,1496
|
|
@@ -305,8 +305,8 @@ letta_client/types/steps/message_list_params.py,sha256=YOM_88-fm54HosPI3lITS4ejB
|
|
|
305
305
|
letta_client/types/steps/message_list_response.py,sha256=KOOB_tmBTiMjXRPtuZocvn_tUH_61lLw3HKGMHFm4TA,1116
|
|
306
306
|
letta_client/types/steps/metric_retrieve_response.py,sha256=2rqlYkeGpwu4JYBPg9PszUKbT63x4AEDfo8wAJSdoew,1385
|
|
307
307
|
letta_client/types/templates/__init__.py,sha256=eRs8IaeLPk-OtK1SeqFlKxHQ1_thE0sgK2BZ2ioSyUw,195
|
|
308
|
-
letta_client/types/templates/agent_create_params.py,sha256=
|
|
309
|
-
letta_client-1.0.
|
|
310
|
-
letta_client-1.0.
|
|
311
|
-
letta_client-1.0.
|
|
312
|
-
letta_client-1.0.
|
|
308
|
+
letta_client/types/templates/agent_create_params.py,sha256=Rie9Auiaf1gLw4EpXkko_BFAIqKhqGJRbfMJa2yoIaM,1375
|
|
309
|
+
letta_client-1.0.0a14.dist-info/METADATA,sha256=jKR3Gtywdo6BA6QDjVsPB96fre760ichCFh1NuDApK0,15982
|
|
310
|
+
letta_client-1.0.0a14.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
311
|
+
letta_client-1.0.0a14.dist-info/licenses/LICENSE,sha256=BzGFjaxYQ82_SHPlYaZdGvoP71_alR_yRWyWASLnPe0,11335
|
|
312
|
+
letta_client-1.0.0a14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|