letta-client 0.1.192__py3-none-any.whl → 0.1.194__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.

@@ -1061,75 +1061,6 @@ class AgentsClient:
1061
1061
  raise ApiError(status_code=_response.status_code, body=_response.text)
1062
1062
  raise ApiError(status_code=_response.status_code, body=_response_json)
1063
1063
 
1064
- def cancel_agent_run(
1065
- self,
1066
- agent_id: str,
1067
- *,
1068
- request: typing.Optional[typing.Sequence[str]] = None,
1069
- request_options: typing.Optional[RequestOptions] = None,
1070
- ) -> typing.Dict[str, typing.Optional[typing.Any]]:
1071
- """
1072
- Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
1073
-
1074
- Note to cancel active runs associated with an agent, redis is required.
1075
-
1076
- Parameters
1077
- ----------
1078
- agent_id : str
1079
-
1080
- request : typing.Optional[typing.Sequence[str]]
1081
-
1082
- request_options : typing.Optional[RequestOptions]
1083
- Request-specific configuration.
1084
-
1085
- Returns
1086
- -------
1087
- typing.Dict[str, typing.Optional[typing.Any]]
1088
- Successful Response
1089
-
1090
- Examples
1091
- --------
1092
- from letta_client import Letta
1093
-
1094
- client = Letta(
1095
- project="YOUR_PROJECT",
1096
- token="YOUR_TOKEN",
1097
- )
1098
- client.agents.cancel_agent_run(
1099
- agent_id="agent_id",
1100
- )
1101
- """
1102
- _response = self._client_wrapper.httpx_client.request(
1103
- f"v1/agents/{jsonable_encoder(agent_id)}/messages/cancel",
1104
- method="POST",
1105
- json=request,
1106
- request_options=request_options,
1107
- omit=OMIT,
1108
- )
1109
- try:
1110
- if 200 <= _response.status_code < 300:
1111
- return typing.cast(
1112
- typing.Dict[str, typing.Optional[typing.Any]],
1113
- construct_type(
1114
- type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
1115
- object_=_response.json(),
1116
- ),
1117
- )
1118
- if _response.status_code == 422:
1119
- raise UnprocessableEntityError(
1120
- typing.cast(
1121
- HttpValidationError,
1122
- construct_type(
1123
- type_=HttpValidationError, # type: ignore
1124
- object_=_response.json(),
1125
- ),
1126
- )
1127
- )
1128
- _response_json = _response.json()
1129
- except JSONDecodeError:
1130
- raise ApiError(status_code=_response.status_code, body=_response.text)
1131
- raise ApiError(status_code=_response.status_code, body=_response_json)
1132
-
1133
1064
  def summarize_agent_conversation(
1134
1065
  self, agent_id: str, *, max_message_length: int, request_options: typing.Optional[RequestOptions] = None
1135
1066
  ) -> AgentState:
@@ -2367,83 +2298,6 @@ class AsyncAgentsClient:
2367
2298
  raise ApiError(status_code=_response.status_code, body=_response.text)
2368
2299
  raise ApiError(status_code=_response.status_code, body=_response_json)
2369
2300
 
2370
- async def cancel_agent_run(
2371
- self,
2372
- agent_id: str,
2373
- *,
2374
- request: typing.Optional[typing.Sequence[str]] = None,
2375
- request_options: typing.Optional[RequestOptions] = None,
2376
- ) -> typing.Dict[str, typing.Optional[typing.Any]]:
2377
- """
2378
- Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
2379
-
2380
- Note to cancel active runs associated with an agent, redis is required.
2381
-
2382
- Parameters
2383
- ----------
2384
- agent_id : str
2385
-
2386
- request : typing.Optional[typing.Sequence[str]]
2387
-
2388
- request_options : typing.Optional[RequestOptions]
2389
- Request-specific configuration.
2390
-
2391
- Returns
2392
- -------
2393
- typing.Dict[str, typing.Optional[typing.Any]]
2394
- Successful Response
2395
-
2396
- Examples
2397
- --------
2398
- import asyncio
2399
-
2400
- from letta_client import AsyncLetta
2401
-
2402
- client = AsyncLetta(
2403
- project="YOUR_PROJECT",
2404
- token="YOUR_TOKEN",
2405
- )
2406
-
2407
-
2408
- async def main() -> None:
2409
- await client.agents.cancel_agent_run(
2410
- agent_id="agent_id",
2411
- )
2412
-
2413
-
2414
- asyncio.run(main())
2415
- """
2416
- _response = await self._client_wrapper.httpx_client.request(
2417
- f"v1/agents/{jsonable_encoder(agent_id)}/messages/cancel",
2418
- method="POST",
2419
- json=request,
2420
- request_options=request_options,
2421
- omit=OMIT,
2422
- )
2423
- try:
2424
- if 200 <= _response.status_code < 300:
2425
- return typing.cast(
2426
- typing.Dict[str, typing.Optional[typing.Any]],
2427
- construct_type(
2428
- type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
2429
- object_=_response.json(),
2430
- ),
2431
- )
2432
- if _response.status_code == 422:
2433
- raise UnprocessableEntityError(
2434
- typing.cast(
2435
- HttpValidationError,
2436
- construct_type(
2437
- type_=HttpValidationError, # type: ignore
2438
- object_=_response.json(),
2439
- ),
2440
- )
2441
- )
2442
- _response_json = _response.json()
2443
- except JSONDecodeError:
2444
- raise ApiError(status_code=_response.status_code, body=_response.text)
2445
- raise ApiError(status_code=_response.status_code, body=_response_json)
2446
-
2447
2301
  async def summarize_agent_conversation(
2448
2302
  self, agent_id: str, *, max_message_length: int, request_options: typing.Optional[RequestOptions] = None
2449
2303
  ) -> AgentState:
@@ -437,6 +437,75 @@ class MessagesClient:
437
437
  raise ApiError(status_code=_response.status_code, body=_response.text)
438
438
  raise ApiError(status_code=_response.status_code, body=_response_json)
439
439
 
440
+ def cancel(
441
+ self,
442
+ agent_id: str,
443
+ *,
444
+ request: typing.Optional[typing.Sequence[str]] = None,
445
+ request_options: typing.Optional[RequestOptions] = None,
446
+ ) -> typing.Dict[str, typing.Optional[typing.Any]]:
447
+ """
448
+ Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
449
+
450
+ Note to cancel active runs associated with an agent, redis is required.
451
+
452
+ Parameters
453
+ ----------
454
+ agent_id : str
455
+
456
+ request : typing.Optional[typing.Sequence[str]]
457
+
458
+ request_options : typing.Optional[RequestOptions]
459
+ Request-specific configuration.
460
+
461
+ Returns
462
+ -------
463
+ typing.Dict[str, typing.Optional[typing.Any]]
464
+ Successful Response
465
+
466
+ Examples
467
+ --------
468
+ from letta_client import Letta
469
+
470
+ client = Letta(
471
+ project="YOUR_PROJECT",
472
+ token="YOUR_TOKEN",
473
+ )
474
+ client.agents.messages.cancel(
475
+ agent_id="agent_id",
476
+ )
477
+ """
478
+ _response = self._client_wrapper.httpx_client.request(
479
+ f"v1/agents/{jsonable_encoder(agent_id)}/messages/cancel",
480
+ method="POST",
481
+ json=request,
482
+ request_options=request_options,
483
+ omit=OMIT,
484
+ )
485
+ try:
486
+ if 200 <= _response.status_code < 300:
487
+ return typing.cast(
488
+ typing.Dict[str, typing.Optional[typing.Any]],
489
+ construct_type(
490
+ type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
491
+ object_=_response.json(),
492
+ ),
493
+ )
494
+ if _response.status_code == 422:
495
+ raise UnprocessableEntityError(
496
+ typing.cast(
497
+ HttpValidationError,
498
+ construct_type(
499
+ type_=HttpValidationError, # type: ignore
500
+ object_=_response.json(),
501
+ ),
502
+ )
503
+ )
504
+ _response_json = _response.json()
505
+ except JSONDecodeError:
506
+ raise ApiError(status_code=_response.status_code, body=_response.text)
507
+ raise ApiError(status_code=_response.status_code, body=_response_json)
508
+
440
509
  def create_async(
441
510
  self,
442
511
  agent_id: str,
@@ -1068,6 +1137,83 @@ class AsyncMessagesClient:
1068
1137
  raise ApiError(status_code=_response.status_code, body=_response.text)
1069
1138
  raise ApiError(status_code=_response.status_code, body=_response_json)
1070
1139
 
1140
+ async def cancel(
1141
+ self,
1142
+ agent_id: str,
1143
+ *,
1144
+ request: typing.Optional[typing.Sequence[str]] = None,
1145
+ request_options: typing.Optional[RequestOptions] = None,
1146
+ ) -> typing.Dict[str, typing.Optional[typing.Any]]:
1147
+ """
1148
+ Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.
1149
+
1150
+ Note to cancel active runs associated with an agent, redis is required.
1151
+
1152
+ Parameters
1153
+ ----------
1154
+ agent_id : str
1155
+
1156
+ request : typing.Optional[typing.Sequence[str]]
1157
+
1158
+ request_options : typing.Optional[RequestOptions]
1159
+ Request-specific configuration.
1160
+
1161
+ Returns
1162
+ -------
1163
+ typing.Dict[str, typing.Optional[typing.Any]]
1164
+ Successful Response
1165
+
1166
+ Examples
1167
+ --------
1168
+ import asyncio
1169
+
1170
+ from letta_client import AsyncLetta
1171
+
1172
+ client = AsyncLetta(
1173
+ project="YOUR_PROJECT",
1174
+ token="YOUR_TOKEN",
1175
+ )
1176
+
1177
+
1178
+ async def main() -> None:
1179
+ await client.agents.messages.cancel(
1180
+ agent_id="agent_id",
1181
+ )
1182
+
1183
+
1184
+ asyncio.run(main())
1185
+ """
1186
+ _response = await self._client_wrapper.httpx_client.request(
1187
+ f"v1/agents/{jsonable_encoder(agent_id)}/messages/cancel",
1188
+ method="POST",
1189
+ json=request,
1190
+ request_options=request_options,
1191
+ omit=OMIT,
1192
+ )
1193
+ try:
1194
+ if 200 <= _response.status_code < 300:
1195
+ return typing.cast(
1196
+ typing.Dict[str, typing.Optional[typing.Any]],
1197
+ construct_type(
1198
+ type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
1199
+ object_=_response.json(),
1200
+ ),
1201
+ )
1202
+ if _response.status_code == 422:
1203
+ raise UnprocessableEntityError(
1204
+ typing.cast(
1205
+ HttpValidationError,
1206
+ construct_type(
1207
+ type_=HttpValidationError, # type: ignore
1208
+ object_=_response.json(),
1209
+ ),
1210
+ )
1211
+ )
1212
+ _response_json = _response.json()
1213
+ except JSONDecodeError:
1214
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1215
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1216
+
1071
1217
  async def create_async(
1072
1218
  self,
1073
1219
  agent_id: str,
@@ -18,7 +18,11 @@ class AgentsClient:
18
18
  self._client_wrapper = client_wrapper
19
19
 
20
20
  def list(
21
- self, block_id: str, *, request_options: typing.Optional[RequestOptions] = None
21
+ self,
22
+ block_id: str,
23
+ *,
24
+ include_relationships: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
25
+ request_options: typing.Optional[RequestOptions] = None,
22
26
  ) -> typing.List[AgentState]:
23
27
  """
24
28
  Retrieves all agents associated with the specified block.
@@ -28,6 +32,9 @@ class AgentsClient:
28
32
  ----------
29
33
  block_id : str
30
34
 
35
+ include_relationships : typing.Optional[typing.Union[str, typing.Sequence[str]]]
36
+ Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.
37
+
31
38
  request_options : typing.Optional[RequestOptions]
32
39
  Request-specific configuration.
33
40
 
@@ -51,6 +58,9 @@ class AgentsClient:
51
58
  _response = self._client_wrapper.httpx_client.request(
52
59
  f"v1/blocks/{jsonable_encoder(block_id)}/agents",
53
60
  method="GET",
61
+ params={
62
+ "include_relationships": include_relationships,
63
+ },
54
64
  request_options=request_options,
55
65
  )
56
66
  try:
@@ -83,7 +93,11 @@ class AsyncAgentsClient:
83
93
  self._client_wrapper = client_wrapper
84
94
 
85
95
  async def list(
86
- self, block_id: str, *, request_options: typing.Optional[RequestOptions] = None
96
+ self,
97
+ block_id: str,
98
+ *,
99
+ include_relationships: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
100
+ request_options: typing.Optional[RequestOptions] = None,
87
101
  ) -> typing.List[AgentState]:
88
102
  """
89
103
  Retrieves all agents associated with the specified block.
@@ -93,6 +107,9 @@ class AsyncAgentsClient:
93
107
  ----------
94
108
  block_id : str
95
109
 
110
+ include_relationships : typing.Optional[typing.Union[str, typing.Sequence[str]]]
111
+ Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.
112
+
96
113
  request_options : typing.Optional[RequestOptions]
97
114
  Request-specific configuration.
98
115
 
@@ -124,6 +141,9 @@ class AsyncAgentsClient:
124
141
  _response = await self._client_wrapper.httpx_client.request(
125
142
  f"v1/blocks/{jsonable_encoder(block_id)}/agents",
126
143
  method="GET",
144
+ params={
145
+ "include_relationships": include_relationships,
146
+ },
127
147
  request_options=request_options,
128
148
  )
129
149
  try:
@@ -24,7 +24,7 @@ class BaseClientWrapper:
24
24
  headers: typing.Dict[str, str] = {
25
25
  "X-Fern-Language": "Python",
26
26
  "X-Fern-SDK-Name": "letta-client",
27
- "X-Fern-SDK-Version": "0.1.192",
27
+ "X-Fern-SDK-Version": "0.1.194",
28
28
  }
29
29
  if self._project is not None:
30
30
  headers["X-Project"] = self._project
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-client
3
- Version: 0.1.192
3
+ Version: 0.1.194
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -2,7 +2,7 @@ letta_client/__init__.py,sha256=PaPQ6XnP5KGKv2jElXjj6d483LOtbaRGJu3n88rW1WA,1825
2
2
  letta_client/agents/__init__.py,sha256=9L60SAZIihZzh_KhVxu0uX4RS7z2iKKctzQsS8ycXHc,1954
3
3
  letta_client/agents/blocks/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
4
4
  letta_client/agents/blocks/client.py,sha256=HwUOGmCQ_wuKb3_52ij1BBHRXdzIEd8SjW9-9Rop26Q,25044
5
- letta_client/agents/client.py,sha256=htBG9I-lsRzykYPaQNwdCjMz-_8-bHwZsD857Iga4H4,98603
5
+ letta_client/agents/client.py,sha256=B7ZsJGQqmeTUdP8yybRWh6qaoybopFCujzP99EDwk_k,93753
6
6
  letta_client/agents/context/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
7
7
  letta_client/agents/context/client.py,sha256=O1gxStQyfzXi4MblatWalLTWM425gS_fndW3W_es08U,4887
8
8
  letta_client/agents/core_memory/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
@@ -14,7 +14,7 @@ letta_client/agents/memory_variables/client.py,sha256=DGJvV5k5H-BRE-FWMLNrCqKkHJ
14
14
  letta_client/agents/memory_variables/types/__init__.py,sha256=EoznK0WvhCyFYd4KDdU-cGDQWpSXmq79BSkqVHN-j7A,180
15
15
  letta_client/agents/memory_variables/types/memory_variables_list_response.py,sha256=bsF__n_B4ZXEHzg--OVD6tHHXt_aM-FjHm2x1ZXPnL0,599
16
16
  letta_client/agents/messages/__init__.py,sha256=M7Ar6Rmb8we4dfYE6jj3FCL9UvVFy1bNQIPflUXMWHA,243
17
- letta_client/agents/messages/client.py,sha256=d28wEkWNcqX8kGt4e4NYOkOFNRCkq9XVHvIQshxYuGA,46443
17
+ letta_client/agents/messages/client.py,sha256=ZZ6m0PQGvgpkN4gp0N4ouVhqaCMQ8BGKWpaik9Q6F3E,51271
18
18
  letta_client/agents/messages/types/__init__.py,sha256=Oc2j0oGOs96IEFf9xsJIkjBjoq3OMtse64YwWv3F9Io,335
19
19
  letta_client/agents/messages/types/letta_streaming_response.py,sha256=8VR2F32xjoPFXL4YBvBbAZclaJG4ENPTjk7BrlZkmtw,742
20
20
  letta_client/agents/messages/types/messages_modify_request.py,sha256=7C2X3BKye-YDSXOkdEmxxt34seI4jkLK0-govtc4nhg,475
@@ -51,7 +51,7 @@ letta_client/batches/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa
51
51
  letta_client/batches/client.py,sha256=DHnsRYHgxVh6OvfAE8etlbno1FMg4cIzAYiydJrfmJM,19730
52
52
  letta_client/blocks/__init__.py,sha256=c6SGOs9_YGdydYAzhe5TUiaXq52rpWT1mNMcke8qGTQ,108
53
53
  letta_client/blocks/agents/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
54
- letta_client/blocks/agents/client.py,sha256=KBeIrslvPqO4AlYMb3L4iDxvtqsS2GfvPRgzhvxI4Ws,4976
54
+ letta_client/blocks/agents/client.py,sha256=2mBOt6CZanLUi_8Nc-bthaGoKhU3WgSA9vL1UjMdZE8,6066
55
55
  letta_client/blocks/client.py,sha256=N4wZjI0gCDOQDgquwAnV9FfVPUudxo-js5AEzW8rJz0,32107
56
56
  letta_client/client.py,sha256=iXqKTuQ0F9jIjkTwD73apLlLQqUF1IF6V_PhenY_CJo,22470
57
57
  letta_client/client_side_access_tokens/__init__.py,sha256=z_wHT4UTBK7RzDIfLpdLMtBJBuuDosqgbzdmx-QME_o,763
@@ -65,7 +65,7 @@ letta_client/client_side_access_tokens/types/client_side_access_tokens_create_re
65
65
  letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy_data_item_access_item.py,sha256=R-H25IpNp9feSrW8Yj3h9O3UTMVvFniQJElogKxLuoE,254
66
66
  letta_client/core/__init__.py,sha256=OKbX2aCZXgHCDUsCouqv-OiX32xA6eFFCKIUH9M5Vzk,1591
67
67
  letta_client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
68
- letta_client/core/client_wrapper.py,sha256=E9r11z78rPXKO3YVb-WIkXCdDP442131iM-T1Y_Pxc4,2336
68
+ letta_client/core/client_wrapper.py,sha256=R1Bl44NeBq2yqRmzRALnPziE9QFDQibEp03fMCiF5sk,2336
69
69
  letta_client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
70
70
  letta_client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
71
71
  letta_client/core/http_client.py,sha256=Z77OIxIbL4OAB2IDqjRq_sYa5yNYAWfmdhdCSSvh6Y4,19552
@@ -418,6 +418,6 @@ letta_client/types/web_search_options_user_location_approximate.py,sha256=Ywk01J
418
418
  letta_client/version.py,sha256=bttKLbIhO3UonCYQlqs600zzbQgfhCCMjeXR9WRzid4,79
419
419
  letta_client/voice/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
420
420
  letta_client/voice/client.py,sha256=47iQYCuW_qpKI4hM3pYVxn3hw7kgQj3emU1_oRpkRMA,5811
421
- letta_client-0.1.192.dist-info/METADATA,sha256=YEeXH6cpl2Q3VwHff9LWXWJX6ttGkwDwfVovcN_XmcE,5177
422
- letta_client-0.1.192.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
423
- letta_client-0.1.192.dist-info/RECORD,,
421
+ letta_client-0.1.194.dist-info/METADATA,sha256=O32N24Xs7iNPbxZv_cv8ECMjGWWYiVrBZkh4YpHSpuI,5177
422
+ letta_client-0.1.194.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
423
+ letta_client-0.1.194.dist-info/RECORD,,