letta-client 0.1.19__py3-none-any.whl → 0.1.21__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.
- letta_client/__init__.py +10 -0
- letta_client/agents/__init__.py +2 -1
- letta_client/agents/archival_memory/client.py +218 -25
- letta_client/agents/client.py +350 -1637
- letta_client/agents/core_memory/client.py +424 -97
- letta_client/agents/memory_variables/client.py +2 -2
- letta_client/agents/messages/__init__.py +2 -2
- letta_client/agents/messages/client.py +19 -14
- letta_client/agents/messages/types/__init__.py +2 -1
- letta_client/agents/messages/types/message_update_content.py +6 -0
- letta_client/blocks/client.py +127 -0
- letta_client/core/client_wrapper.py +1 -1
- letta_client/providers/client.py +6 -6
- letta_client/runs/client.py +30 -18
- letta_client/sources/files/client.py +6 -6
- letta_client/tag/client.py +6 -6
- letta_client/tools/client.py +6 -6
- letta_client/types/__init__.py +10 -0
- letta_client/types/assistant_message.py +2 -1
- letta_client/types/assistant_message_content.py +6 -0
- letta_client/types/llm_config.py +6 -0
- letta_client/types/message.py +3 -2
- letta_client/types/message_create.py +3 -2
- letta_client/types/message_create_content.py +6 -0
- letta_client/types/system_message.py +3 -2
- letta_client/types/system_message_content.py +6 -0
- letta_client/types/text_content.py +23 -0
- letta_client/types/user_message.py +3 -2
- letta_client/types/user_message_content.py +6 -0
- {letta_client-0.1.19.dist-info → letta_client-0.1.21.dist-info}/METADATA +2 -2
- {letta_client-0.1.19.dist-info → letta_client-0.1.21.dist-info}/RECORD +32 -26
- {letta_client-0.1.19.dist-info → letta_client-0.1.21.dist-info}/WHEEL +0 -0
|
@@ -48,7 +48,7 @@ class MemoryVariablesClient:
|
|
|
48
48
|
)
|
|
49
49
|
"""
|
|
50
50
|
_response = self._client_wrapper.httpx_client.request(
|
|
51
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/
|
|
51
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/core-memory/variables",
|
|
52
52
|
method="GET",
|
|
53
53
|
request_options=request_options,
|
|
54
54
|
)
|
|
@@ -121,7 +121,7 @@ class AsyncMemoryVariablesClient:
|
|
|
121
121
|
asyncio.run(main())
|
|
122
122
|
"""
|
|
123
123
|
_response = await self._client_wrapper.httpx_client.request(
|
|
124
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/
|
|
124
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/core-memory/variables",
|
|
125
125
|
method="GET",
|
|
126
126
|
request_options=request_options,
|
|
127
127
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from .types import LettaStreamingResponse, MessagesListResponse
|
|
3
|
+
from .types import LettaStreamingResponse, MessageUpdateContent, MessagesListResponse
|
|
4
4
|
|
|
5
|
-
__all__ = ["LettaStreamingResponse", "MessagesListResponse"]
|
|
5
|
+
__all__ = ["LettaStreamingResponse", "MessageUpdateContent", "MessagesListResponse"]
|
|
@@ -15,6 +15,7 @@ from ...types.letta_request_config import LettaRequestConfig
|
|
|
15
15
|
from ...types.letta_response import LettaResponse
|
|
16
16
|
from ...core.serialization import convert_and_respect_annotation_metadata
|
|
17
17
|
from ...types.message_role import MessageRole
|
|
18
|
+
from .types.message_update_content import MessageUpdateContent
|
|
18
19
|
from ...types.chat_completion_message_tool_call import ChatCompletionMessageToolCall
|
|
19
20
|
from ...types.message import Message
|
|
20
21
|
from .types.letta_streaming_response import LettaStreamingResponse
|
|
@@ -161,7 +162,7 @@ class MessagesClient:
|
|
|
161
162
|
messages=[
|
|
162
163
|
MessageCreate(
|
|
163
164
|
role="user",
|
|
164
|
-
|
|
165
|
+
content="content",
|
|
165
166
|
)
|
|
166
167
|
],
|
|
167
168
|
)
|
|
@@ -210,7 +211,7 @@ class MessagesClient:
|
|
|
210
211
|
message_id: str,
|
|
211
212
|
*,
|
|
212
213
|
role: typing.Optional[MessageRole] = OMIT,
|
|
213
|
-
|
|
214
|
+
content: typing.Optional[MessageUpdateContent] = OMIT,
|
|
214
215
|
name: typing.Optional[str] = OMIT,
|
|
215
216
|
tool_calls: typing.Optional[typing.Sequence[ChatCompletionMessageToolCall]] = OMIT,
|
|
216
217
|
tool_call_id: typing.Optional[str] = OMIT,
|
|
@@ -228,8 +229,8 @@ class MessagesClient:
|
|
|
228
229
|
role : typing.Optional[MessageRole]
|
|
229
230
|
The role of the participant.
|
|
230
231
|
|
|
231
|
-
|
|
232
|
-
The
|
|
232
|
+
content : typing.Optional[MessageUpdateContent]
|
|
233
|
+
The content of the message.
|
|
233
234
|
|
|
234
235
|
name : typing.Optional[str]
|
|
235
236
|
The name of the participant.
|
|
@@ -265,7 +266,9 @@ class MessagesClient:
|
|
|
265
266
|
method="PATCH",
|
|
266
267
|
json={
|
|
267
268
|
"role": role,
|
|
268
|
-
"
|
|
269
|
+
"content": convert_and_respect_annotation_metadata(
|
|
270
|
+
object_=content, annotation=MessageUpdateContent, direction="write"
|
|
271
|
+
),
|
|
269
272
|
"name": name,
|
|
270
273
|
"tool_calls": convert_and_respect_annotation_metadata(
|
|
271
274
|
object_=tool_calls, annotation=typing.Sequence[ChatCompletionMessageToolCall], direction="write"
|
|
@@ -349,7 +352,7 @@ class MessagesClient:
|
|
|
349
352
|
messages=[
|
|
350
353
|
MessageCreate(
|
|
351
354
|
role="user",
|
|
352
|
-
|
|
355
|
+
content="content",
|
|
353
356
|
)
|
|
354
357
|
],
|
|
355
358
|
)
|
|
@@ -447,7 +450,7 @@ class MessagesClient:
|
|
|
447
450
|
messages=[
|
|
448
451
|
MessageCreate(
|
|
449
452
|
role="user",
|
|
450
|
-
|
|
453
|
+
content="content",
|
|
451
454
|
)
|
|
452
455
|
],
|
|
453
456
|
)
|
|
@@ -638,7 +641,7 @@ class AsyncMessagesClient:
|
|
|
638
641
|
messages=[
|
|
639
642
|
MessageCreate(
|
|
640
643
|
role="user",
|
|
641
|
-
|
|
644
|
+
content="content",
|
|
642
645
|
)
|
|
643
646
|
],
|
|
644
647
|
)
|
|
@@ -690,7 +693,7 @@ class AsyncMessagesClient:
|
|
|
690
693
|
message_id: str,
|
|
691
694
|
*,
|
|
692
695
|
role: typing.Optional[MessageRole] = OMIT,
|
|
693
|
-
|
|
696
|
+
content: typing.Optional[MessageUpdateContent] = OMIT,
|
|
694
697
|
name: typing.Optional[str] = OMIT,
|
|
695
698
|
tool_calls: typing.Optional[typing.Sequence[ChatCompletionMessageToolCall]] = OMIT,
|
|
696
699
|
tool_call_id: typing.Optional[str] = OMIT,
|
|
@@ -708,8 +711,8 @@ class AsyncMessagesClient:
|
|
|
708
711
|
role : typing.Optional[MessageRole]
|
|
709
712
|
The role of the participant.
|
|
710
713
|
|
|
711
|
-
|
|
712
|
-
The
|
|
714
|
+
content : typing.Optional[MessageUpdateContent]
|
|
715
|
+
The content of the message.
|
|
713
716
|
|
|
714
717
|
name : typing.Optional[str]
|
|
715
718
|
The name of the participant.
|
|
@@ -753,7 +756,9 @@ class AsyncMessagesClient:
|
|
|
753
756
|
method="PATCH",
|
|
754
757
|
json={
|
|
755
758
|
"role": role,
|
|
756
|
-
"
|
|
759
|
+
"content": convert_and_respect_annotation_metadata(
|
|
760
|
+
object_=content, annotation=MessageUpdateContent, direction="write"
|
|
761
|
+
),
|
|
757
762
|
"name": name,
|
|
758
763
|
"tool_calls": convert_and_respect_annotation_metadata(
|
|
759
764
|
object_=tool_calls, annotation=typing.Sequence[ChatCompletionMessageToolCall], direction="write"
|
|
@@ -842,7 +847,7 @@ class AsyncMessagesClient:
|
|
|
842
847
|
messages=[
|
|
843
848
|
MessageCreate(
|
|
844
849
|
role="user",
|
|
845
|
-
|
|
850
|
+
content="content",
|
|
846
851
|
)
|
|
847
852
|
],
|
|
848
853
|
)
|
|
@@ -948,7 +953,7 @@ class AsyncMessagesClient:
|
|
|
948
953
|
messages=[
|
|
949
954
|
MessageCreate(
|
|
950
955
|
role="user",
|
|
951
|
-
|
|
956
|
+
content="content",
|
|
952
957
|
)
|
|
953
958
|
],
|
|
954
959
|
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
from .letta_streaming_response import LettaStreamingResponse
|
|
4
|
+
from .message_update_content import MessageUpdateContent
|
|
4
5
|
from .messages_list_response import MessagesListResponse
|
|
5
6
|
|
|
6
|
-
__all__ = ["LettaStreamingResponse", "MessagesListResponse"]
|
|
7
|
+
__all__ = ["LettaStreamingResponse", "MessageUpdateContent", "MessagesListResponse"]
|
letta_client/blocks/client.py
CHANGED
|
@@ -10,6 +10,7 @@ from ..types.http_validation_error import HttpValidationError
|
|
|
10
10
|
from json.decoder import JSONDecodeError
|
|
11
11
|
from ..core.api_error import ApiError
|
|
12
12
|
from ..core.jsonable_encoder import jsonable_encoder
|
|
13
|
+
from ..types.agent_state import AgentState
|
|
13
14
|
from ..core.client_wrapper import AsyncClientWrapper
|
|
14
15
|
|
|
15
16
|
# this is used as the default value for optional parameters
|
|
@@ -390,6 +391,65 @@ class BlocksClient:
|
|
|
390
391
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
391
392
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
392
393
|
|
|
394
|
+
def list_agents_for_block(
|
|
395
|
+
self, block_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
396
|
+
) -> typing.List[AgentState]:
|
|
397
|
+
"""
|
|
398
|
+
Retrieves all agents associated with the specified block.
|
|
399
|
+
Raises a 404 if the block does not exist.
|
|
400
|
+
|
|
401
|
+
Parameters
|
|
402
|
+
----------
|
|
403
|
+
block_id : str
|
|
404
|
+
|
|
405
|
+
request_options : typing.Optional[RequestOptions]
|
|
406
|
+
Request-specific configuration.
|
|
407
|
+
|
|
408
|
+
Returns
|
|
409
|
+
-------
|
|
410
|
+
typing.List[AgentState]
|
|
411
|
+
Successful Response
|
|
412
|
+
|
|
413
|
+
Examples
|
|
414
|
+
--------
|
|
415
|
+
from letta_client import Letta
|
|
416
|
+
|
|
417
|
+
client = Letta(
|
|
418
|
+
token="YOUR_TOKEN",
|
|
419
|
+
)
|
|
420
|
+
client.blocks.list_agents_for_block(
|
|
421
|
+
block_id="block_id",
|
|
422
|
+
)
|
|
423
|
+
"""
|
|
424
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
425
|
+
f"v1/blocks/{jsonable_encoder(block_id)}/agents",
|
|
426
|
+
method="GET",
|
|
427
|
+
request_options=request_options,
|
|
428
|
+
)
|
|
429
|
+
try:
|
|
430
|
+
if 200 <= _response.status_code < 300:
|
|
431
|
+
return typing.cast(
|
|
432
|
+
typing.List[AgentState],
|
|
433
|
+
construct_type(
|
|
434
|
+
type_=typing.List[AgentState], # type: ignore
|
|
435
|
+
object_=_response.json(),
|
|
436
|
+
),
|
|
437
|
+
)
|
|
438
|
+
if _response.status_code == 422:
|
|
439
|
+
raise UnprocessableEntityError(
|
|
440
|
+
typing.cast(
|
|
441
|
+
HttpValidationError,
|
|
442
|
+
construct_type(
|
|
443
|
+
type_=HttpValidationError, # type: ignore
|
|
444
|
+
object_=_response.json(),
|
|
445
|
+
),
|
|
446
|
+
)
|
|
447
|
+
)
|
|
448
|
+
_response_json = _response.json()
|
|
449
|
+
except JSONDecodeError:
|
|
450
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
451
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
452
|
+
|
|
393
453
|
|
|
394
454
|
class AsyncBlocksClient:
|
|
395
455
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -804,3 +864,70 @@ class AsyncBlocksClient:
|
|
|
804
864
|
except JSONDecodeError:
|
|
805
865
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
806
866
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
867
|
+
|
|
868
|
+
async def list_agents_for_block(
|
|
869
|
+
self, block_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
870
|
+
) -> typing.List[AgentState]:
|
|
871
|
+
"""
|
|
872
|
+
Retrieves all agents associated with the specified block.
|
|
873
|
+
Raises a 404 if the block does not exist.
|
|
874
|
+
|
|
875
|
+
Parameters
|
|
876
|
+
----------
|
|
877
|
+
block_id : str
|
|
878
|
+
|
|
879
|
+
request_options : typing.Optional[RequestOptions]
|
|
880
|
+
Request-specific configuration.
|
|
881
|
+
|
|
882
|
+
Returns
|
|
883
|
+
-------
|
|
884
|
+
typing.List[AgentState]
|
|
885
|
+
Successful Response
|
|
886
|
+
|
|
887
|
+
Examples
|
|
888
|
+
--------
|
|
889
|
+
import asyncio
|
|
890
|
+
|
|
891
|
+
from letta_client import AsyncLetta
|
|
892
|
+
|
|
893
|
+
client = AsyncLetta(
|
|
894
|
+
token="YOUR_TOKEN",
|
|
895
|
+
)
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
async def main() -> None:
|
|
899
|
+
await client.blocks.list_agents_for_block(
|
|
900
|
+
block_id="block_id",
|
|
901
|
+
)
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
asyncio.run(main())
|
|
905
|
+
"""
|
|
906
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
907
|
+
f"v1/blocks/{jsonable_encoder(block_id)}/agents",
|
|
908
|
+
method="GET",
|
|
909
|
+
request_options=request_options,
|
|
910
|
+
)
|
|
911
|
+
try:
|
|
912
|
+
if 200 <= _response.status_code < 300:
|
|
913
|
+
return typing.cast(
|
|
914
|
+
typing.List[AgentState],
|
|
915
|
+
construct_type(
|
|
916
|
+
type_=typing.List[AgentState], # type: ignore
|
|
917
|
+
object_=_response.json(),
|
|
918
|
+
),
|
|
919
|
+
)
|
|
920
|
+
if _response.status_code == 422:
|
|
921
|
+
raise UnprocessableEntityError(
|
|
922
|
+
typing.cast(
|
|
923
|
+
HttpValidationError,
|
|
924
|
+
construct_type(
|
|
925
|
+
type_=HttpValidationError, # type: ignore
|
|
926
|
+
object_=_response.json(),
|
|
927
|
+
),
|
|
928
|
+
)
|
|
929
|
+
)
|
|
930
|
+
_response_json = _response.json()
|
|
931
|
+
except JSONDecodeError:
|
|
932
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
933
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
@@ -16,7 +16,7 @@ class BaseClientWrapper:
|
|
|
16
16
|
headers: typing.Dict[str, str] = {
|
|
17
17
|
"X-Fern-Language": "Python",
|
|
18
18
|
"X-Fern-SDK-Name": "letta-client",
|
|
19
|
-
"X-Fern-SDK-Version": "0.1.
|
|
19
|
+
"X-Fern-SDK-Version": "0.1.21",
|
|
20
20
|
}
|
|
21
21
|
if self.token is not None:
|
|
22
22
|
headers["Authorization"] = f"Bearer {self.token}"
|
letta_client/providers/client.py
CHANGED
|
@@ -22,7 +22,7 @@ class ProvidersClient:
|
|
|
22
22
|
def list_providers(
|
|
23
23
|
self,
|
|
24
24
|
*,
|
|
25
|
-
|
|
25
|
+
after: typing.Optional[str] = None,
|
|
26
26
|
limit: typing.Optional[int] = None,
|
|
27
27
|
request_options: typing.Optional[RequestOptions] = None,
|
|
28
28
|
) -> typing.List[Provider]:
|
|
@@ -31,7 +31,7 @@ class ProvidersClient:
|
|
|
31
31
|
|
|
32
32
|
Parameters
|
|
33
33
|
----------
|
|
34
|
-
|
|
34
|
+
after : typing.Optional[str]
|
|
35
35
|
|
|
36
36
|
limit : typing.Optional[int]
|
|
37
37
|
|
|
@@ -56,7 +56,7 @@ class ProvidersClient:
|
|
|
56
56
|
"v1/providers/",
|
|
57
57
|
method="GET",
|
|
58
58
|
params={
|
|
59
|
-
"
|
|
59
|
+
"after": after,
|
|
60
60
|
"limit": limit,
|
|
61
61
|
},
|
|
62
62
|
request_options=request_options,
|
|
@@ -297,7 +297,7 @@ class AsyncProvidersClient:
|
|
|
297
297
|
async def list_providers(
|
|
298
298
|
self,
|
|
299
299
|
*,
|
|
300
|
-
|
|
300
|
+
after: typing.Optional[str] = None,
|
|
301
301
|
limit: typing.Optional[int] = None,
|
|
302
302
|
request_options: typing.Optional[RequestOptions] = None,
|
|
303
303
|
) -> typing.List[Provider]:
|
|
@@ -306,7 +306,7 @@ class AsyncProvidersClient:
|
|
|
306
306
|
|
|
307
307
|
Parameters
|
|
308
308
|
----------
|
|
309
|
-
|
|
309
|
+
after : typing.Optional[str]
|
|
310
310
|
|
|
311
311
|
limit : typing.Optional[int]
|
|
312
312
|
|
|
@@ -339,7 +339,7 @@ class AsyncProvidersClient:
|
|
|
339
339
|
"v1/providers/",
|
|
340
340
|
method="GET",
|
|
341
341
|
params={
|
|
342
|
-
"
|
|
342
|
+
"after": after,
|
|
343
343
|
"limit": limit,
|
|
344
344
|
},
|
|
345
345
|
request_options=request_options,
|
letta_client/runs/client.py
CHANGED
|
@@ -240,9 +240,10 @@ class RunsClient:
|
|
|
240
240
|
self,
|
|
241
241
|
run_id: str,
|
|
242
242
|
*,
|
|
243
|
-
|
|
243
|
+
before: typing.Optional[str] = None,
|
|
244
|
+
after: typing.Optional[str] = None,
|
|
244
245
|
limit: typing.Optional[int] = None,
|
|
245
|
-
|
|
246
|
+
order: typing.Optional[str] = None,
|
|
246
247
|
role: typing.Optional[MessageRole] = None,
|
|
247
248
|
request_options: typing.Optional[RequestOptions] = None,
|
|
248
249
|
) -> typing.List[LettaMessageUnion]:
|
|
@@ -251,9 +252,10 @@ class RunsClient:
|
|
|
251
252
|
|
|
252
253
|
Args:
|
|
253
254
|
run_id: ID of the run
|
|
254
|
-
|
|
255
|
+
before: A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
|
|
256
|
+
after: A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
|
|
255
257
|
limit: Maximum number of messages to return
|
|
256
|
-
|
|
258
|
+
order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
|
|
257
259
|
role: Filter by role (user/assistant/system/tool)
|
|
258
260
|
return_message_object: Whether to return Message objects or LettaMessage objects
|
|
259
261
|
user_id: ID of the user making the request
|
|
@@ -265,14 +267,17 @@ class RunsClient:
|
|
|
265
267
|
----------
|
|
266
268
|
run_id : str
|
|
267
269
|
|
|
268
|
-
|
|
270
|
+
before : typing.Optional[str]
|
|
271
|
+
Cursor for pagination
|
|
272
|
+
|
|
273
|
+
after : typing.Optional[str]
|
|
269
274
|
Cursor for pagination
|
|
270
275
|
|
|
271
276
|
limit : typing.Optional[int]
|
|
272
277
|
Maximum number of messages to return
|
|
273
278
|
|
|
274
|
-
|
|
275
|
-
Sort order by
|
|
279
|
+
order : typing.Optional[str]
|
|
280
|
+
Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
|
|
276
281
|
|
|
277
282
|
role : typing.Optional[MessageRole]
|
|
278
283
|
Filter by role
|
|
@@ -300,9 +305,10 @@ class RunsClient:
|
|
|
300
305
|
f"v1/runs/{jsonable_encoder(run_id)}/messages",
|
|
301
306
|
method="GET",
|
|
302
307
|
params={
|
|
303
|
-
"
|
|
308
|
+
"before": before,
|
|
309
|
+
"after": after,
|
|
304
310
|
"limit": limit,
|
|
305
|
-
"
|
|
311
|
+
"order": order,
|
|
306
312
|
"role": role,
|
|
307
313
|
},
|
|
308
314
|
request_options=request_options,
|
|
@@ -646,9 +652,10 @@ class AsyncRunsClient:
|
|
|
646
652
|
self,
|
|
647
653
|
run_id: str,
|
|
648
654
|
*,
|
|
649
|
-
|
|
655
|
+
before: typing.Optional[str] = None,
|
|
656
|
+
after: typing.Optional[str] = None,
|
|
650
657
|
limit: typing.Optional[int] = None,
|
|
651
|
-
|
|
658
|
+
order: typing.Optional[str] = None,
|
|
652
659
|
role: typing.Optional[MessageRole] = None,
|
|
653
660
|
request_options: typing.Optional[RequestOptions] = None,
|
|
654
661
|
) -> typing.List[LettaMessageUnion]:
|
|
@@ -657,9 +664,10 @@ class AsyncRunsClient:
|
|
|
657
664
|
|
|
658
665
|
Args:
|
|
659
666
|
run_id: ID of the run
|
|
660
|
-
|
|
667
|
+
before: A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
|
|
668
|
+
after: A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
|
|
661
669
|
limit: Maximum number of messages to return
|
|
662
|
-
|
|
670
|
+
order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
|
|
663
671
|
role: Filter by role (user/assistant/system/tool)
|
|
664
672
|
return_message_object: Whether to return Message objects or LettaMessage objects
|
|
665
673
|
user_id: ID of the user making the request
|
|
@@ -671,14 +679,17 @@ class AsyncRunsClient:
|
|
|
671
679
|
----------
|
|
672
680
|
run_id : str
|
|
673
681
|
|
|
674
|
-
|
|
682
|
+
before : typing.Optional[str]
|
|
683
|
+
Cursor for pagination
|
|
684
|
+
|
|
685
|
+
after : typing.Optional[str]
|
|
675
686
|
Cursor for pagination
|
|
676
687
|
|
|
677
688
|
limit : typing.Optional[int]
|
|
678
689
|
Maximum number of messages to return
|
|
679
690
|
|
|
680
|
-
|
|
681
|
-
Sort order by
|
|
691
|
+
order : typing.Optional[str]
|
|
692
|
+
Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
|
|
682
693
|
|
|
683
694
|
role : typing.Optional[MessageRole]
|
|
684
695
|
Filter by role
|
|
@@ -714,9 +725,10 @@ class AsyncRunsClient:
|
|
|
714
725
|
f"v1/runs/{jsonable_encoder(run_id)}/messages",
|
|
715
726
|
method="GET",
|
|
716
727
|
params={
|
|
717
|
-
"
|
|
728
|
+
"before": before,
|
|
729
|
+
"after": after,
|
|
718
730
|
"limit": limit,
|
|
719
|
-
"
|
|
731
|
+
"order": order,
|
|
720
732
|
"role": role,
|
|
721
733
|
},
|
|
722
734
|
request_options=request_options,
|
|
@@ -93,7 +93,7 @@ class FilesClient:
|
|
|
93
93
|
source_id: str,
|
|
94
94
|
*,
|
|
95
95
|
limit: typing.Optional[int] = None,
|
|
96
|
-
|
|
96
|
+
after: typing.Optional[str] = None,
|
|
97
97
|
request_options: typing.Optional[RequestOptions] = None,
|
|
98
98
|
) -> typing.List[FileMetadata]:
|
|
99
99
|
"""
|
|
@@ -106,7 +106,7 @@ class FilesClient:
|
|
|
106
106
|
limit : typing.Optional[int]
|
|
107
107
|
Number of files to return
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
after : typing.Optional[str]
|
|
110
110
|
Pagination cursor to fetch the next set of results
|
|
111
111
|
|
|
112
112
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -133,7 +133,7 @@ class FilesClient:
|
|
|
133
133
|
method="GET",
|
|
134
134
|
params={
|
|
135
135
|
"limit": limit,
|
|
136
|
-
"
|
|
136
|
+
"after": after,
|
|
137
137
|
},
|
|
138
138
|
request_options=request_options,
|
|
139
139
|
)
|
|
@@ -297,7 +297,7 @@ class AsyncFilesClient:
|
|
|
297
297
|
source_id: str,
|
|
298
298
|
*,
|
|
299
299
|
limit: typing.Optional[int] = None,
|
|
300
|
-
|
|
300
|
+
after: typing.Optional[str] = None,
|
|
301
301
|
request_options: typing.Optional[RequestOptions] = None,
|
|
302
302
|
) -> typing.List[FileMetadata]:
|
|
303
303
|
"""
|
|
@@ -310,7 +310,7 @@ class AsyncFilesClient:
|
|
|
310
310
|
limit : typing.Optional[int]
|
|
311
311
|
Number of files to return
|
|
312
312
|
|
|
313
|
-
|
|
313
|
+
after : typing.Optional[str]
|
|
314
314
|
Pagination cursor to fetch the next set of results
|
|
315
315
|
|
|
316
316
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -345,7 +345,7 @@ class AsyncFilesClient:
|
|
|
345
345
|
method="GET",
|
|
346
346
|
params={
|
|
347
347
|
"limit": limit,
|
|
348
|
-
"
|
|
348
|
+
"after": after,
|
|
349
349
|
},
|
|
350
350
|
request_options=request_options,
|
|
351
351
|
)
|
letta_client/tag/client.py
CHANGED
|
@@ -18,7 +18,7 @@ class TagClient:
|
|
|
18
18
|
def list_tags(
|
|
19
19
|
self,
|
|
20
20
|
*,
|
|
21
|
-
|
|
21
|
+
after: typing.Optional[str] = None,
|
|
22
22
|
limit: typing.Optional[int] = None,
|
|
23
23
|
query_text: typing.Optional[str] = None,
|
|
24
24
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -28,7 +28,7 @@ class TagClient:
|
|
|
28
28
|
|
|
29
29
|
Parameters
|
|
30
30
|
----------
|
|
31
|
-
|
|
31
|
+
after : typing.Optional[str]
|
|
32
32
|
|
|
33
33
|
limit : typing.Optional[int]
|
|
34
34
|
|
|
@@ -55,7 +55,7 @@ class TagClient:
|
|
|
55
55
|
"v1/tags/",
|
|
56
56
|
method="GET",
|
|
57
57
|
params={
|
|
58
|
-
"
|
|
58
|
+
"after": after,
|
|
59
59
|
"limit": limit,
|
|
60
60
|
"query_text": query_text,
|
|
61
61
|
},
|
|
@@ -93,7 +93,7 @@ class AsyncTagClient:
|
|
|
93
93
|
async def list_tags(
|
|
94
94
|
self,
|
|
95
95
|
*,
|
|
96
|
-
|
|
96
|
+
after: typing.Optional[str] = None,
|
|
97
97
|
limit: typing.Optional[int] = None,
|
|
98
98
|
query_text: typing.Optional[str] = None,
|
|
99
99
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -103,7 +103,7 @@ class AsyncTagClient:
|
|
|
103
103
|
|
|
104
104
|
Parameters
|
|
105
105
|
----------
|
|
106
|
-
|
|
106
|
+
after : typing.Optional[str]
|
|
107
107
|
|
|
108
108
|
limit : typing.Optional[int]
|
|
109
109
|
|
|
@@ -138,7 +138,7 @@ class AsyncTagClient:
|
|
|
138
138
|
"v1/tags/",
|
|
139
139
|
method="GET",
|
|
140
140
|
params={
|
|
141
|
-
"
|
|
141
|
+
"after": after,
|
|
142
142
|
"limit": limit,
|
|
143
143
|
"query_text": query_text,
|
|
144
144
|
},
|
letta_client/tools/client.py
CHANGED
|
@@ -242,7 +242,7 @@ class ToolsClient:
|
|
|
242
242
|
def list(
|
|
243
243
|
self,
|
|
244
244
|
*,
|
|
245
|
-
|
|
245
|
+
after: typing.Optional[str] = None,
|
|
246
246
|
limit: typing.Optional[int] = None,
|
|
247
247
|
request_options: typing.Optional[RequestOptions] = None,
|
|
248
248
|
) -> typing.List[Tool]:
|
|
@@ -251,7 +251,7 @@ class ToolsClient:
|
|
|
251
251
|
|
|
252
252
|
Parameters
|
|
253
253
|
----------
|
|
254
|
-
|
|
254
|
+
after : typing.Optional[str]
|
|
255
255
|
|
|
256
256
|
limit : typing.Optional[int]
|
|
257
257
|
|
|
@@ -276,7 +276,7 @@ class ToolsClient:
|
|
|
276
276
|
"v1/tools/",
|
|
277
277
|
method="GET",
|
|
278
278
|
params={
|
|
279
|
-
"
|
|
279
|
+
"after": after,
|
|
280
280
|
"limit": limit,
|
|
281
281
|
},
|
|
282
282
|
request_options=request_options,
|
|
@@ -1055,7 +1055,7 @@ class AsyncToolsClient:
|
|
|
1055
1055
|
async def list(
|
|
1056
1056
|
self,
|
|
1057
1057
|
*,
|
|
1058
|
-
|
|
1058
|
+
after: typing.Optional[str] = None,
|
|
1059
1059
|
limit: typing.Optional[int] = None,
|
|
1060
1060
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1061
1061
|
) -> typing.List[Tool]:
|
|
@@ -1064,7 +1064,7 @@ class AsyncToolsClient:
|
|
|
1064
1064
|
|
|
1065
1065
|
Parameters
|
|
1066
1066
|
----------
|
|
1067
|
-
|
|
1067
|
+
after : typing.Optional[str]
|
|
1068
1068
|
|
|
1069
1069
|
limit : typing.Optional[int]
|
|
1070
1070
|
|
|
@@ -1097,7 +1097,7 @@ class AsyncToolsClient:
|
|
|
1097
1097
|
"v1/tools/",
|
|
1098
1098
|
method="GET",
|
|
1099
1099
|
params={
|
|
1100
|
-
"
|
|
1100
|
+
"after": after,
|
|
1101
1101
|
"limit": limit,
|
|
1102
1102
|
},
|
|
1103
1103
|
request_options=request_options,
|