letta-client 0.1.13__py3-none-any.whl → 0.1.15__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 +18 -0
- letta_client/agents/client.py +14 -4
- letta_client/agents/messages/client.py +41 -88
- letta_client/client.py +32 -7
- letta_client/core/client_wrapper.py +1 -1
- letta_client/runs/__init__.py +19 -0
- letta_client/runs/client.py +21 -87
- letta_client/runs/types/__init__.py +21 -0
- letta_client/runs/types/get_run_messages_response_item.py +125 -0
- letta_client/types/__init__.py +2 -0
- letta_client/types/letta_request.py +3 -12
- letta_client/types/letta_request_config.py +32 -0
- letta_client/types/run.py +6 -0
- {letta_client-0.1.13.dist-info → letta_client-0.1.15.dist-info}/METADATA +1 -1
- {letta_client-0.1.13.dist-info → letta_client-0.1.15.dist-info}/RECORD +16 -13
- {letta_client-0.1.13.dist-info → letta_client-0.1.15.dist-info}/WHEEL +0 -0
letta_client/__init__.py
CHANGED
|
@@ -51,6 +51,7 @@ from .types import (
|
|
|
51
51
|
JobStatus,
|
|
52
52
|
JobType,
|
|
53
53
|
LettaRequest,
|
|
54
|
+
LettaRequestConfig,
|
|
54
55
|
LettaResponse,
|
|
55
56
|
LettaResponseMessagesItem,
|
|
56
57
|
LettaResponseMessagesItem_AssistantMessage,
|
|
@@ -147,6 +148,15 @@ from .agents import (
|
|
|
147
148
|
)
|
|
148
149
|
from .client import AsyncLetta, Letta
|
|
149
150
|
from .environment import LettaEnvironment
|
|
151
|
+
from .runs import (
|
|
152
|
+
GetRunMessagesResponseItem,
|
|
153
|
+
GetRunMessagesResponseItem_AssistantMessage,
|
|
154
|
+
GetRunMessagesResponseItem_ReasoningMessage,
|
|
155
|
+
GetRunMessagesResponseItem_SystemMessage,
|
|
156
|
+
GetRunMessagesResponseItem_ToolCallMessage,
|
|
157
|
+
GetRunMessagesResponseItem_ToolReturnMessage,
|
|
158
|
+
GetRunMessagesResponseItem_UserMessage,
|
|
159
|
+
)
|
|
150
160
|
from .version import __version__
|
|
151
161
|
|
|
152
162
|
__all__ = [
|
|
@@ -208,6 +218,13 @@ __all__ = [
|
|
|
208
218
|
"FunctionCallInput",
|
|
209
219
|
"FunctionCallOutput",
|
|
210
220
|
"FunctionSchema",
|
|
221
|
+
"GetRunMessagesResponseItem",
|
|
222
|
+
"GetRunMessagesResponseItem_AssistantMessage",
|
|
223
|
+
"GetRunMessagesResponseItem_ReasoningMessage",
|
|
224
|
+
"GetRunMessagesResponseItem_SystemMessage",
|
|
225
|
+
"GetRunMessagesResponseItem_ToolCallMessage",
|
|
226
|
+
"GetRunMessagesResponseItem_ToolReturnMessage",
|
|
227
|
+
"GetRunMessagesResponseItem_UserMessage",
|
|
211
228
|
"Health",
|
|
212
229
|
"HttpValidationError",
|
|
213
230
|
"InitToolRule",
|
|
@@ -219,6 +236,7 @@ __all__ = [
|
|
|
219
236
|
"Letta",
|
|
220
237
|
"LettaEnvironment",
|
|
221
238
|
"LettaRequest",
|
|
239
|
+
"LettaRequestConfig",
|
|
222
240
|
"LettaResponse",
|
|
223
241
|
"LettaResponseMessagesItem",
|
|
224
242
|
"LettaResponseMessagesItem_AssistantMessage",
|
letta_client/agents/client.py
CHANGED
|
@@ -63,8 +63,9 @@ class AgentsClient:
|
|
|
63
63
|
name: typing.Optional[str] = None,
|
|
64
64
|
tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
65
65
|
match_all_tags: typing.Optional[bool] = None,
|
|
66
|
-
cursor: typing.Optional[
|
|
66
|
+
cursor: typing.Optional[str] = None,
|
|
67
67
|
limit: typing.Optional[int] = None,
|
|
68
|
+
query_text: typing.Optional[str] = None,
|
|
68
69
|
request_options: typing.Optional[RequestOptions] = None,
|
|
69
70
|
) -> typing.List[AgentState]:
|
|
70
71
|
"""
|
|
@@ -82,12 +83,15 @@ class AgentsClient:
|
|
|
82
83
|
match_all_tags : typing.Optional[bool]
|
|
83
84
|
If True, only returns agents that match ALL given tags. Otherwise, return agents that have ANY of the passed in tags.
|
|
84
85
|
|
|
85
|
-
cursor : typing.Optional[
|
|
86
|
+
cursor : typing.Optional[str]
|
|
86
87
|
Cursor for pagination
|
|
87
88
|
|
|
88
89
|
limit : typing.Optional[int]
|
|
89
90
|
Limit for pagination
|
|
90
91
|
|
|
92
|
+
query_text : typing.Optional[str]
|
|
93
|
+
Search agents by name
|
|
94
|
+
|
|
91
95
|
request_options : typing.Optional[RequestOptions]
|
|
92
96
|
Request-specific configuration.
|
|
93
97
|
|
|
@@ -114,6 +118,7 @@ class AgentsClient:
|
|
|
114
118
|
"match_all_tags": match_all_tags,
|
|
115
119
|
"cursor": cursor,
|
|
116
120
|
"limit": limit,
|
|
121
|
+
"query_text": query_text,
|
|
117
122
|
},
|
|
118
123
|
request_options=request_options,
|
|
119
124
|
)
|
|
@@ -747,8 +752,9 @@ class AsyncAgentsClient:
|
|
|
747
752
|
name: typing.Optional[str] = None,
|
|
748
753
|
tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
749
754
|
match_all_tags: typing.Optional[bool] = None,
|
|
750
|
-
cursor: typing.Optional[
|
|
755
|
+
cursor: typing.Optional[str] = None,
|
|
751
756
|
limit: typing.Optional[int] = None,
|
|
757
|
+
query_text: typing.Optional[str] = None,
|
|
752
758
|
request_options: typing.Optional[RequestOptions] = None,
|
|
753
759
|
) -> typing.List[AgentState]:
|
|
754
760
|
"""
|
|
@@ -766,12 +772,15 @@ class AsyncAgentsClient:
|
|
|
766
772
|
match_all_tags : typing.Optional[bool]
|
|
767
773
|
If True, only returns agents that match ALL given tags. Otherwise, return agents that have ANY of the passed in tags.
|
|
768
774
|
|
|
769
|
-
cursor : typing.Optional[
|
|
775
|
+
cursor : typing.Optional[str]
|
|
770
776
|
Cursor for pagination
|
|
771
777
|
|
|
772
778
|
limit : typing.Optional[int]
|
|
773
779
|
Limit for pagination
|
|
774
780
|
|
|
781
|
+
query_text : typing.Optional[str]
|
|
782
|
+
Search agents by name
|
|
783
|
+
|
|
775
784
|
request_options : typing.Optional[RequestOptions]
|
|
776
785
|
Request-specific configuration.
|
|
777
786
|
|
|
@@ -806,6 +815,7 @@ class AsyncAgentsClient:
|
|
|
806
815
|
"match_all_tags": match_all_tags,
|
|
807
816
|
"cursor": cursor,
|
|
808
817
|
"limit": limit,
|
|
818
|
+
"query_text": query_text,
|
|
809
819
|
},
|
|
810
820
|
request_options=request_options,
|
|
811
821
|
)
|
|
@@ -11,6 +11,7 @@ from ...types.http_validation_error import HttpValidationError
|
|
|
11
11
|
from json.decoder import JSONDecodeError
|
|
12
12
|
from ...core.api_error import ApiError
|
|
13
13
|
from ...types.message_create import MessageCreate
|
|
14
|
+
from ...types.letta_request_config import LettaRequestConfig
|
|
14
15
|
from ...types.letta_response import LettaResponse
|
|
15
16
|
from ...core.serialization import convert_and_respect_annotation_metadata
|
|
16
17
|
from ...types.message_role import MessageRole
|
|
@@ -125,9 +126,7 @@ class MessagesClient:
|
|
|
125
126
|
agent_id: str,
|
|
126
127
|
*,
|
|
127
128
|
messages: typing.Sequence[MessageCreate],
|
|
128
|
-
|
|
129
|
-
assistant_message_tool_name: typing.Optional[str] = OMIT,
|
|
130
|
-
assistant_message_tool_kwarg: typing.Optional[str] = OMIT,
|
|
129
|
+
config: typing.Optional[LettaRequestConfig] = OMIT,
|
|
131
130
|
request_options: typing.Optional[RequestOptions] = None,
|
|
132
131
|
) -> LettaResponse:
|
|
133
132
|
"""
|
|
@@ -141,14 +140,8 @@ class MessagesClient:
|
|
|
141
140
|
messages : typing.Sequence[MessageCreate]
|
|
142
141
|
The messages to be sent to the agent.
|
|
143
142
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
assistant_message_tool_name : typing.Optional[str]
|
|
148
|
-
The name of the designated message tool.
|
|
149
|
-
|
|
150
|
-
assistant_message_tool_kwarg : typing.Optional[str]
|
|
151
|
-
The name of the message argument in the designated message tool.
|
|
143
|
+
config : typing.Optional[LettaRequestConfig]
|
|
144
|
+
Configuration options for the LettaRequest.
|
|
152
145
|
|
|
153
146
|
request_options : typing.Optional[RequestOptions]
|
|
154
147
|
Request-specific configuration.
|
|
@@ -182,9 +175,9 @@ class MessagesClient:
|
|
|
182
175
|
"messages": convert_and_respect_annotation_metadata(
|
|
183
176
|
object_=messages, annotation=typing.Sequence[MessageCreate], direction="write"
|
|
184
177
|
),
|
|
185
|
-
"
|
|
186
|
-
|
|
187
|
-
|
|
178
|
+
"config": convert_and_respect_annotation_metadata(
|
|
179
|
+
object_=config, annotation=LettaRequestConfig, direction="write"
|
|
180
|
+
),
|
|
188
181
|
},
|
|
189
182
|
request_options=request_options,
|
|
190
183
|
omit=OMIT,
|
|
@@ -318,9 +311,7 @@ class MessagesClient:
|
|
|
318
311
|
agent_id: str,
|
|
319
312
|
*,
|
|
320
313
|
messages: typing.Sequence[MessageCreate],
|
|
321
|
-
|
|
322
|
-
assistant_message_tool_name: typing.Optional[str] = OMIT,
|
|
323
|
-
assistant_message_tool_kwarg: typing.Optional[str] = OMIT,
|
|
314
|
+
config: typing.Optional[LettaRequestConfig] = OMIT,
|
|
324
315
|
stream_tokens: typing.Optional[bool] = OMIT,
|
|
325
316
|
request_options: typing.Optional[RequestOptions] = None,
|
|
326
317
|
) -> typing.Iterator[LettaStreamingResponse]:
|
|
@@ -336,14 +327,8 @@ class MessagesClient:
|
|
|
336
327
|
messages : typing.Sequence[MessageCreate]
|
|
337
328
|
The messages to be sent to the agent.
|
|
338
329
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
assistant_message_tool_name : typing.Optional[str]
|
|
343
|
-
The name of the designated message tool.
|
|
344
|
-
|
|
345
|
-
assistant_message_tool_kwarg : typing.Optional[str]
|
|
346
|
-
The name of the message argument in the designated message tool.
|
|
330
|
+
config : typing.Optional[LettaRequestConfig]
|
|
331
|
+
Configuration options for the LettaRequest.
|
|
347
332
|
|
|
348
333
|
stream_tokens : typing.Optional[bool]
|
|
349
334
|
Flag to determine if individual tokens should be streamed. Set to True for token streaming (requires stream_steps = True).
|
|
@@ -382,9 +367,9 @@ class MessagesClient:
|
|
|
382
367
|
"messages": convert_and_respect_annotation_metadata(
|
|
383
368
|
object_=messages, annotation=typing.Sequence[MessageCreate], direction="write"
|
|
384
369
|
),
|
|
385
|
-
"
|
|
386
|
-
|
|
387
|
-
|
|
370
|
+
"config": convert_and_respect_annotation_metadata(
|
|
371
|
+
object_=config, annotation=LettaRequestConfig, direction="write"
|
|
372
|
+
),
|
|
388
373
|
"stream_tokens": stream_tokens,
|
|
389
374
|
},
|
|
390
375
|
headers={
|
|
@@ -429,14 +414,12 @@ class MessagesClient:
|
|
|
429
414
|
agent_id: str,
|
|
430
415
|
*,
|
|
431
416
|
messages: typing.Sequence[MessageCreate],
|
|
432
|
-
|
|
433
|
-
assistant_message_tool_name: typing.Optional[str] = OMIT,
|
|
434
|
-
assistant_message_tool_kwarg: typing.Optional[str] = OMIT,
|
|
417
|
+
config: typing.Optional[LettaRequestConfig] = OMIT,
|
|
435
418
|
request_options: typing.Optional[RequestOptions] = None,
|
|
436
419
|
) -> Run:
|
|
437
420
|
"""
|
|
438
|
-
Asynchronously process a user message and return a
|
|
439
|
-
The actual processing happens in the background, and the status can be checked using the
|
|
421
|
+
Asynchronously process a user message and return a run object.
|
|
422
|
+
The actual processing happens in the background, and the status can be checked using the run ID.
|
|
440
423
|
|
|
441
424
|
Parameters
|
|
442
425
|
----------
|
|
@@ -445,14 +428,8 @@ class MessagesClient:
|
|
|
445
428
|
messages : typing.Sequence[MessageCreate]
|
|
446
429
|
The messages to be sent to the agent.
|
|
447
430
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
assistant_message_tool_name : typing.Optional[str]
|
|
452
|
-
The name of the designated message tool.
|
|
453
|
-
|
|
454
|
-
assistant_message_tool_kwarg : typing.Optional[str]
|
|
455
|
-
The name of the message argument in the designated message tool.
|
|
431
|
+
config : typing.Optional[LettaRequestConfig]
|
|
432
|
+
Configuration options for the LettaRequest.
|
|
456
433
|
|
|
457
434
|
request_options : typing.Optional[RequestOptions]
|
|
458
435
|
Request-specific configuration.
|
|
@@ -486,9 +463,9 @@ class MessagesClient:
|
|
|
486
463
|
"messages": convert_and_respect_annotation_metadata(
|
|
487
464
|
object_=messages, annotation=typing.Sequence[MessageCreate], direction="write"
|
|
488
465
|
),
|
|
489
|
-
"
|
|
490
|
-
|
|
491
|
-
|
|
466
|
+
"config": convert_and_respect_annotation_metadata(
|
|
467
|
+
object_=config, annotation=LettaRequestConfig, direction="write"
|
|
468
|
+
),
|
|
492
469
|
},
|
|
493
470
|
request_options=request_options,
|
|
494
471
|
omit=OMIT,
|
|
@@ -623,9 +600,7 @@ class AsyncMessagesClient:
|
|
|
623
600
|
agent_id: str,
|
|
624
601
|
*,
|
|
625
602
|
messages: typing.Sequence[MessageCreate],
|
|
626
|
-
|
|
627
|
-
assistant_message_tool_name: typing.Optional[str] = OMIT,
|
|
628
|
-
assistant_message_tool_kwarg: typing.Optional[str] = OMIT,
|
|
603
|
+
config: typing.Optional[LettaRequestConfig] = OMIT,
|
|
629
604
|
request_options: typing.Optional[RequestOptions] = None,
|
|
630
605
|
) -> LettaResponse:
|
|
631
606
|
"""
|
|
@@ -639,14 +614,8 @@ class AsyncMessagesClient:
|
|
|
639
614
|
messages : typing.Sequence[MessageCreate]
|
|
640
615
|
The messages to be sent to the agent.
|
|
641
616
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
assistant_message_tool_name : typing.Optional[str]
|
|
646
|
-
The name of the designated message tool.
|
|
647
|
-
|
|
648
|
-
assistant_message_tool_kwarg : typing.Optional[str]
|
|
649
|
-
The name of the message argument in the designated message tool.
|
|
617
|
+
config : typing.Optional[LettaRequestConfig]
|
|
618
|
+
Configuration options for the LettaRequest.
|
|
650
619
|
|
|
651
620
|
request_options : typing.Optional[RequestOptions]
|
|
652
621
|
Request-specific configuration.
|
|
@@ -688,9 +657,9 @@ class AsyncMessagesClient:
|
|
|
688
657
|
"messages": convert_and_respect_annotation_metadata(
|
|
689
658
|
object_=messages, annotation=typing.Sequence[MessageCreate], direction="write"
|
|
690
659
|
),
|
|
691
|
-
"
|
|
692
|
-
|
|
693
|
-
|
|
660
|
+
"config": convert_and_respect_annotation_metadata(
|
|
661
|
+
object_=config, annotation=LettaRequestConfig, direction="write"
|
|
662
|
+
),
|
|
694
663
|
},
|
|
695
664
|
request_options=request_options,
|
|
696
665
|
omit=OMIT,
|
|
@@ -832,9 +801,7 @@ class AsyncMessagesClient:
|
|
|
832
801
|
agent_id: str,
|
|
833
802
|
*,
|
|
834
803
|
messages: typing.Sequence[MessageCreate],
|
|
835
|
-
|
|
836
|
-
assistant_message_tool_name: typing.Optional[str] = OMIT,
|
|
837
|
-
assistant_message_tool_kwarg: typing.Optional[str] = OMIT,
|
|
804
|
+
config: typing.Optional[LettaRequestConfig] = OMIT,
|
|
838
805
|
stream_tokens: typing.Optional[bool] = OMIT,
|
|
839
806
|
request_options: typing.Optional[RequestOptions] = None,
|
|
840
807
|
) -> typing.AsyncIterator[LettaStreamingResponse]:
|
|
@@ -850,14 +817,8 @@ class AsyncMessagesClient:
|
|
|
850
817
|
messages : typing.Sequence[MessageCreate]
|
|
851
818
|
The messages to be sent to the agent.
|
|
852
819
|
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
assistant_message_tool_name : typing.Optional[str]
|
|
857
|
-
The name of the designated message tool.
|
|
858
|
-
|
|
859
|
-
assistant_message_tool_kwarg : typing.Optional[str]
|
|
860
|
-
The name of the message argument in the designated message tool.
|
|
820
|
+
config : typing.Optional[LettaRequestConfig]
|
|
821
|
+
Configuration options for the LettaRequest.
|
|
861
822
|
|
|
862
823
|
stream_tokens : typing.Optional[bool]
|
|
863
824
|
Flag to determine if individual tokens should be streamed. Set to True for token streaming (requires stream_steps = True).
|
|
@@ -904,9 +865,9 @@ class AsyncMessagesClient:
|
|
|
904
865
|
"messages": convert_and_respect_annotation_metadata(
|
|
905
866
|
object_=messages, annotation=typing.Sequence[MessageCreate], direction="write"
|
|
906
867
|
),
|
|
907
|
-
"
|
|
908
|
-
|
|
909
|
-
|
|
868
|
+
"config": convert_and_respect_annotation_metadata(
|
|
869
|
+
object_=config, annotation=LettaRequestConfig, direction="write"
|
|
870
|
+
),
|
|
910
871
|
"stream_tokens": stream_tokens,
|
|
911
872
|
},
|
|
912
873
|
headers={
|
|
@@ -951,14 +912,12 @@ class AsyncMessagesClient:
|
|
|
951
912
|
agent_id: str,
|
|
952
913
|
*,
|
|
953
914
|
messages: typing.Sequence[MessageCreate],
|
|
954
|
-
|
|
955
|
-
assistant_message_tool_name: typing.Optional[str] = OMIT,
|
|
956
|
-
assistant_message_tool_kwarg: typing.Optional[str] = OMIT,
|
|
915
|
+
config: typing.Optional[LettaRequestConfig] = OMIT,
|
|
957
916
|
request_options: typing.Optional[RequestOptions] = None,
|
|
958
917
|
) -> Run:
|
|
959
918
|
"""
|
|
960
|
-
Asynchronously process a user message and return a
|
|
961
|
-
The actual processing happens in the background, and the status can be checked using the
|
|
919
|
+
Asynchronously process a user message and return a run object.
|
|
920
|
+
The actual processing happens in the background, and the status can be checked using the run ID.
|
|
962
921
|
|
|
963
922
|
Parameters
|
|
964
923
|
----------
|
|
@@ -967,14 +926,8 @@ class AsyncMessagesClient:
|
|
|
967
926
|
messages : typing.Sequence[MessageCreate]
|
|
968
927
|
The messages to be sent to the agent.
|
|
969
928
|
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
assistant_message_tool_name : typing.Optional[str]
|
|
974
|
-
The name of the designated message tool.
|
|
975
|
-
|
|
976
|
-
assistant_message_tool_kwarg : typing.Optional[str]
|
|
977
|
-
The name of the message argument in the designated message tool.
|
|
929
|
+
config : typing.Optional[LettaRequestConfig]
|
|
930
|
+
Configuration options for the LettaRequest.
|
|
978
931
|
|
|
979
932
|
request_options : typing.Optional[RequestOptions]
|
|
980
933
|
Request-specific configuration.
|
|
@@ -1016,9 +969,9 @@ class AsyncMessagesClient:
|
|
|
1016
969
|
"messages": convert_and_respect_annotation_metadata(
|
|
1017
970
|
object_=messages, annotation=typing.Sequence[MessageCreate], direction="write"
|
|
1018
971
|
),
|
|
1019
|
-
"
|
|
1020
|
-
|
|
1021
|
-
|
|
972
|
+
"config": convert_and_respect_annotation_metadata(
|
|
973
|
+
object_=config, annotation=LettaRequestConfig, direction="write"
|
|
974
|
+
),
|
|
1022
975
|
},
|
|
1023
976
|
request_options=request_options,
|
|
1024
977
|
omit=OMIT,
|
letta_client/client.py
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
from textwrap import dedent
|
|
2
1
|
import inspect
|
|
3
2
|
import typing
|
|
3
|
+
from textwrap import dedent
|
|
4
4
|
|
|
5
|
-
from .base_client import
|
|
5
|
+
from .base_client import AsyncLettaBase, LettaBase
|
|
6
6
|
from .core.request_options import RequestOptions
|
|
7
7
|
from .tools.client import ToolsClient as ToolsClientBase
|
|
8
8
|
from .types.letta_schemas_tool_tool import LettaSchemasToolTool
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
# this is used as the default value for optional parameters
|
|
12
11
|
OMIT = typing.cast(typing.Any, ...)
|
|
13
12
|
|
|
@@ -16,14 +15,14 @@ class Letta(LettaBase):
|
|
|
16
15
|
|
|
17
16
|
def __init__(self, *args, **kwargs):
|
|
18
17
|
super().__init__(*args, **kwargs)
|
|
19
|
-
self.tools =
|
|
18
|
+
self.tools = ToolsClient(client_wrapper=self._client_wrapper)
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
class AsyncLetta(AsyncLettaBase):
|
|
23
22
|
|
|
24
23
|
def __init__(self, *args, **kwargs):
|
|
25
24
|
super().__init__(*args, **kwargs)
|
|
26
|
-
self.tools =
|
|
25
|
+
self.tools = ToolsClient(client_wrapper=self._client_wrapper)
|
|
27
26
|
|
|
28
27
|
|
|
29
28
|
class ToolsClient(ToolsClientBase):
|
|
@@ -31,7 +30,7 @@ class ToolsClient(ToolsClientBase):
|
|
|
31
30
|
def create_from_function(
|
|
32
31
|
self,
|
|
33
32
|
*,
|
|
34
|
-
|
|
33
|
+
func: typing.Callable,
|
|
35
34
|
name: typing.Optional[str] = OMIT,
|
|
36
35
|
description: typing.Optional[str] = OMIT,
|
|
37
36
|
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
@@ -42,7 +41,7 @@ class ToolsClient(ToolsClientBase):
|
|
|
42
41
|
return_char_limit: typing.Optional[int] = OMIT,
|
|
43
42
|
request_options: typing.Optional[RequestOptions] = None,
|
|
44
43
|
) -> LettaSchemasToolTool:
|
|
45
|
-
source_code = dedent(inspect.getsource(
|
|
44
|
+
source_code = dedent(inspect.getsource(func))
|
|
46
45
|
return self.create(
|
|
47
46
|
source_code=source_code,
|
|
48
47
|
name=name,
|
|
@@ -53,3 +52,29 @@ class ToolsClient(ToolsClientBase):
|
|
|
53
52
|
return_char_limit=return_char_limit,
|
|
54
53
|
request_options=request_options,
|
|
55
54
|
)
|
|
55
|
+
|
|
56
|
+
def upsert_from_function(
|
|
57
|
+
self,
|
|
58
|
+
*,
|
|
59
|
+
func: typing.Callable,
|
|
60
|
+
name: typing.Optional[str] = OMIT,
|
|
61
|
+
description: typing.Optional[str] = OMIT,
|
|
62
|
+
tags: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
63
|
+
source_type: typing.Optional[str] = OMIT,
|
|
64
|
+
json_schema: typing.Optional[
|
|
65
|
+
typing.Dict[str, typing.Optional[typing.Any]]
|
|
66
|
+
] = OMIT,
|
|
67
|
+
return_char_limit: typing.Optional[int] = OMIT,
|
|
68
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
69
|
+
) -> LettaSchemasToolTool:
|
|
70
|
+
source_code = dedent(inspect.getsource(func))
|
|
71
|
+
return self.upsert(
|
|
72
|
+
source_code=source_code,
|
|
73
|
+
name=name,
|
|
74
|
+
description=description,
|
|
75
|
+
tags=tags,
|
|
76
|
+
source_type=source_type,
|
|
77
|
+
json_schema=json_schema,
|
|
78
|
+
return_char_limit=return_char_limit,
|
|
79
|
+
request_options=request_options,
|
|
80
|
+
)
|
|
@@ -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.15",
|
|
20
20
|
}
|
|
21
21
|
if self.token is not None:
|
|
22
22
|
headers["Authorization"] = f"Bearer {self.token}"
|
letta_client/runs/__init__.py
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
+
from .types import (
|
|
4
|
+
GetRunMessagesResponseItem,
|
|
5
|
+
GetRunMessagesResponseItem_AssistantMessage,
|
|
6
|
+
GetRunMessagesResponseItem_ReasoningMessage,
|
|
7
|
+
GetRunMessagesResponseItem_SystemMessage,
|
|
8
|
+
GetRunMessagesResponseItem_ToolCallMessage,
|
|
9
|
+
GetRunMessagesResponseItem_ToolReturnMessage,
|
|
10
|
+
GetRunMessagesResponseItem_UserMessage,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"GetRunMessagesResponseItem",
|
|
15
|
+
"GetRunMessagesResponseItem_AssistantMessage",
|
|
16
|
+
"GetRunMessagesResponseItem_ReasoningMessage",
|
|
17
|
+
"GetRunMessagesResponseItem_SystemMessage",
|
|
18
|
+
"GetRunMessagesResponseItem_ToolCallMessage",
|
|
19
|
+
"GetRunMessagesResponseItem_ToolReturnMessage",
|
|
20
|
+
"GetRunMessagesResponseItem_UserMessage",
|
|
21
|
+
]
|
letta_client/runs/client.py
CHANGED
|
@@ -10,10 +10,8 @@ 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
|
-
import datetime as dt
|
|
14
13
|
from ..types.message_role import MessageRole
|
|
15
|
-
from
|
|
16
|
-
from ..core.datetime_utils import serialize_datetime
|
|
14
|
+
from .types.get_run_messages_response_item import GetRunMessagesResponseItem
|
|
17
15
|
from ..types.usage_statistics import UsageStatistics
|
|
18
16
|
from ..core.client_wrapper import AsyncClientWrapper
|
|
19
17
|
|
|
@@ -243,34 +241,26 @@ class RunsClient:
|
|
|
243
241
|
run_id: str,
|
|
244
242
|
*,
|
|
245
243
|
cursor: typing.Optional[str] = None,
|
|
246
|
-
start_date: typing.Optional[dt.datetime] = None,
|
|
247
|
-
end_date: typing.Optional[dt.datetime] = None,
|
|
248
244
|
limit: typing.Optional[int] = None,
|
|
249
|
-
query_text: typing.Optional[str] = None,
|
|
250
245
|
ascending: typing.Optional[bool] = None,
|
|
251
|
-
tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
252
|
-
match_all_tags: typing.Optional[bool] = None,
|
|
253
246
|
role: typing.Optional[MessageRole] = None,
|
|
254
|
-
tool_name: typing.Optional[str] = None,
|
|
255
247
|
request_options: typing.Optional[RequestOptions] = None,
|
|
256
|
-
) -> typing.List[
|
|
248
|
+
) -> typing.List[GetRunMessagesResponseItem]:
|
|
257
249
|
"""
|
|
258
250
|
Get messages associated with a run with filtering options.
|
|
259
251
|
|
|
260
252
|
Args:
|
|
261
253
|
run_id: ID of the run
|
|
262
254
|
cursor: Cursor for pagination
|
|
263
|
-
start_date: Filter messages after this date
|
|
264
|
-
end_date: Filter messages before this date
|
|
265
255
|
limit: Maximum number of messages to return
|
|
266
|
-
query_text: Search text in message content
|
|
267
256
|
ascending: Sort order by creation time
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
role: Filter by message role (user/assistant/system/tool)
|
|
271
|
-
tool_name: Filter by tool call name
|
|
257
|
+
role: Filter by role (user/assistant/system/tool)
|
|
258
|
+
return_message_object: Whether to return Message objects or LettaMessage objects
|
|
272
259
|
user_id: ID of the user making the request
|
|
273
260
|
|
|
261
|
+
Returns:
|
|
262
|
+
A list of messages associated with the run. Default is List[LettaMessage].
|
|
263
|
+
|
|
274
264
|
Parameters
|
|
275
265
|
----------
|
|
276
266
|
run_id : str
|
|
@@ -278,39 +268,21 @@ class RunsClient:
|
|
|
278
268
|
cursor : typing.Optional[str]
|
|
279
269
|
Cursor for pagination
|
|
280
270
|
|
|
281
|
-
start_date : typing.Optional[dt.datetime]
|
|
282
|
-
Filter messages after this date
|
|
283
|
-
|
|
284
|
-
end_date : typing.Optional[dt.datetime]
|
|
285
|
-
Filter messages before this date
|
|
286
|
-
|
|
287
271
|
limit : typing.Optional[int]
|
|
288
272
|
Maximum number of messages to return
|
|
289
273
|
|
|
290
|
-
query_text : typing.Optional[str]
|
|
291
|
-
Search text in message content
|
|
292
|
-
|
|
293
274
|
ascending : typing.Optional[bool]
|
|
294
275
|
Sort order by creation time
|
|
295
276
|
|
|
296
|
-
tags : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
297
|
-
Filter by message tags
|
|
298
|
-
|
|
299
|
-
match_all_tags : typing.Optional[bool]
|
|
300
|
-
If true, match all tags. If false, match any tag
|
|
301
|
-
|
|
302
277
|
role : typing.Optional[MessageRole]
|
|
303
|
-
Filter by
|
|
304
|
-
|
|
305
|
-
tool_name : typing.Optional[str]
|
|
306
|
-
Filter by tool call name
|
|
278
|
+
Filter by role
|
|
307
279
|
|
|
308
280
|
request_options : typing.Optional[RequestOptions]
|
|
309
281
|
Request-specific configuration.
|
|
310
282
|
|
|
311
283
|
Returns
|
|
312
284
|
-------
|
|
313
|
-
typing.List[
|
|
285
|
+
typing.List[GetRunMessagesResponseItem]
|
|
314
286
|
Successful Response
|
|
315
287
|
|
|
316
288
|
Examples
|
|
@@ -329,24 +301,18 @@ class RunsClient:
|
|
|
329
301
|
method="GET",
|
|
330
302
|
params={
|
|
331
303
|
"cursor": cursor,
|
|
332
|
-
"start_date": serialize_datetime(start_date) if start_date is not None else None,
|
|
333
|
-
"end_date": serialize_datetime(end_date) if end_date is not None else None,
|
|
334
304
|
"limit": limit,
|
|
335
|
-
"query_text": query_text,
|
|
336
305
|
"ascending": ascending,
|
|
337
|
-
"tags": tags,
|
|
338
|
-
"match_all_tags": match_all_tags,
|
|
339
306
|
"role": role,
|
|
340
|
-
"tool_name": tool_name,
|
|
341
307
|
},
|
|
342
308
|
request_options=request_options,
|
|
343
309
|
)
|
|
344
310
|
try:
|
|
345
311
|
if 200 <= _response.status_code < 300:
|
|
346
312
|
return typing.cast(
|
|
347
|
-
typing.List[
|
|
313
|
+
typing.List[GetRunMessagesResponseItem],
|
|
348
314
|
construct_type(
|
|
349
|
-
type_=typing.List[
|
|
315
|
+
type_=typing.List[GetRunMessagesResponseItem], # type: ignore
|
|
350
316
|
object_=_response.json(),
|
|
351
317
|
),
|
|
352
318
|
)
|
|
@@ -679,34 +645,26 @@ class AsyncRunsClient:
|
|
|
679
645
|
run_id: str,
|
|
680
646
|
*,
|
|
681
647
|
cursor: typing.Optional[str] = None,
|
|
682
|
-
start_date: typing.Optional[dt.datetime] = None,
|
|
683
|
-
end_date: typing.Optional[dt.datetime] = None,
|
|
684
648
|
limit: typing.Optional[int] = None,
|
|
685
|
-
query_text: typing.Optional[str] = None,
|
|
686
649
|
ascending: typing.Optional[bool] = None,
|
|
687
|
-
tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
688
|
-
match_all_tags: typing.Optional[bool] = None,
|
|
689
650
|
role: typing.Optional[MessageRole] = None,
|
|
690
|
-
tool_name: typing.Optional[str] = None,
|
|
691
651
|
request_options: typing.Optional[RequestOptions] = None,
|
|
692
|
-
) -> typing.List[
|
|
652
|
+
) -> typing.List[GetRunMessagesResponseItem]:
|
|
693
653
|
"""
|
|
694
654
|
Get messages associated with a run with filtering options.
|
|
695
655
|
|
|
696
656
|
Args:
|
|
697
657
|
run_id: ID of the run
|
|
698
658
|
cursor: Cursor for pagination
|
|
699
|
-
start_date: Filter messages after this date
|
|
700
|
-
end_date: Filter messages before this date
|
|
701
659
|
limit: Maximum number of messages to return
|
|
702
|
-
query_text: Search text in message content
|
|
703
660
|
ascending: Sort order by creation time
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
role: Filter by message role (user/assistant/system/tool)
|
|
707
|
-
tool_name: Filter by tool call name
|
|
661
|
+
role: Filter by role (user/assistant/system/tool)
|
|
662
|
+
return_message_object: Whether to return Message objects or LettaMessage objects
|
|
708
663
|
user_id: ID of the user making the request
|
|
709
664
|
|
|
665
|
+
Returns:
|
|
666
|
+
A list of messages associated with the run. Default is List[LettaMessage].
|
|
667
|
+
|
|
710
668
|
Parameters
|
|
711
669
|
----------
|
|
712
670
|
run_id : str
|
|
@@ -714,39 +672,21 @@ class AsyncRunsClient:
|
|
|
714
672
|
cursor : typing.Optional[str]
|
|
715
673
|
Cursor for pagination
|
|
716
674
|
|
|
717
|
-
start_date : typing.Optional[dt.datetime]
|
|
718
|
-
Filter messages after this date
|
|
719
|
-
|
|
720
|
-
end_date : typing.Optional[dt.datetime]
|
|
721
|
-
Filter messages before this date
|
|
722
|
-
|
|
723
675
|
limit : typing.Optional[int]
|
|
724
676
|
Maximum number of messages to return
|
|
725
677
|
|
|
726
|
-
query_text : typing.Optional[str]
|
|
727
|
-
Search text in message content
|
|
728
|
-
|
|
729
678
|
ascending : typing.Optional[bool]
|
|
730
679
|
Sort order by creation time
|
|
731
680
|
|
|
732
|
-
tags : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
733
|
-
Filter by message tags
|
|
734
|
-
|
|
735
|
-
match_all_tags : typing.Optional[bool]
|
|
736
|
-
If true, match all tags. If false, match any tag
|
|
737
|
-
|
|
738
681
|
role : typing.Optional[MessageRole]
|
|
739
|
-
Filter by
|
|
740
|
-
|
|
741
|
-
tool_name : typing.Optional[str]
|
|
742
|
-
Filter by tool call name
|
|
682
|
+
Filter by role
|
|
743
683
|
|
|
744
684
|
request_options : typing.Optional[RequestOptions]
|
|
745
685
|
Request-specific configuration.
|
|
746
686
|
|
|
747
687
|
Returns
|
|
748
688
|
-------
|
|
749
|
-
typing.List[
|
|
689
|
+
typing.List[GetRunMessagesResponseItem]
|
|
750
690
|
Successful Response
|
|
751
691
|
|
|
752
692
|
Examples
|
|
@@ -773,24 +713,18 @@ class AsyncRunsClient:
|
|
|
773
713
|
method="GET",
|
|
774
714
|
params={
|
|
775
715
|
"cursor": cursor,
|
|
776
|
-
"start_date": serialize_datetime(start_date) if start_date is not None else None,
|
|
777
|
-
"end_date": serialize_datetime(end_date) if end_date is not None else None,
|
|
778
716
|
"limit": limit,
|
|
779
|
-
"query_text": query_text,
|
|
780
717
|
"ascending": ascending,
|
|
781
|
-
"tags": tags,
|
|
782
|
-
"match_all_tags": match_all_tags,
|
|
783
718
|
"role": role,
|
|
784
|
-
"tool_name": tool_name,
|
|
785
719
|
},
|
|
786
720
|
request_options=request_options,
|
|
787
721
|
)
|
|
788
722
|
try:
|
|
789
723
|
if 200 <= _response.status_code < 300:
|
|
790
724
|
return typing.cast(
|
|
791
|
-
typing.List[
|
|
725
|
+
typing.List[GetRunMessagesResponseItem],
|
|
792
726
|
construct_type(
|
|
793
|
-
type_=typing.List[
|
|
727
|
+
type_=typing.List[GetRunMessagesResponseItem], # type: ignore
|
|
794
728
|
object_=_response.json(),
|
|
795
729
|
),
|
|
796
730
|
)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from .get_run_messages_response_item import (
|
|
4
|
+
GetRunMessagesResponseItem,
|
|
5
|
+
GetRunMessagesResponseItem_AssistantMessage,
|
|
6
|
+
GetRunMessagesResponseItem_ReasoningMessage,
|
|
7
|
+
GetRunMessagesResponseItem_SystemMessage,
|
|
8
|
+
GetRunMessagesResponseItem_ToolCallMessage,
|
|
9
|
+
GetRunMessagesResponseItem_ToolReturnMessage,
|
|
10
|
+
GetRunMessagesResponseItem_UserMessage,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"GetRunMessagesResponseItem",
|
|
15
|
+
"GetRunMessagesResponseItem_AssistantMessage",
|
|
16
|
+
"GetRunMessagesResponseItem_ReasoningMessage",
|
|
17
|
+
"GetRunMessagesResponseItem_SystemMessage",
|
|
18
|
+
"GetRunMessagesResponseItem_ToolCallMessage",
|
|
19
|
+
"GetRunMessagesResponseItem_ToolReturnMessage",
|
|
20
|
+
"GetRunMessagesResponseItem_UserMessage",
|
|
21
|
+
]
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
5
|
+
import typing
|
|
6
|
+
import datetime as dt
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
import pydantic
|
|
9
|
+
from ...types.tool_call_message_tool_call import ToolCallMessageToolCall
|
|
10
|
+
from ...types.tool_return_message_status import ToolReturnMessageStatus
|
|
11
|
+
import typing_extensions
|
|
12
|
+
from ...core.unchecked_base_model import UnionMetadata
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class GetRunMessagesResponseItem_SystemMessage(UncheckedBaseModel):
|
|
16
|
+
message_type: typing.Literal["system_message"] = "system_message"
|
|
17
|
+
id: str
|
|
18
|
+
date: dt.datetime
|
|
19
|
+
message: str
|
|
20
|
+
|
|
21
|
+
if IS_PYDANTIC_V2:
|
|
22
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
23
|
+
else:
|
|
24
|
+
|
|
25
|
+
class Config:
|
|
26
|
+
frozen = True
|
|
27
|
+
smart_union = True
|
|
28
|
+
extra = pydantic.Extra.allow
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class GetRunMessagesResponseItem_UserMessage(UncheckedBaseModel):
|
|
32
|
+
message_type: typing.Literal["user_message"] = "user_message"
|
|
33
|
+
id: str
|
|
34
|
+
date: dt.datetime
|
|
35
|
+
message: str
|
|
36
|
+
|
|
37
|
+
if IS_PYDANTIC_V2:
|
|
38
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
39
|
+
else:
|
|
40
|
+
|
|
41
|
+
class Config:
|
|
42
|
+
frozen = True
|
|
43
|
+
smart_union = True
|
|
44
|
+
extra = pydantic.Extra.allow
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class GetRunMessagesResponseItem_ReasoningMessage(UncheckedBaseModel):
|
|
48
|
+
message_type: typing.Literal["reasoning_message"] = "reasoning_message"
|
|
49
|
+
id: str
|
|
50
|
+
date: dt.datetime
|
|
51
|
+
reasoning: str
|
|
52
|
+
|
|
53
|
+
if IS_PYDANTIC_V2:
|
|
54
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
55
|
+
else:
|
|
56
|
+
|
|
57
|
+
class Config:
|
|
58
|
+
frozen = True
|
|
59
|
+
smart_union = True
|
|
60
|
+
extra = pydantic.Extra.allow
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class GetRunMessagesResponseItem_ToolCallMessage(UncheckedBaseModel):
|
|
64
|
+
message_type: typing.Literal["tool_call_message"] = "tool_call_message"
|
|
65
|
+
id: str
|
|
66
|
+
date: dt.datetime
|
|
67
|
+
tool_call: ToolCallMessageToolCall
|
|
68
|
+
|
|
69
|
+
if IS_PYDANTIC_V2:
|
|
70
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
71
|
+
else:
|
|
72
|
+
|
|
73
|
+
class Config:
|
|
74
|
+
frozen = True
|
|
75
|
+
smart_union = True
|
|
76
|
+
extra = pydantic.Extra.allow
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class GetRunMessagesResponseItem_ToolReturnMessage(UncheckedBaseModel):
|
|
80
|
+
message_type: typing.Literal["tool_return_message"] = "tool_return_message"
|
|
81
|
+
id: str
|
|
82
|
+
date: dt.datetime
|
|
83
|
+
tool_return: str
|
|
84
|
+
status: ToolReturnMessageStatus
|
|
85
|
+
tool_call_id: str
|
|
86
|
+
stdout: typing.Optional[typing.List[str]] = None
|
|
87
|
+
stderr: typing.Optional[typing.List[str]] = None
|
|
88
|
+
|
|
89
|
+
if IS_PYDANTIC_V2:
|
|
90
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
91
|
+
else:
|
|
92
|
+
|
|
93
|
+
class Config:
|
|
94
|
+
frozen = True
|
|
95
|
+
smart_union = True
|
|
96
|
+
extra = pydantic.Extra.allow
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class GetRunMessagesResponseItem_AssistantMessage(UncheckedBaseModel):
|
|
100
|
+
message_type: typing.Literal["assistant_message"] = "assistant_message"
|
|
101
|
+
id: str
|
|
102
|
+
date: dt.datetime
|
|
103
|
+
assistant_message: str
|
|
104
|
+
|
|
105
|
+
if IS_PYDANTIC_V2:
|
|
106
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
107
|
+
else:
|
|
108
|
+
|
|
109
|
+
class Config:
|
|
110
|
+
frozen = True
|
|
111
|
+
smart_union = True
|
|
112
|
+
extra = pydantic.Extra.allow
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
GetRunMessagesResponseItem = typing_extensions.Annotated[
|
|
116
|
+
typing.Union[
|
|
117
|
+
GetRunMessagesResponseItem_SystemMessage,
|
|
118
|
+
GetRunMessagesResponseItem_UserMessage,
|
|
119
|
+
GetRunMessagesResponseItem_ReasoningMessage,
|
|
120
|
+
GetRunMessagesResponseItem_ToolCallMessage,
|
|
121
|
+
GetRunMessagesResponseItem_ToolReturnMessage,
|
|
122
|
+
GetRunMessagesResponseItem_AssistantMessage,
|
|
123
|
+
],
|
|
124
|
+
UnionMetadata(discriminant="message_type"),
|
|
125
|
+
]
|
letta_client/types/__init__.py
CHANGED
|
@@ -50,6 +50,7 @@ from .job import Job
|
|
|
50
50
|
from .job_status import JobStatus
|
|
51
51
|
from .job_type import JobType
|
|
52
52
|
from .letta_request import LettaRequest
|
|
53
|
+
from .letta_request_config import LettaRequestConfig
|
|
53
54
|
from .letta_response import LettaResponse
|
|
54
55
|
from .letta_response_messages_item import (
|
|
55
56
|
LettaResponseMessagesItem,
|
|
@@ -180,6 +181,7 @@ __all__ = [
|
|
|
180
181
|
"JobStatus",
|
|
181
182
|
"JobType",
|
|
182
183
|
"LettaRequest",
|
|
184
|
+
"LettaRequestConfig",
|
|
183
185
|
"LettaResponse",
|
|
184
186
|
"LettaResponseMessagesItem",
|
|
185
187
|
"LettaResponseMessagesItem_AssistantMessage",
|
|
@@ -4,6 +4,7 @@ from ..core.unchecked_base_model import UncheckedBaseModel
|
|
|
4
4
|
import typing
|
|
5
5
|
from .message_create import MessageCreate
|
|
6
6
|
import pydantic
|
|
7
|
+
from .letta_request_config import LettaRequestConfig
|
|
7
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
9
|
|
|
9
10
|
|
|
@@ -13,19 +14,9 @@ class LettaRequest(UncheckedBaseModel):
|
|
|
13
14
|
The messages to be sent to the agent.
|
|
14
15
|
"""
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
config: typing.Optional[LettaRequestConfig] = pydantic.Field(default=None)
|
|
17
18
|
"""
|
|
18
|
-
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
assistant_message_tool_name: typing.Optional[str] = pydantic.Field(default=None)
|
|
22
|
-
"""
|
|
23
|
-
The name of the designated message tool.
|
|
24
|
-
"""
|
|
25
|
-
|
|
26
|
-
assistant_message_tool_kwarg: typing.Optional[str] = pydantic.Field(default=None)
|
|
27
|
-
"""
|
|
28
|
-
The name of the message argument in the designated message tool.
|
|
19
|
+
Configuration options for the LettaRequest.
|
|
29
20
|
"""
|
|
30
21
|
|
|
31
22
|
if IS_PYDANTIC_V2:
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
import pydantic
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class LettaRequestConfig(UncheckedBaseModel):
|
|
10
|
+
use_assistant_message: typing.Optional[bool] = pydantic.Field(default=None)
|
|
11
|
+
"""
|
|
12
|
+
Whether the server should parse specific tool call arguments (default `send_message`) as `AssistantMessage` objects.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
assistant_message_tool_name: typing.Optional[str] = pydantic.Field(default=None)
|
|
16
|
+
"""
|
|
17
|
+
The name of the designated message tool.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
assistant_message_tool_kwarg: typing.Optional[str] = pydantic.Field(default=None)
|
|
21
|
+
"""
|
|
22
|
+
The name of the message argument in the designated message tool.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
if IS_PYDANTIC_V2:
|
|
26
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
27
|
+
else:
|
|
28
|
+
|
|
29
|
+
class Config:
|
|
30
|
+
frozen = True
|
|
31
|
+
smart_union = True
|
|
32
|
+
extra = pydantic.Extra.allow
|
letta_client/types/run.py
CHANGED
|
@@ -8,6 +8,7 @@ from .job_status import JobStatus
|
|
|
8
8
|
import typing_extensions
|
|
9
9
|
from ..core.serialization import FieldMetadata
|
|
10
10
|
from .job_type import JobType
|
|
11
|
+
from .letta_request_config import LettaRequestConfig
|
|
11
12
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
12
13
|
|
|
13
14
|
|
|
@@ -67,6 +68,11 @@ class Run(UncheckedBaseModel):
|
|
|
67
68
|
The human-friendly ID of the Run
|
|
68
69
|
"""
|
|
69
70
|
|
|
71
|
+
request_config: typing.Optional[LettaRequestConfig] = pydantic.Field(default=None)
|
|
72
|
+
"""
|
|
73
|
+
The request configuration for the run.
|
|
74
|
+
"""
|
|
75
|
+
|
|
70
76
|
if IS_PYDANTIC_V2:
|
|
71
77
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
72
78
|
else:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
letta_client/__init__.py,sha256=
|
|
1
|
+
letta_client/__init__.py,sha256=qW0UVZL1U15ATdZtnc-XMKp-XrCbMrzU_XyaI-ncZyI,9406
|
|
2
2
|
letta_client/agents/__init__.py,sha256=D_1CWRp_6mF3CUCE-6Jx8QAZVldpgrC_uK_UTLExVDI,3236
|
|
3
3
|
letta_client/agents/archival_memory/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
4
4
|
letta_client/agents/archival_memory/client.py,sha256=8A4GM52LAmZK7v2XJzfWR_PK99E_xcXTYhZMPsK7Uvc,18889
|
|
5
|
-
letta_client/agents/client.py,sha256=
|
|
5
|
+
letta_client/agents/client.py,sha256=a9FigX5mPVmWtMxE-ytAKXwLM6gET6oFXmAltKIB-oI,54076
|
|
6
6
|
letta_client/agents/context/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
7
7
|
letta_client/agents/context/client.py,sha256=s9dQA3yJo8KVSinnZz0Mv0GWs0tEqoSH5HgdTTD_klc,4781
|
|
8
8
|
letta_client/agents/core_memory/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
@@ -12,7 +12,7 @@ letta_client/agents/memory_variables/client.py,sha256=W33u5yKUIn-Njhqgyogvjnh-Zv
|
|
|
12
12
|
letta_client/agents/memory_variables/types/__init__.py,sha256=F97IDCgZgUMB04F4EFK8_sEiHIaSxeY3uZFOKWjIu7s,177
|
|
13
13
|
letta_client/agents/memory_variables/types/memory_variables_get_response.py,sha256=rc-8h_zEPBmHCjJlEPNoz8enpNcmKkrJz1pbSRQmJy4,598
|
|
14
14
|
letta_client/agents/messages/__init__.py,sha256=tC_dJ9IufEAf3pTt6OgyM327usiMylcJ78Ey74uYh-8,1463
|
|
15
|
-
letta_client/agents/messages/client.py,sha256=
|
|
15
|
+
letta_client/agents/messages/client.py,sha256=D7KMv-QOIg_xCFC1u1iUPD_9usVdoPp6l-PArS6wKCU,34661
|
|
16
16
|
letta_client/agents/messages/types/__init__.py,sha256=rByVgqeD_Mvobim65FT1nYgwwLy1OZzKKG2kKnw9JxI,1558
|
|
17
17
|
letta_client/agents/messages/types/letta_streaming_response.py,sha256=wy__JtXiybvfOjsjMq5ZSnTJt9A5x_nALgCqq32Dd_A,4707
|
|
18
18
|
letta_client/agents/messages/types/messages_list_response.py,sha256=QOQ-lDPwafhCjFbq-qz0hUrNw4vneGrqePY42-yiTW8,341
|
|
@@ -42,10 +42,10 @@ letta_client/agents/types/update_agent_tool_rules_item.py,sha256=5pYbFgeqxmXUHUT
|
|
|
42
42
|
letta_client/base_client.py,sha256=OapnOZBD94aLQa5uoPCbNIR4zDg55DVI5zBe-wWHYfs,7419
|
|
43
43
|
letta_client/blocks/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
44
44
|
letta_client/blocks/client.py,sha256=-4_DMOmUdzPxCqmOYJv3O9Yrf3ZG-gpzyciTe9qbI7k,32517
|
|
45
|
-
letta_client/client.py,sha256=
|
|
45
|
+
letta_client/client.py,sha256=a5YTj-G-1W4JXvxggyTU1riqiKJ-ga0iZ4VYP15b1A4,2656
|
|
46
46
|
letta_client/core/__init__.py,sha256=OKbX2aCZXgHCDUsCouqv-OiX32xA6eFFCKIUH9M5Vzk,1591
|
|
47
47
|
letta_client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
|
48
|
-
letta_client/core/client_wrapper.py,sha256=
|
|
48
|
+
letta_client/core/client_wrapper.py,sha256=p1GNRWP7V9dl-CD2p_0GzWsj_Kj6hyKJ0S0dCScmobU,1997
|
|
49
49
|
letta_client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
|
50
50
|
letta_client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
|
51
51
|
letta_client/core/http_client.py,sha256=siUQ6UV0ARZALlxubqWSSAAPC9B4VW8y6MGlHStfaeo,19552
|
|
@@ -71,8 +71,10 @@ letta_client/models/client.py,sha256=Rd9IHjSdXRzzZyabpq8pDTc9XDnwLPnmm5by335g1D0
|
|
|
71
71
|
letta_client/providers/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
72
72
|
letta_client/providers/client.py,sha256=MPab7qz_kqoonzXdR3oKlhYqGNLAH1ydq8Abv0WthfA,18232
|
|
73
73
|
letta_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
|
-
letta_client/runs/__init__.py,sha256
|
|
75
|
-
letta_client/runs/client.py,sha256=
|
|
74
|
+
letta_client/runs/__init__.py,sha256=-qrhu_dqvlWYxdkN01ldqGYgid9GHnY-sZ_jmK99BOE,753
|
|
75
|
+
letta_client/runs/client.py,sha256=4w4Pbv2EUq-yAenr_aLG5CITtfx8kpdqoPPsT4txUY8,25685
|
|
76
|
+
letta_client/runs/types/__init__.py,sha256=NtzmO_SLLlr4510ajC14ou1eqEGlA8nkYZFeRWbjnd8,778
|
|
77
|
+
letta_client/runs/types/get_run_messages_response_item.py,sha256=RAU7L6yCk9rMYXEtulEwesrsodWt1f1eCWEaKzcZMYM,4082
|
|
76
78
|
letta_client/sources/__init__.py,sha256=kswgCv4UdkSVk1Y4tsMM1HadOwvhh_Fr96VTSMV4Umc,128
|
|
77
79
|
letta_client/sources/client.py,sha256=fpf8nq6ahmuqSF5Pl5vxnczamWAmh6sVSbUkAmXA4BE,36643
|
|
78
80
|
letta_client/sources/files/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
@@ -83,7 +85,7 @@ letta_client/tag/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,
|
|
|
83
85
|
letta_client/tag/client.py,sha256=zAy0hjEOVNZV3QAd9iiVuapAXQNCi0wKvZ_wvqj0TmI,5191
|
|
84
86
|
letta_client/tools/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
85
87
|
letta_client/tools/client.py,sha256=dh8uX3tNFbKjgvd2TUwP0KTj4THksnFxnZmEit7tOY4,58734
|
|
86
|
-
letta_client/types/__init__.py,sha256=
|
|
88
|
+
letta_client/types/__init__.py,sha256=xto8gqGc_wvD3zzRL8i0G2o2hE3zzI75xVO6isk16aQ,10435
|
|
87
89
|
letta_client/types/action_model.py,sha256=65eLvLD-9-zK9hrDun7wjVlXsCiI7zujv8aGPuIb3jE,1206
|
|
88
90
|
letta_client/types/action_parameters_model.py,sha256=zKzJkjtu1pt4BEA2GHlg9rMWja5a0uZygOpOx3FbgIM,749
|
|
89
91
|
letta_client/types/action_response_model.py,sha256=5OuImT0EQFkAnc81F6tZsVEwYG8rKbIrx_ydGiKqwog,745
|
|
@@ -133,7 +135,8 @@ letta_client/types/internal_server_error_body.py,sha256=xR9n1zptgmImbH6apQAuwBbl
|
|
|
133
135
|
letta_client/types/job.py,sha256=JEXfmTDxmHoEUxKQ8GH2yMUGbD7HfIeCdzUelMb3wsI,2470
|
|
134
136
|
letta_client/types/job_status.py,sha256=0Gu5Tku79SDVzCxnjVXQyDPNCizGWUP1ppohAck6a2U,189
|
|
135
137
|
letta_client/types/job_type.py,sha256=Roa04Ry0I-8YMYcDHiHSQwqBavZyPonzkZtjf098e-Q,145
|
|
136
|
-
letta_client/types/letta_request.py,sha256=
|
|
138
|
+
letta_client/types/letta_request.py,sha256=Xps139s6e0fc7HWi0YJHFz51AfY3iDAB9kh-yBa4e38,900
|
|
139
|
+
letta_client/types/letta_request_config.py,sha256=b6K4QtDdHjcZKfBb1fugUuoPrT2N4d5TTB0PIRNI2SU,1085
|
|
137
140
|
letta_client/types/letta_response.py,sha256=Kf_isXIlqDj2ujhy1j5ILatdgR0ZEpg2XIGU1F8-2uU,1340
|
|
138
141
|
letta_client/types/letta_response_messages_item.py,sha256=8Rgye6ZhLkCel6sCYHcYOvQoqM4A4uwPuEapxL4qqJY,4050
|
|
139
142
|
letta_client/types/letta_schemas_letta_message_tool_call.py,sha256=KrRbLhWx8uVpZIpt1nuVIIBemjFnQufPR1vm6NlMMM4,618
|
|
@@ -167,7 +170,7 @@ letta_client/types/provider.py,sha256=RvdE9dzGFJ4hcmyvk2xeO7RNpxQvXhB_S9DNy8t_z-
|
|
|
167
170
|
letta_client/types/reasoning_message.py,sha256=kCoRIXdsCjj48jDaZKuxIXqxwnlLYGR3qAAumeQIA-M,882
|
|
168
171
|
letta_client/types/recall_memory_summary.py,sha256=aHLAjDWxs6tLFJVtF4CUiS6IiP0bWFcIDNC0J5njJtY,635
|
|
169
172
|
letta_client/types/response_format.py,sha256=Ot93aFi9mH4h6xWuSDzbXu_6nd2_caFqCzG1wd-cAiw,583
|
|
170
|
-
letta_client/types/run.py,sha256=
|
|
173
|
+
letta_client/types/run.py,sha256=MZUXM24ipEHJU4iaGWxHkYVPMI8KCsRe42IihzchEkQ,2654
|
|
171
174
|
letta_client/types/sandbox_config.py,sha256=nvVdB0WnK_-bEHIehvBGiiD0hvujA93Ko4FuGMAJDdk,1550
|
|
172
175
|
letta_client/types/sandbox_config_create.py,sha256=eP3Bg9JsROEQEEXm9zo-AJb5QvinO1fQkbDhNcfAUt0,730
|
|
173
176
|
letta_client/types/sandbox_config_create_config.py,sha256=EsSeN81_yPkorfQgOJmumdCWiUt8hk9HawSsRcCc5Hs,263
|
|
@@ -203,6 +206,6 @@ letta_client/types/user_update.py,sha256=0Bl1OjO7bfmlpsGQ36dSh6DH1UB_wJOTNewS0wD
|
|
|
203
206
|
letta_client/types/validation_error.py,sha256=ACDS7wL5nQbS8ymFhWljwbBJmbugNa8bs2O5xEZC3u4,680
|
|
204
207
|
letta_client/types/validation_error_loc_item.py,sha256=LAtjCHIllWRBFXvAZ5QZpp7CPXjdtN9EB7HrLVo6EP0,128
|
|
205
208
|
letta_client/version.py,sha256=bttKLbIhO3UonCYQlqs600zzbQgfhCCMjeXR9WRzid4,79
|
|
206
|
-
letta_client-0.1.
|
|
207
|
-
letta_client-0.1.
|
|
208
|
-
letta_client-0.1.
|
|
209
|
+
letta_client-0.1.15.dist-info/METADATA,sha256=zmlIAWfTxSHNqXRBYVS34FZBLItqX4R8qCe2jomzqrw,4929
|
|
210
|
+
letta_client-0.1.15.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
|
211
|
+
letta_client-0.1.15.dist-info/RECORD,,
|
|
File without changes
|