letta-client 0.1.19__py3-none-any.whl → 0.1.22__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 +29 -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/client.py +0 -4
- 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 -36
- 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/tool_create.py +0 -5
- 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.22.dist-info}/METADATA +2 -2
- {letta_client-0.1.19.dist-info → letta_client-0.1.22.dist-info}/RECORD +34 -28
- {letta_client-0.1.19.dist-info → letta_client-0.1.22.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
|
|
@@ -35,6 +36,7 @@ class MessagesClient:
|
|
|
35
36
|
self,
|
|
36
37
|
agent_id: str,
|
|
37
38
|
*,
|
|
39
|
+
after: typing.Optional[str] = None,
|
|
38
40
|
before: typing.Optional[str] = None,
|
|
39
41
|
limit: typing.Optional[int] = None,
|
|
40
42
|
msg_object: typing.Optional[bool] = None,
|
|
@@ -49,6 +51,9 @@ class MessagesClient:
|
|
|
49
51
|
----------
|
|
50
52
|
agent_id : str
|
|
51
53
|
|
|
54
|
+
after : typing.Optional[str]
|
|
55
|
+
Message after which to retrieve the returned messages.
|
|
56
|
+
|
|
52
57
|
before : typing.Optional[str]
|
|
53
58
|
Message before which to retrieve the returned messages.
|
|
54
59
|
|
|
@@ -87,6 +92,7 @@ class MessagesClient:
|
|
|
87
92
|
f"v1/agents/{jsonable_encoder(agent_id)}/messages",
|
|
88
93
|
method="GET",
|
|
89
94
|
params={
|
|
95
|
+
"after": after,
|
|
90
96
|
"before": before,
|
|
91
97
|
"limit": limit,
|
|
92
98
|
"msg_object": msg_object,
|
|
@@ -161,7 +167,7 @@ class MessagesClient:
|
|
|
161
167
|
messages=[
|
|
162
168
|
MessageCreate(
|
|
163
169
|
role="user",
|
|
164
|
-
|
|
170
|
+
content="content",
|
|
165
171
|
)
|
|
166
172
|
],
|
|
167
173
|
)
|
|
@@ -210,7 +216,7 @@ class MessagesClient:
|
|
|
210
216
|
message_id: str,
|
|
211
217
|
*,
|
|
212
218
|
role: typing.Optional[MessageRole] = OMIT,
|
|
213
|
-
|
|
219
|
+
content: typing.Optional[MessageUpdateContent] = OMIT,
|
|
214
220
|
name: typing.Optional[str] = OMIT,
|
|
215
221
|
tool_calls: typing.Optional[typing.Sequence[ChatCompletionMessageToolCall]] = OMIT,
|
|
216
222
|
tool_call_id: typing.Optional[str] = OMIT,
|
|
@@ -228,8 +234,8 @@ class MessagesClient:
|
|
|
228
234
|
role : typing.Optional[MessageRole]
|
|
229
235
|
The role of the participant.
|
|
230
236
|
|
|
231
|
-
|
|
232
|
-
The
|
|
237
|
+
content : typing.Optional[MessageUpdateContent]
|
|
238
|
+
The content of the message.
|
|
233
239
|
|
|
234
240
|
name : typing.Optional[str]
|
|
235
241
|
The name of the participant.
|
|
@@ -265,7 +271,9 @@ class MessagesClient:
|
|
|
265
271
|
method="PATCH",
|
|
266
272
|
json={
|
|
267
273
|
"role": role,
|
|
268
|
-
"
|
|
274
|
+
"content": convert_and_respect_annotation_metadata(
|
|
275
|
+
object_=content, annotation=MessageUpdateContent, direction="write"
|
|
276
|
+
),
|
|
269
277
|
"name": name,
|
|
270
278
|
"tool_calls": convert_and_respect_annotation_metadata(
|
|
271
279
|
object_=tool_calls, annotation=typing.Sequence[ChatCompletionMessageToolCall], direction="write"
|
|
@@ -349,7 +357,7 @@ class MessagesClient:
|
|
|
349
357
|
messages=[
|
|
350
358
|
MessageCreate(
|
|
351
359
|
role="user",
|
|
352
|
-
|
|
360
|
+
content="content",
|
|
353
361
|
)
|
|
354
362
|
],
|
|
355
363
|
)
|
|
@@ -447,7 +455,7 @@ class MessagesClient:
|
|
|
447
455
|
messages=[
|
|
448
456
|
MessageCreate(
|
|
449
457
|
role="user",
|
|
450
|
-
|
|
458
|
+
content="content",
|
|
451
459
|
)
|
|
452
460
|
],
|
|
453
461
|
)
|
|
@@ -499,6 +507,7 @@ class AsyncMessagesClient:
|
|
|
499
507
|
self,
|
|
500
508
|
agent_id: str,
|
|
501
509
|
*,
|
|
510
|
+
after: typing.Optional[str] = None,
|
|
502
511
|
before: typing.Optional[str] = None,
|
|
503
512
|
limit: typing.Optional[int] = None,
|
|
504
513
|
msg_object: typing.Optional[bool] = None,
|
|
@@ -513,6 +522,9 @@ class AsyncMessagesClient:
|
|
|
513
522
|
----------
|
|
514
523
|
agent_id : str
|
|
515
524
|
|
|
525
|
+
after : typing.Optional[str]
|
|
526
|
+
Message after which to retrieve the returned messages.
|
|
527
|
+
|
|
516
528
|
before : typing.Optional[str]
|
|
517
529
|
Message before which to retrieve the returned messages.
|
|
518
530
|
|
|
@@ -559,6 +571,7 @@ class AsyncMessagesClient:
|
|
|
559
571
|
f"v1/agents/{jsonable_encoder(agent_id)}/messages",
|
|
560
572
|
method="GET",
|
|
561
573
|
params={
|
|
574
|
+
"after": after,
|
|
562
575
|
"before": before,
|
|
563
576
|
"limit": limit,
|
|
564
577
|
"msg_object": msg_object,
|
|
@@ -638,7 +651,7 @@ class AsyncMessagesClient:
|
|
|
638
651
|
messages=[
|
|
639
652
|
MessageCreate(
|
|
640
653
|
role="user",
|
|
641
|
-
|
|
654
|
+
content="content",
|
|
642
655
|
)
|
|
643
656
|
],
|
|
644
657
|
)
|
|
@@ -690,7 +703,7 @@ class AsyncMessagesClient:
|
|
|
690
703
|
message_id: str,
|
|
691
704
|
*,
|
|
692
705
|
role: typing.Optional[MessageRole] = OMIT,
|
|
693
|
-
|
|
706
|
+
content: typing.Optional[MessageUpdateContent] = OMIT,
|
|
694
707
|
name: typing.Optional[str] = OMIT,
|
|
695
708
|
tool_calls: typing.Optional[typing.Sequence[ChatCompletionMessageToolCall]] = OMIT,
|
|
696
709
|
tool_call_id: typing.Optional[str] = OMIT,
|
|
@@ -708,8 +721,8 @@ class AsyncMessagesClient:
|
|
|
708
721
|
role : typing.Optional[MessageRole]
|
|
709
722
|
The role of the participant.
|
|
710
723
|
|
|
711
|
-
|
|
712
|
-
The
|
|
724
|
+
content : typing.Optional[MessageUpdateContent]
|
|
725
|
+
The content of the message.
|
|
713
726
|
|
|
714
727
|
name : typing.Optional[str]
|
|
715
728
|
The name of the participant.
|
|
@@ -753,7 +766,9 @@ class AsyncMessagesClient:
|
|
|
753
766
|
method="PATCH",
|
|
754
767
|
json={
|
|
755
768
|
"role": role,
|
|
756
|
-
"
|
|
769
|
+
"content": convert_and_respect_annotation_metadata(
|
|
770
|
+
object_=content, annotation=MessageUpdateContent, direction="write"
|
|
771
|
+
),
|
|
757
772
|
"name": name,
|
|
758
773
|
"tool_calls": convert_and_respect_annotation_metadata(
|
|
759
774
|
object_=tool_calls, annotation=typing.Sequence[ChatCompletionMessageToolCall], direction="write"
|
|
@@ -842,7 +857,7 @@ class AsyncMessagesClient:
|
|
|
842
857
|
messages=[
|
|
843
858
|
MessageCreate(
|
|
844
859
|
role="user",
|
|
845
|
-
|
|
860
|
+
content="content",
|
|
846
861
|
)
|
|
847
862
|
],
|
|
848
863
|
)
|
|
@@ -948,7 +963,7 @@ class AsyncMessagesClient:
|
|
|
948
963
|
messages=[
|
|
949
964
|
MessageCreate(
|
|
950
965
|
role="user",
|
|
951
|
-
|
|
966
|
+
content="content",
|
|
952
967
|
)
|
|
953
968
|
],
|
|
954
969
|
)
|
|
@@ -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)
|
letta_client/client.py
CHANGED
|
@@ -31,7 +31,6 @@ class ToolsClient(ToolsClientBase):
|
|
|
31
31
|
self,
|
|
32
32
|
*,
|
|
33
33
|
func: typing.Callable,
|
|
34
|
-
name: typing.Optional[str] = OMIT,
|
|
35
34
|
description: typing.Optional[str] = OMIT,
|
|
36
35
|
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
37
36
|
source_type: typing.Optional[str] = OMIT,
|
|
@@ -44,7 +43,6 @@ class ToolsClient(ToolsClientBase):
|
|
|
44
43
|
source_code = dedent(inspect.getsource(func))
|
|
45
44
|
return self.create(
|
|
46
45
|
source_code=source_code,
|
|
47
|
-
name=name,
|
|
48
46
|
description=description,
|
|
49
47
|
tags=tags,
|
|
50
48
|
source_type=source_type,
|
|
@@ -57,7 +55,6 @@ class ToolsClient(ToolsClientBase):
|
|
|
57
55
|
self,
|
|
58
56
|
*,
|
|
59
57
|
func: typing.Callable,
|
|
60
|
-
name: typing.Optional[str] = OMIT,
|
|
61
58
|
description: typing.Optional[str] = OMIT,
|
|
62
59
|
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
63
60
|
source_type: typing.Optional[str] = OMIT,
|
|
@@ -70,7 +67,6 @@ class ToolsClient(ToolsClientBase):
|
|
|
70
67
|
source_code = dedent(inspect.getsource(func))
|
|
71
68
|
return self.upsert(
|
|
72
69
|
source_code=source_code,
|
|
73
|
-
name=name,
|
|
74
70
|
description=description,
|
|
75
71
|
tags=tags,
|
|
76
72
|
source_type=source_type,
|
|
@@ -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.22",
|
|
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
|
},
|