letta-client 0.1.209__py3-none-any.whl → 0.1.211__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.
@@ -244,6 +244,8 @@ class AgentsClient:
244
244
  enable_sleeptime: typing.Optional[bool] = OMIT,
245
245
  response_format: typing.Optional[CreateAgentRequestResponseFormat] = OMIT,
246
246
  timezone: typing.Optional[str] = OMIT,
247
+ max_files_open: typing.Optional[int] = OMIT,
248
+ per_file_view_window_char_limit: typing.Optional[int] = OMIT,
247
249
  request_options: typing.Optional[RequestOptions] = None,
248
250
  ) -> AgentState:
249
251
  """
@@ -368,6 +370,12 @@ class AgentsClient:
368
370
  timezone : typing.Optional[str]
369
371
  The timezone of the agent (IANA format).
370
372
 
373
+ max_files_open : typing.Optional[int]
374
+ Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent.
375
+
376
+ per_file_view_window_char_limit : typing.Optional[int]
377
+ The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent.
378
+
371
379
  request_options : typing.Optional[RequestOptions]
372
380
  Request-specific configuration.
373
381
 
@@ -441,6 +449,8 @@ class AgentsClient:
441
449
  object_=response_format, annotation=CreateAgentRequestResponseFormat, direction="write"
442
450
  ),
443
451
  "timezone": timezone,
452
+ "max_files_open": max_files_open,
453
+ "per_file_view_window_char_limit": per_file_view_window_char_limit,
444
454
  },
445
455
  headers={
446
456
  "content-type": "application/json",
@@ -827,6 +837,8 @@ class AgentsClient:
827
837
  last_run_completion: typing.Optional[dt.datetime] = OMIT,
828
838
  last_run_duration_ms: typing.Optional[int] = OMIT,
829
839
  timezone: typing.Optional[str] = OMIT,
840
+ max_files_open: typing.Optional[int] = OMIT,
841
+ per_file_view_window_char_limit: typing.Optional[int] = OMIT,
830
842
  request_options: typing.Optional[RequestOptions] = None,
831
843
  ) -> AgentState:
832
844
  """
@@ -911,6 +923,12 @@ class AgentsClient:
911
923
  timezone : typing.Optional[str]
912
924
  The timezone of the agent (IANA format).
913
925
 
926
+ max_files_open : typing.Optional[int]
927
+ Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent.
928
+
929
+ per_file_view_window_char_limit : typing.Optional[int]
930
+ The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent.
931
+
914
932
  request_options : typing.Optional[RequestOptions]
915
933
  Request-specific configuration.
916
934
 
@@ -968,6 +986,8 @@ class AgentsClient:
968
986
  "last_run_completion": last_run_completion,
969
987
  "last_run_duration_ms": last_run_duration_ms,
970
988
  "timezone": timezone,
989
+ "max_files_open": max_files_open,
990
+ "per_file_view_window_char_limit": per_file_view_window_char_limit,
971
991
  },
972
992
  headers={
973
993
  "content-type": "application/json",
@@ -1061,6 +1081,137 @@ class AgentsClient:
1061
1081
  raise ApiError(status_code=_response.status_code, body=_response.text)
1062
1082
  raise ApiError(status_code=_response.status_code, body=_response_json)
1063
1083
 
1084
+ def open_file(
1085
+ self, agent_id: str, file_id: str, *, request_options: typing.Optional[RequestOptions] = None
1086
+ ) -> typing.List[str]:
1087
+ """
1088
+ Opens a specific file for a given agent.
1089
+
1090
+ This endpoint marks a specific file as open in the agent's file state.
1091
+ The file will be included in the agent's working memory view.
1092
+ Returns a list of file names that were closed due to LRU eviction.
1093
+
1094
+ Parameters
1095
+ ----------
1096
+ agent_id : str
1097
+
1098
+ file_id : str
1099
+
1100
+ request_options : typing.Optional[RequestOptions]
1101
+ Request-specific configuration.
1102
+
1103
+ Returns
1104
+ -------
1105
+ typing.List[str]
1106
+ Successful Response
1107
+
1108
+ Examples
1109
+ --------
1110
+ from letta_client import Letta
1111
+
1112
+ client = Letta(
1113
+ project="YOUR_PROJECT",
1114
+ token="YOUR_TOKEN",
1115
+ )
1116
+ client.agents.open_file(
1117
+ agent_id="agent_id",
1118
+ file_id="file_id",
1119
+ )
1120
+ """
1121
+ _response = self._client_wrapper.httpx_client.request(
1122
+ f"v1/agents/{jsonable_encoder(agent_id)}/files/{jsonable_encoder(file_id)}/open",
1123
+ method="PATCH",
1124
+ request_options=request_options,
1125
+ )
1126
+ try:
1127
+ if 200 <= _response.status_code < 300:
1128
+ return typing.cast(
1129
+ typing.List[str],
1130
+ construct_type(
1131
+ type_=typing.List[str], # type: ignore
1132
+ object_=_response.json(),
1133
+ ),
1134
+ )
1135
+ if _response.status_code == 422:
1136
+ raise UnprocessableEntityError(
1137
+ typing.cast(
1138
+ HttpValidationError,
1139
+ construct_type(
1140
+ type_=HttpValidationError, # type: ignore
1141
+ object_=_response.json(),
1142
+ ),
1143
+ )
1144
+ )
1145
+ _response_json = _response.json()
1146
+ except JSONDecodeError:
1147
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1148
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1149
+
1150
+ def close_file(
1151
+ self, agent_id: str, file_id: str, *, request_options: typing.Optional[RequestOptions] = None
1152
+ ) -> typing.Optional[typing.Any]:
1153
+ """
1154
+ Closes a specific file for a given agent.
1155
+
1156
+ This endpoint marks a specific file as closed in the agent's file state.
1157
+ The file will be removed from the agent's working memory view.
1158
+
1159
+ Parameters
1160
+ ----------
1161
+ agent_id : str
1162
+
1163
+ file_id : str
1164
+
1165
+ request_options : typing.Optional[RequestOptions]
1166
+ Request-specific configuration.
1167
+
1168
+ Returns
1169
+ -------
1170
+ typing.Optional[typing.Any]
1171
+ Successful Response
1172
+
1173
+ Examples
1174
+ --------
1175
+ from letta_client import Letta
1176
+
1177
+ client = Letta(
1178
+ project="YOUR_PROJECT",
1179
+ token="YOUR_TOKEN",
1180
+ )
1181
+ client.agents.close_file(
1182
+ agent_id="agent_id",
1183
+ file_id="file_id",
1184
+ )
1185
+ """
1186
+ _response = self._client_wrapper.httpx_client.request(
1187
+ f"v1/agents/{jsonable_encoder(agent_id)}/files/{jsonable_encoder(file_id)}/close",
1188
+ method="PATCH",
1189
+ request_options=request_options,
1190
+ )
1191
+ try:
1192
+ if 200 <= _response.status_code < 300:
1193
+ return typing.cast(
1194
+ typing.Optional[typing.Any],
1195
+ construct_type(
1196
+ type_=typing.Optional[typing.Any], # type: ignore
1197
+ object_=_response.json(),
1198
+ ),
1199
+ )
1200
+ if _response.status_code == 422:
1201
+ raise UnprocessableEntityError(
1202
+ typing.cast(
1203
+ HttpValidationError,
1204
+ construct_type(
1205
+ type_=HttpValidationError, # type: ignore
1206
+ object_=_response.json(),
1207
+ ),
1208
+ )
1209
+ )
1210
+ _response_json = _response.json()
1211
+ except JSONDecodeError:
1212
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1213
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1214
+
1064
1215
  def summarize_agent_conversation(
1065
1216
  self, agent_id: str, *, max_message_length: int, request_options: typing.Optional[RequestOptions] = None
1066
1217
  ) -> AgentState:
@@ -1417,6 +1568,8 @@ class AsyncAgentsClient:
1417
1568
  enable_sleeptime: typing.Optional[bool] = OMIT,
1418
1569
  response_format: typing.Optional[CreateAgentRequestResponseFormat] = OMIT,
1419
1570
  timezone: typing.Optional[str] = OMIT,
1571
+ max_files_open: typing.Optional[int] = OMIT,
1572
+ per_file_view_window_char_limit: typing.Optional[int] = OMIT,
1420
1573
  request_options: typing.Optional[RequestOptions] = None,
1421
1574
  ) -> AgentState:
1422
1575
  """
@@ -1541,6 +1694,12 @@ class AsyncAgentsClient:
1541
1694
  timezone : typing.Optional[str]
1542
1695
  The timezone of the agent (IANA format).
1543
1696
 
1697
+ max_files_open : typing.Optional[int]
1698
+ Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent.
1699
+
1700
+ per_file_view_window_char_limit : typing.Optional[int]
1701
+ The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent.
1702
+
1544
1703
  request_options : typing.Optional[RequestOptions]
1545
1704
  Request-specific configuration.
1546
1705
 
@@ -1622,6 +1781,8 @@ class AsyncAgentsClient:
1622
1781
  object_=response_format, annotation=CreateAgentRequestResponseFormat, direction="write"
1623
1782
  ),
1624
1783
  "timezone": timezone,
1784
+ "max_files_open": max_files_open,
1785
+ "per_file_view_window_char_limit": per_file_view_window_char_limit,
1625
1786
  },
1626
1787
  headers={
1627
1788
  "content-type": "application/json",
@@ -2048,6 +2209,8 @@ class AsyncAgentsClient:
2048
2209
  last_run_completion: typing.Optional[dt.datetime] = OMIT,
2049
2210
  last_run_duration_ms: typing.Optional[int] = OMIT,
2050
2211
  timezone: typing.Optional[str] = OMIT,
2212
+ max_files_open: typing.Optional[int] = OMIT,
2213
+ per_file_view_window_char_limit: typing.Optional[int] = OMIT,
2051
2214
  request_options: typing.Optional[RequestOptions] = None,
2052
2215
  ) -> AgentState:
2053
2216
  """
@@ -2132,6 +2295,12 @@ class AsyncAgentsClient:
2132
2295
  timezone : typing.Optional[str]
2133
2296
  The timezone of the agent (IANA format).
2134
2297
 
2298
+ max_files_open : typing.Optional[int]
2299
+ Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent.
2300
+
2301
+ per_file_view_window_char_limit : typing.Optional[int]
2302
+ The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent.
2303
+
2135
2304
  request_options : typing.Optional[RequestOptions]
2136
2305
  Request-specific configuration.
2137
2306
 
@@ -2197,6 +2366,8 @@ class AsyncAgentsClient:
2197
2366
  "last_run_completion": last_run_completion,
2198
2367
  "last_run_duration_ms": last_run_duration_ms,
2199
2368
  "timezone": timezone,
2369
+ "max_files_open": max_files_open,
2370
+ "per_file_view_window_char_limit": per_file_view_window_char_limit,
2200
2371
  },
2201
2372
  headers={
2202
2373
  "content-type": "application/json",
@@ -2298,6 +2469,153 @@ class AsyncAgentsClient:
2298
2469
  raise ApiError(status_code=_response.status_code, body=_response.text)
2299
2470
  raise ApiError(status_code=_response.status_code, body=_response_json)
2300
2471
 
2472
+ async def open_file(
2473
+ self, agent_id: str, file_id: str, *, request_options: typing.Optional[RequestOptions] = None
2474
+ ) -> typing.List[str]:
2475
+ """
2476
+ Opens a specific file for a given agent.
2477
+
2478
+ This endpoint marks a specific file as open in the agent's file state.
2479
+ The file will be included in the agent's working memory view.
2480
+ Returns a list of file names that were closed due to LRU eviction.
2481
+
2482
+ Parameters
2483
+ ----------
2484
+ agent_id : str
2485
+
2486
+ file_id : str
2487
+
2488
+ request_options : typing.Optional[RequestOptions]
2489
+ Request-specific configuration.
2490
+
2491
+ Returns
2492
+ -------
2493
+ typing.List[str]
2494
+ Successful Response
2495
+
2496
+ Examples
2497
+ --------
2498
+ import asyncio
2499
+
2500
+ from letta_client import AsyncLetta
2501
+
2502
+ client = AsyncLetta(
2503
+ project="YOUR_PROJECT",
2504
+ token="YOUR_TOKEN",
2505
+ )
2506
+
2507
+
2508
+ async def main() -> None:
2509
+ await client.agents.open_file(
2510
+ agent_id="agent_id",
2511
+ file_id="file_id",
2512
+ )
2513
+
2514
+
2515
+ asyncio.run(main())
2516
+ """
2517
+ _response = await self._client_wrapper.httpx_client.request(
2518
+ f"v1/agents/{jsonable_encoder(agent_id)}/files/{jsonable_encoder(file_id)}/open",
2519
+ method="PATCH",
2520
+ request_options=request_options,
2521
+ )
2522
+ try:
2523
+ if 200 <= _response.status_code < 300:
2524
+ return typing.cast(
2525
+ typing.List[str],
2526
+ construct_type(
2527
+ type_=typing.List[str], # type: ignore
2528
+ object_=_response.json(),
2529
+ ),
2530
+ )
2531
+ if _response.status_code == 422:
2532
+ raise UnprocessableEntityError(
2533
+ typing.cast(
2534
+ HttpValidationError,
2535
+ construct_type(
2536
+ type_=HttpValidationError, # type: ignore
2537
+ object_=_response.json(),
2538
+ ),
2539
+ )
2540
+ )
2541
+ _response_json = _response.json()
2542
+ except JSONDecodeError:
2543
+ raise ApiError(status_code=_response.status_code, body=_response.text)
2544
+ raise ApiError(status_code=_response.status_code, body=_response_json)
2545
+
2546
+ async def close_file(
2547
+ self, agent_id: str, file_id: str, *, request_options: typing.Optional[RequestOptions] = None
2548
+ ) -> typing.Optional[typing.Any]:
2549
+ """
2550
+ Closes a specific file for a given agent.
2551
+
2552
+ This endpoint marks a specific file as closed in the agent's file state.
2553
+ The file will be removed from the agent's working memory view.
2554
+
2555
+ Parameters
2556
+ ----------
2557
+ agent_id : str
2558
+
2559
+ file_id : str
2560
+
2561
+ request_options : typing.Optional[RequestOptions]
2562
+ Request-specific configuration.
2563
+
2564
+ Returns
2565
+ -------
2566
+ typing.Optional[typing.Any]
2567
+ Successful Response
2568
+
2569
+ Examples
2570
+ --------
2571
+ import asyncio
2572
+
2573
+ from letta_client import AsyncLetta
2574
+
2575
+ client = AsyncLetta(
2576
+ project="YOUR_PROJECT",
2577
+ token="YOUR_TOKEN",
2578
+ )
2579
+
2580
+
2581
+ async def main() -> None:
2582
+ await client.agents.close_file(
2583
+ agent_id="agent_id",
2584
+ file_id="file_id",
2585
+ )
2586
+
2587
+
2588
+ asyncio.run(main())
2589
+ """
2590
+ _response = await self._client_wrapper.httpx_client.request(
2591
+ f"v1/agents/{jsonable_encoder(agent_id)}/files/{jsonable_encoder(file_id)}/close",
2592
+ method="PATCH",
2593
+ request_options=request_options,
2594
+ )
2595
+ try:
2596
+ if 200 <= _response.status_code < 300:
2597
+ return typing.cast(
2598
+ typing.Optional[typing.Any],
2599
+ construct_type(
2600
+ type_=typing.Optional[typing.Any], # type: ignore
2601
+ object_=_response.json(),
2602
+ ),
2603
+ )
2604
+ if _response.status_code == 422:
2605
+ raise UnprocessableEntityError(
2606
+ typing.cast(
2607
+ HttpValidationError,
2608
+ construct_type(
2609
+ type_=HttpValidationError, # type: ignore
2610
+ object_=_response.json(),
2611
+ ),
2612
+ )
2613
+ )
2614
+ _response_json = _response.json()
2615
+ except JSONDecodeError:
2616
+ raise ApiError(status_code=_response.status_code, body=_response.text)
2617
+ raise ApiError(status_code=_response.status_code, body=_response_json)
2618
+
2301
2619
  async def summarize_agent_conversation(
2302
2620
  self, agent_id: str, *, max_message_length: int, request_options: typing.Optional[RequestOptions] = None
2303
2621
  ) -> AgentState:
@@ -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.209",
27
+ "X-Fern-SDK-Version": "0.1.211",
28
28
  }
29
29
  if self._project is not None:
30
30
  headers["X-Project"] = self._project
@@ -185,6 +185,16 @@ class AgentState(UncheckedBaseModel):
185
185
  The timezone of the agent (IANA format).
186
186
  """
187
187
 
188
+ max_files_open: typing.Optional[int] = pydantic.Field(default=None)
189
+ """
190
+ Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent.
191
+ """
192
+
193
+ per_file_view_window_char_limit: typing.Optional[int] = pydantic.Field(default=None)
194
+ """
195
+ The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent.
196
+ """
197
+
188
198
  if IS_PYDANTIC_V2:
189
199
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
190
200
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-client
3
- Version: 0.1.209
3
+ Version: 0.1.211
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=DpCoPhi5qy7K-MmczqULa30OTff96XkneWc4tYISq_8,1916
2
2
  letta_client/agents/__init__.py,sha256=i9PmBueIWESDLqmpzWt1oZVgZNr1rNkO6j0pl5sgvGo,2049
3
3
  letta_client/agents/blocks/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
4
4
  letta_client/agents/blocks/client.py,sha256=4UGPYxfGwNN3ZW-SkIdfVZK6cvCcumVAw0_AM8OmoBY,25046
5
- letta_client/agents/client.py,sha256=B7ZsJGQqmeTUdP8yybRWh6qaoybopFCujzP99EDwk_k,93753
5
+ letta_client/agents/client.py,sha256=kldj19HcO2hBnK63JAjjOgvXiFtLPqDJHtLiGH2Jez8,105561
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
@@ -71,7 +71,7 @@ letta_client/client_side_access_tokens/types/client_side_access_tokens_list_clie
71
71
  letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy_data_item_access_item.py,sha256=kNHfEWFl7u71Pu8NPqutod0a2NXfvq8il05Hqm0iBB4,284
72
72
  letta_client/core/__init__.py,sha256=OKbX2aCZXgHCDUsCouqv-OiX32xA6eFFCKIUH9M5Vzk,1591
73
73
  letta_client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
74
- letta_client/core/client_wrapper.py,sha256=r6Ehui45BX8Tlp4JpiBrqR2EIoqQ8nrRHyv4jTZl3E4,2336
74
+ letta_client/core/client_wrapper.py,sha256=SIn7ocTMfx1OCdi4IwH89ObYyjgnLVblqu4aN2WVYIU,2336
75
75
  letta_client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
76
76
  letta_client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
77
77
  letta_client/core/http_client.py,sha256=Z77OIxIbL4OAB2IDqjRq_sYa5yNYAWfmdhdCSSvh6Y4,19552
@@ -175,7 +175,7 @@ letta_client/types/action_response_model.py,sha256=yq2Fd9UU8j7vvtE3VqXUoRRvDzWcf
175
175
  letta_client/types/agent_environment_variable.py,sha256=vutZLcR0yETltgOZ7E_o9kR4vOdBxybVL9lzXSux75w,1698
176
176
  letta_client/types/agent_schema.py,sha256=uTSjFAsnEYdOX-PRD2vHbn69JBe8GKbctvlDOP85k_U,1784
177
177
  letta_client/types/agent_schema_tool_rules_item.py,sha256=TTP7uKYPSe-EAl4p03j0Kd-W9tG5T6gfaWIUBAOVv9U,482
178
- letta_client/types/agent_state.py,sha256=gPxUWHg-Ie8q2PAfHezDxtz4SQfEirH_r69DSQ7-u9M,6059
178
+ letta_client/types/agent_state.py,sha256=FmBHvNc8H6Az8_8N0wpI4tH9syDkfd0i3JCgHofyFWo,6546
179
179
  letta_client/types/agent_state_response_format.py,sha256=HISBgCumQxw6nQeDUMBu-IlghaLeWRb7BHHNaz_e8Hc,377
180
180
  letta_client/types/agent_state_tool_rules_item.py,sha256=jyh3KFcVWnw2kcDgr3M4aXagXpVshOoMRhoC6JhDaSM,728
181
181
  letta_client/types/agent_type.py,sha256=4_JSgy0zfiqtUcKh5XMfRDYaablo4RuzUmIstRZ2FsI,370
@@ -428,6 +428,6 @@ letta_client/types/web_search_options_user_location_approximate.py,sha256=Ywk01J
428
428
  letta_client/version.py,sha256=bttKLbIhO3UonCYQlqs600zzbQgfhCCMjeXR9WRzid4,79
429
429
  letta_client/voice/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
430
430
  letta_client/voice/client.py,sha256=47iQYCuW_qpKI4hM3pYVxn3hw7kgQj3emU1_oRpkRMA,5811
431
- letta_client-0.1.209.dist-info/METADATA,sha256=SG9uezLJR2D399F48IGwJtS5N2CHn-qgSOink5D-PM0,5177
432
- letta_client-0.1.209.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
433
- letta_client-0.1.209.dist-info/RECORD,,
431
+ letta_client-0.1.211.dist-info/METADATA,sha256=Z3nu0XWyw56Jbt9gxpL73nTA_lJkv_40QP9FhFuqzWE,5177
432
+ letta_client-0.1.211.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
433
+ letta_client-0.1.211.dist-info/RECORD,,