letta-client 0.1.164__py3-none-any.whl → 0.1.165__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of letta-client might be problematic. Click here for more details.

letta_client/__init__.py CHANGED
@@ -287,6 +287,7 @@ from .agents import (
287
287
  AgentsSearchRequestSearchItemOperator,
288
288
  AgentsSearchRequestSearchItemTwo,
289
289
  AgentsSearchRequestSearchItemZero,
290
+ AgentsSearchRequestSortBy,
290
291
  AgentsSearchResponse,
291
292
  CreateAgentRequestResponseFormat,
292
293
  CreateAgentRequestToolRulesItem,
@@ -335,6 +336,7 @@ __all__ = [
335
336
  "AgentsSearchRequestSearchItemOperator",
336
337
  "AgentsSearchRequestSearchItemTwo",
337
338
  "AgentsSearchRequestSearchItemZero",
339
+ "AgentsSearchRequestSortBy",
338
340
  "AgentsSearchResponse",
339
341
  "AppAuthScheme",
340
342
  "AppAuthSchemeAuthMode",
@@ -7,6 +7,7 @@ from .types import (
7
7
  AgentsSearchRequestSearchItemOperator,
8
8
  AgentsSearchRequestSearchItemTwo,
9
9
  AgentsSearchRequestSearchItemZero,
10
+ AgentsSearchRequestSortBy,
10
11
  AgentsSearchResponse,
11
12
  CreateAgentRequestResponseFormat,
12
13
  CreateAgentRequestToolRulesItem,
@@ -25,6 +26,7 @@ __all__ = [
25
26
  "AgentsSearchRequestSearchItemOperator",
26
27
  "AgentsSearchRequestSearchItemTwo",
27
28
  "AgentsSearchRequestSearchItemZero",
29
+ "AgentsSearchRequestSortBy",
28
30
  "AgentsSearchResponse",
29
31
  "CreateAgentRequestResponseFormat",
30
32
  "CreateAgentRequestToolRulesItem",
@@ -31,7 +31,9 @@ from ..core.jsonable_encoder import jsonable_encoder
31
31
  from .. import core
32
32
  from .types.update_agent_tool_rules_item import UpdateAgentToolRulesItem
33
33
  from .types.update_agent_response_format import UpdateAgentResponseFormat
34
+ import datetime as dt
34
35
  from .types.agents_search_request_search_item import AgentsSearchRequestSearchItem
36
+ from .types.agents_search_request_sort_by import AgentsSearchRequestSortBy
35
37
  from .types.agents_search_response import AgentsSearchResponse
36
38
  from ..core.client_wrapper import AsyncClientWrapper
37
39
  from .context.client import AsyncContextClient
@@ -80,6 +82,7 @@ class AgentsClient:
80
82
  identifier_keys: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
81
83
  include_relationships: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
82
84
  ascending: typing.Optional[bool] = None,
85
+ sort_by: typing.Optional[str] = None,
83
86
  request_options: typing.Optional[RequestOptions] = None,
84
87
  ) -> typing.List[AgentState]:
85
88
  """
@@ -132,6 +135,9 @@ class AgentsClient:
132
135
  ascending : typing.Optional[bool]
133
136
  Whether to sort agents oldest to newest (True) or newest to oldest (False, default)
134
137
 
138
+ sort_by : typing.Optional[str]
139
+ Field to sort by. Options: 'created_at' (default), 'last_run_completion'
140
+
135
141
  request_options : typing.Optional[RequestOptions]
136
142
  Request-specific configuration.
137
143
 
@@ -167,6 +173,7 @@ class AgentsClient:
167
173
  "identifier_keys": identifier_keys,
168
174
  "include_relationships": include_relationships,
169
175
  "ascending": ascending,
176
+ "sort_by": sort_by,
170
177
  },
171
178
  request_options=request_options,
172
179
  )
@@ -804,6 +811,8 @@ class AgentsClient:
804
811
  embedding: typing.Optional[str] = OMIT,
805
812
  enable_sleeptime: typing.Optional[bool] = OMIT,
806
813
  response_format: typing.Optional[UpdateAgentResponseFormat] = OMIT,
814
+ last_run_completion: typing.Optional[dt.datetime] = OMIT,
815
+ last_run_duration_ms: typing.Optional[int] = OMIT,
807
816
  request_options: typing.Optional[RequestOptions] = None,
808
817
  ) -> AgentState:
809
818
  """
@@ -879,6 +888,12 @@ class AgentsClient:
879
888
  response_format : typing.Optional[UpdateAgentResponseFormat]
880
889
  The response format for the agent.
881
890
 
891
+ last_run_completion : typing.Optional[dt.datetime]
892
+ The timestamp when the agent last completed a run.
893
+
894
+ last_run_duration_ms : typing.Optional[int]
895
+ The duration in milliseconds of the agent's last run.
896
+
882
897
  request_options : typing.Optional[RequestOptions]
883
898
  Request-specific configuration.
884
899
 
@@ -932,6 +947,8 @@ class AgentsClient:
932
947
  "response_format": convert_and_respect_annotation_metadata(
933
948
  object_=response_format, annotation=UpdateAgentResponseFormat, direction="write"
934
949
  ),
950
+ "last_run_completion": last_run_completion,
951
+ "last_run_duration_ms": last_run_duration_ms,
935
952
  },
936
953
  headers={
937
954
  "content-type": "application/json",
@@ -1039,6 +1056,8 @@ class AgentsClient:
1039
1056
  combinator: typing.Optional[typing.Literal["AND"]] = OMIT,
1040
1057
  limit: typing.Optional[float] = OMIT,
1041
1058
  after: typing.Optional[str] = OMIT,
1059
+ sort_by: typing.Optional[AgentsSearchRequestSortBy] = OMIT,
1060
+ ascending: typing.Optional[bool] = OMIT,
1042
1061
  request_options: typing.Optional[RequestOptions] = None,
1043
1062
  ) -> AgentsSearchResponse:
1044
1063
  """
@@ -1058,6 +1077,10 @@ class AgentsClient:
1058
1077
 
1059
1078
  after : typing.Optional[str]
1060
1079
 
1080
+ sort_by : typing.Optional[AgentsSearchRequestSortBy]
1081
+
1082
+ ascending : typing.Optional[bool]
1083
+
1061
1084
  request_options : typing.Optional[RequestOptions]
1062
1085
  Request-specific configuration.
1063
1086
 
@@ -1086,6 +1109,8 @@ class AgentsClient:
1086
1109
  "combinator": combinator,
1087
1110
  "limit": limit,
1088
1111
  "after": after,
1112
+ "sortBy": sort_by,
1113
+ "ascending": ascending,
1089
1114
  },
1090
1115
  headers={
1091
1116
  "content-type": "application/json",
@@ -1139,6 +1164,7 @@ class AsyncAgentsClient:
1139
1164
  identifier_keys: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
1140
1165
  include_relationships: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
1141
1166
  ascending: typing.Optional[bool] = None,
1167
+ sort_by: typing.Optional[str] = None,
1142
1168
  request_options: typing.Optional[RequestOptions] = None,
1143
1169
  ) -> typing.List[AgentState]:
1144
1170
  """
@@ -1191,6 +1217,9 @@ class AsyncAgentsClient:
1191
1217
  ascending : typing.Optional[bool]
1192
1218
  Whether to sort agents oldest to newest (True) or newest to oldest (False, default)
1193
1219
 
1220
+ sort_by : typing.Optional[str]
1221
+ Field to sort by. Options: 'created_at' (default), 'last_run_completion'
1222
+
1194
1223
  request_options : typing.Optional[RequestOptions]
1195
1224
  Request-specific configuration.
1196
1225
 
@@ -1234,6 +1263,7 @@ class AsyncAgentsClient:
1234
1263
  "identifier_keys": identifier_keys,
1235
1264
  "include_relationships": include_relationships,
1236
1265
  "ascending": ascending,
1266
+ "sort_by": sort_by,
1237
1267
  },
1238
1268
  request_options=request_options,
1239
1269
  )
@@ -1919,6 +1949,8 @@ class AsyncAgentsClient:
1919
1949
  embedding: typing.Optional[str] = OMIT,
1920
1950
  enable_sleeptime: typing.Optional[bool] = OMIT,
1921
1951
  response_format: typing.Optional[UpdateAgentResponseFormat] = OMIT,
1952
+ last_run_completion: typing.Optional[dt.datetime] = OMIT,
1953
+ last_run_duration_ms: typing.Optional[int] = OMIT,
1922
1954
  request_options: typing.Optional[RequestOptions] = None,
1923
1955
  ) -> AgentState:
1924
1956
  """
@@ -1994,6 +2026,12 @@ class AsyncAgentsClient:
1994
2026
  response_format : typing.Optional[UpdateAgentResponseFormat]
1995
2027
  The response format for the agent.
1996
2028
 
2029
+ last_run_completion : typing.Optional[dt.datetime]
2030
+ The timestamp when the agent last completed a run.
2031
+
2032
+ last_run_duration_ms : typing.Optional[int]
2033
+ The duration in milliseconds of the agent's last run.
2034
+
1997
2035
  request_options : typing.Optional[RequestOptions]
1998
2036
  Request-specific configuration.
1999
2037
 
@@ -2055,6 +2093,8 @@ class AsyncAgentsClient:
2055
2093
  "response_format": convert_and_respect_annotation_metadata(
2056
2094
  object_=response_format, annotation=UpdateAgentResponseFormat, direction="write"
2057
2095
  ),
2096
+ "last_run_completion": last_run_completion,
2097
+ "last_run_duration_ms": last_run_duration_ms,
2058
2098
  },
2059
2099
  headers={
2060
2100
  "content-type": "application/json",
@@ -2170,6 +2210,8 @@ class AsyncAgentsClient:
2170
2210
  combinator: typing.Optional[typing.Literal["AND"]] = OMIT,
2171
2211
  limit: typing.Optional[float] = OMIT,
2172
2212
  after: typing.Optional[str] = OMIT,
2213
+ sort_by: typing.Optional[AgentsSearchRequestSortBy] = OMIT,
2214
+ ascending: typing.Optional[bool] = OMIT,
2173
2215
  request_options: typing.Optional[RequestOptions] = None,
2174
2216
  ) -> AgentsSearchResponse:
2175
2217
  """
@@ -2189,6 +2231,10 @@ class AsyncAgentsClient:
2189
2231
 
2190
2232
  after : typing.Optional[str]
2191
2233
 
2234
+ sort_by : typing.Optional[AgentsSearchRequestSortBy]
2235
+
2236
+ ascending : typing.Optional[bool]
2237
+
2192
2238
  request_options : typing.Optional[RequestOptions]
2193
2239
  Request-specific configuration.
2194
2240
 
@@ -2225,6 +2271,8 @@ class AsyncAgentsClient:
2225
2271
  "combinator": combinator,
2226
2272
  "limit": limit,
2227
2273
  "after": after,
2274
+ "sortBy": sort_by,
2275
+ "ascending": ascending,
2228
2276
  },
2229
2277
  headers={
2230
2278
  "content-type": "application/json",
@@ -6,6 +6,7 @@ from .agents_search_request_search_item_one_operator import AgentsSearchRequestS
6
6
  from .agents_search_request_search_item_operator import AgentsSearchRequestSearchItemOperator
7
7
  from .agents_search_request_search_item_two import AgentsSearchRequestSearchItemTwo
8
8
  from .agents_search_request_search_item_zero import AgentsSearchRequestSearchItemZero
9
+ from .agents_search_request_sort_by import AgentsSearchRequestSortBy
9
10
  from .agents_search_response import AgentsSearchResponse
10
11
  from .create_agent_request_response_format import CreateAgentRequestResponseFormat
11
12
  from .create_agent_request_tool_rules_item import CreateAgentRequestToolRulesItem
@@ -19,6 +20,7 @@ __all__ = [
19
20
  "AgentsSearchRequestSearchItemOperator",
20
21
  "AgentsSearchRequestSearchItemTwo",
21
22
  "AgentsSearchRequestSearchItemZero",
23
+ "AgentsSearchRequestSortBy",
22
24
  "AgentsSearchResponse",
23
25
  "CreateAgentRequestResponseFormat",
24
26
  "CreateAgentRequestToolRulesItem",
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ AgentsSearchRequestSortBy = typing.Union[typing.Literal["created_at", "last_run_completion"], typing.Any]
@@ -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.164",
19
+ "X-Fern-SDK-Version": "0.1.165",
20
20
  }
21
21
  if self.token is not None:
22
22
  headers["Authorization"] = f"Bearer {self.token}"
@@ -170,6 +170,16 @@ class AgentState(UncheckedBaseModel):
170
170
  The multi-agent group that this agent manages
171
171
  """
172
172
 
173
+ last_run_completion: typing.Optional[dt.datetime] = pydantic.Field(default=None)
174
+ """
175
+ The timestamp when the agent last completed a run.
176
+ """
177
+
178
+ last_run_duration_ms: typing.Optional[int] = pydantic.Field(default=None)
179
+ """
180
+ The duration in milliseconds of the agent's last run.
181
+ """
182
+
173
183
  if IS_PYDANTIC_V2:
174
184
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
175
185
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-client
3
- Version: 0.1.164
3
+ Version: 0.1.165
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -1,8 +1,8 @@
1
- letta_client/__init__.py,sha256=ODj1hJIjnt0oi2oxEA6Tg5phu0QfxXWI2xK56wtCbzg,17584
2
- letta_client/agents/__init__.py,sha256=3oFWVxaaxkphkjGJVk31Llb9ll9dKoCGx3B_r3qqtes,1716
1
+ letta_client/__init__.py,sha256=Dlv6NmNpxz9fGrD0dBUyZI7NS4IRMN5kESVb4UHT8Vo,17648
2
+ letta_client/agents/__init__.py,sha256=c_9OiE6ofyiPcq9BP37qvo7h0SKmw34PKN3KMxuRja0,1780
3
3
  letta_client/agents/blocks/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
4
4
  letta_client/agents/blocks/client.py,sha256=ecE03lE5tP1AtCMFLT9FzdYyQMx_D7NI5m42b41pV40,24684
5
- letta_client/agents/client.py,sha256=pUm0I57mZZgyd-w5ZZSOemNXpcz9TnIK3Pr7EtX6z60,85828
5
+ letta_client/agents/client.py,sha256=baQrl1WhyBWCLe5Ve4TIIQRm8_EBk3K8YxH6TetJCaU,87911
6
6
  letta_client/agents/context/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
7
7
  letta_client/agents/context/client.py,sha256=GKKvoG4N_K8Biz9yDjeIHpFG0C8Cwc7tHmEX3pTL_9U,4815
8
8
  letta_client/agents/core_memory/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
@@ -31,13 +31,14 @@ letta_client/agents/templates/types/templates_create_version_request_return_agen
31
31
  letta_client/agents/templates/types/templates_migrate_response.py,sha256=7N4JtAaiao-LrNdi72K7XB01uXJVkczaKYIJIMf0QYs,577
32
32
  letta_client/agents/tools/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
33
33
  letta_client/agents/tools/client.py,sha256=xZMRZhG8mI_h8_QqgI4lXh3FieRCLeoPwdtB56GB-XU,12685
34
- letta_client/agents/types/__init__.py,sha256=vvqKyhe98ZbR5QoK7VWHSVrjLYPuUo-Xlky1aAAv8Ek,1386
34
+ letta_client/agents/types/__init__.py,sha256=wh0A9KuavtD9a4NHJcjTG0Ok5xSsYipw1MVG-O_rR8E,1488
35
35
  letta_client/agents/types/agents_search_request_search_item.py,sha256=oIWRth_5r-3Fd_rROsEsc7XIvC0yRYv4BxdPKuUl6CI,634
36
36
  letta_client/agents/types/agents_search_request_search_item_one.py,sha256=ECWv-hDZen6AomM01zmRsOz0PlXVEwIwLHjid9yko9o,779
37
37
  letta_client/agents/types/agents_search_request_search_item_one_operator.py,sha256=S1qYdfdUqUgZ0DzQ53x7GN_qa_4NypO7-qNkkxgsbQc,182
38
38
  letta_client/agents/types/agents_search_request_search_item_operator.py,sha256=q9wNF1ubm5zw8_tykL4JWPEOH7SFLYLeTikjAszpZq8,678
39
39
  letta_client/agents/types/agents_search_request_search_item_two.py,sha256=YBC-rhz_ToN948VyRy5VB1yT4JqtYcLD_V9hNrkgnfQ,690
40
40
  letta_client/agents/types/agents_search_request_search_item_zero.py,sha256=tGjwnFqSofFMBSAogmPLEflDQZ2rMqoMfFUtaIpND18,630
41
+ letta_client/agents/types/agents_search_request_sort_by.py,sha256=svlezWF0A2JQlEnjjIXTMJnkrCjRot1r7ITCP1nQ4iQ,186
41
42
  letta_client/agents/types/agents_search_response.py,sha256=AQJVKps-bjCx2ujqESzW1Iy9ZYFS17hH_UFIeBeK4S8,815
42
43
  letta_client/agents/types/create_agent_request_response_format.py,sha256=1GUV3rFMj46bYpRHOB_H_WMNrQ5FkKIidKg60u8szHM,409
43
44
  letta_client/agents/types/create_agent_request_tool_rules_item.py,sha256=L3FNsFTG9kVmuPbQhbCKNg3H2E5bB2Rgp92gWmGd-LM,689
@@ -62,7 +63,7 @@ letta_client/client_side_access_tokens/types/client_side_access_tokens_create_re
62
63
  letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy_data_item_access_item.py,sha256=R-H25IpNp9feSrW8Yj3h9O3UTMVvFniQJElogKxLuoE,254
63
64
  letta_client/core/__init__.py,sha256=OKbX2aCZXgHCDUsCouqv-OiX32xA6eFFCKIUH9M5Vzk,1591
64
65
  letta_client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
65
- letta_client/core/client_wrapper.py,sha256=H3hLb75t8Rdf8-7Q7YL-14jLBV7EA4Fzu2bz3BDC0Ug,1998
66
+ letta_client/core/client_wrapper.py,sha256=dSomxhm2N6ZppvWcTyP1WFdUcaKze16CLsu_9Tjp6eM,1998
66
67
  letta_client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
67
68
  letta_client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
68
69
  letta_client/core/http_client.py,sha256=Z77OIxIbL4OAB2IDqjRq_sYa5yNYAWfmdhdCSSvh6Y4,19552
@@ -159,7 +160,7 @@ letta_client/types/action_response_model.py,sha256=yq2Fd9UU8j7vvtE3VqXUoRRvDzWcf
159
160
  letta_client/types/agent_environment_variable.py,sha256=vutZLcR0yETltgOZ7E_o9kR4vOdBxybVL9lzXSux75w,1698
160
161
  letta_client/types/agent_schema.py,sha256=uTSjFAsnEYdOX-PRD2vHbn69JBe8GKbctvlDOP85k_U,1784
161
162
  letta_client/types/agent_schema_tool_rules_item.py,sha256=TTP7uKYPSe-EAl4p03j0Kd-W9tG5T6gfaWIUBAOVv9U,482
162
- letta_client/types/agent_state.py,sha256=oLgHlraP7C5FnSGzzDBqKsXwKHJz-OYFbToAqFUQ8iI,5621
163
+ letta_client/types/agent_state.py,sha256=A_ehJ1jirLIBDfYbr8hyWmga3C9f8SmmNHf60j_q4_g,5931
163
164
  letta_client/types/agent_state_response_format.py,sha256=HISBgCumQxw6nQeDUMBu-IlghaLeWRb7BHHNaz_e8Hc,377
164
165
  letta_client/types/agent_state_tool_rules_item.py,sha256=WB-N4uyDTfhYBjQYDcLZDxDj73Xu1mQasBkdofUM-XU,625
165
166
  letta_client/types/agent_type.py,sha256=C7krJfPZvZDZrEqizp5UdUF4T6omXIu8m1XgVgg7JKc,321
@@ -403,6 +404,6 @@ letta_client/types/web_search_options_user_location_approximate.py,sha256=Ywk01J
403
404
  letta_client/version.py,sha256=bttKLbIhO3UonCYQlqs600zzbQgfhCCMjeXR9WRzid4,79
404
405
  letta_client/voice/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
405
406
  letta_client/voice/client.py,sha256=EX79F2D5bieXNP8g1ZPw8xwAzqE1A3hshCHUSlTV1kw,5739
406
- letta_client-0.1.164.dist-info/METADATA,sha256=4kDGXsvMCxGy7NosndMsL5ipb9o8ITQqOwN5KccoYy4,5093
407
- letta_client-0.1.164.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
408
- letta_client-0.1.164.dist-info/RECORD,,
407
+ letta_client-0.1.165.dist-info/METADATA,sha256=3a_wwcOwnbwLhFoUkiH1tKgWl1AuZ0zjjzkOzFiv-_k,5093
408
+ letta_client-0.1.165.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
409
+ letta_client-0.1.165.dist-info/RECORD,,