letta-client 0.1.187__py3-none-any.whl → 0.1.188__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/agents/client.py +132 -0
- letta_client/core/client_wrapper.py +1 -1
- {letta_client-0.1.187.dist-info → letta_client-0.1.188.dist-info}/METADATA +1 -1
- {letta_client-0.1.187.dist-info → letta_client-0.1.188.dist-info}/RECORD +5 -5
- {letta_client-0.1.187.dist-info → letta_client-0.1.188.dist-info}/WHEEL +0 -0
letta_client/agents/client.py
CHANGED
|
@@ -999,6 +999,68 @@ class AgentsClient:
|
|
|
999
999
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1000
1000
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1001
1001
|
|
|
1002
|
+
def close_all_open_files(
|
|
1003
|
+
self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
1004
|
+
) -> typing.List[str]:
|
|
1005
|
+
"""
|
|
1006
|
+
Closes all currently open files for a given agent.
|
|
1007
|
+
|
|
1008
|
+
This endpoint updates the file state for the agent so that no files are marked as open.
|
|
1009
|
+
Typically used to reset the working memory view for the agent.
|
|
1010
|
+
|
|
1011
|
+
Parameters
|
|
1012
|
+
----------
|
|
1013
|
+
agent_id : str
|
|
1014
|
+
|
|
1015
|
+
request_options : typing.Optional[RequestOptions]
|
|
1016
|
+
Request-specific configuration.
|
|
1017
|
+
|
|
1018
|
+
Returns
|
|
1019
|
+
-------
|
|
1020
|
+
typing.List[str]
|
|
1021
|
+
Successful Response
|
|
1022
|
+
|
|
1023
|
+
Examples
|
|
1024
|
+
--------
|
|
1025
|
+
from letta_client import Letta
|
|
1026
|
+
|
|
1027
|
+
client = Letta(
|
|
1028
|
+
project="YOUR_PROJECT",
|
|
1029
|
+
token="YOUR_TOKEN",
|
|
1030
|
+
)
|
|
1031
|
+
client.agents.close_all_open_files(
|
|
1032
|
+
agent_id="agent_id",
|
|
1033
|
+
)
|
|
1034
|
+
"""
|
|
1035
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
1036
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/files/close-all",
|
|
1037
|
+
method="PATCH",
|
|
1038
|
+
request_options=request_options,
|
|
1039
|
+
)
|
|
1040
|
+
try:
|
|
1041
|
+
if 200 <= _response.status_code < 300:
|
|
1042
|
+
return typing.cast(
|
|
1043
|
+
typing.List[str],
|
|
1044
|
+
construct_type(
|
|
1045
|
+
type_=typing.List[str], # type: ignore
|
|
1046
|
+
object_=_response.json(),
|
|
1047
|
+
),
|
|
1048
|
+
)
|
|
1049
|
+
if _response.status_code == 422:
|
|
1050
|
+
raise UnprocessableEntityError(
|
|
1051
|
+
typing.cast(
|
|
1052
|
+
HttpValidationError,
|
|
1053
|
+
construct_type(
|
|
1054
|
+
type_=HttpValidationError, # type: ignore
|
|
1055
|
+
object_=_response.json(),
|
|
1056
|
+
),
|
|
1057
|
+
)
|
|
1058
|
+
)
|
|
1059
|
+
_response_json = _response.json()
|
|
1060
|
+
except JSONDecodeError:
|
|
1061
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1062
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1063
|
+
|
|
1002
1064
|
def summarize_agent_conversation(
|
|
1003
1065
|
self, agent_id: str, *, max_message_length: int, request_options: typing.Optional[RequestOptions] = None
|
|
1004
1066
|
) -> AgentState:
|
|
@@ -2166,6 +2228,76 @@ class AsyncAgentsClient:
|
|
|
2166
2228
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
2167
2229
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
2168
2230
|
|
|
2231
|
+
async def close_all_open_files(
|
|
2232
|
+
self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
2233
|
+
) -> typing.List[str]:
|
|
2234
|
+
"""
|
|
2235
|
+
Closes all currently open files for a given agent.
|
|
2236
|
+
|
|
2237
|
+
This endpoint updates the file state for the agent so that no files are marked as open.
|
|
2238
|
+
Typically used to reset the working memory view for the agent.
|
|
2239
|
+
|
|
2240
|
+
Parameters
|
|
2241
|
+
----------
|
|
2242
|
+
agent_id : str
|
|
2243
|
+
|
|
2244
|
+
request_options : typing.Optional[RequestOptions]
|
|
2245
|
+
Request-specific configuration.
|
|
2246
|
+
|
|
2247
|
+
Returns
|
|
2248
|
+
-------
|
|
2249
|
+
typing.List[str]
|
|
2250
|
+
Successful Response
|
|
2251
|
+
|
|
2252
|
+
Examples
|
|
2253
|
+
--------
|
|
2254
|
+
import asyncio
|
|
2255
|
+
|
|
2256
|
+
from letta_client import AsyncLetta
|
|
2257
|
+
|
|
2258
|
+
client = AsyncLetta(
|
|
2259
|
+
project="YOUR_PROJECT",
|
|
2260
|
+
token="YOUR_TOKEN",
|
|
2261
|
+
)
|
|
2262
|
+
|
|
2263
|
+
|
|
2264
|
+
async def main() -> None:
|
|
2265
|
+
await client.agents.close_all_open_files(
|
|
2266
|
+
agent_id="agent_id",
|
|
2267
|
+
)
|
|
2268
|
+
|
|
2269
|
+
|
|
2270
|
+
asyncio.run(main())
|
|
2271
|
+
"""
|
|
2272
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
2273
|
+
f"v1/agents/{jsonable_encoder(agent_id)}/files/close-all",
|
|
2274
|
+
method="PATCH",
|
|
2275
|
+
request_options=request_options,
|
|
2276
|
+
)
|
|
2277
|
+
try:
|
|
2278
|
+
if 200 <= _response.status_code < 300:
|
|
2279
|
+
return typing.cast(
|
|
2280
|
+
typing.List[str],
|
|
2281
|
+
construct_type(
|
|
2282
|
+
type_=typing.List[str], # type: ignore
|
|
2283
|
+
object_=_response.json(),
|
|
2284
|
+
),
|
|
2285
|
+
)
|
|
2286
|
+
if _response.status_code == 422:
|
|
2287
|
+
raise UnprocessableEntityError(
|
|
2288
|
+
typing.cast(
|
|
2289
|
+
HttpValidationError,
|
|
2290
|
+
construct_type(
|
|
2291
|
+
type_=HttpValidationError, # type: ignore
|
|
2292
|
+
object_=_response.json(),
|
|
2293
|
+
),
|
|
2294
|
+
)
|
|
2295
|
+
)
|
|
2296
|
+
_response_json = _response.json()
|
|
2297
|
+
except JSONDecodeError:
|
|
2298
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
2299
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
2300
|
+
|
|
2169
2301
|
async def summarize_agent_conversation(
|
|
2170
2302
|
self, agent_id: str, *, max_message_length: int, request_options: typing.Optional[RequestOptions] = None
|
|
2171
2303
|
) -> 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.
|
|
27
|
+
"X-Fern-SDK-Version": "0.1.188",
|
|
28
28
|
}
|
|
29
29
|
if self._project is not None:
|
|
30
30
|
headers["X-Project"] = self._project
|
|
@@ -2,7 +2,7 @@ letta_client/__init__.py,sha256=qJr7FK3esCAtlSArEc7x1oXME3Eo_eyGJb2MxXE0oRY,1812
|
|
|
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=
|
|
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
|
|
@@ -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=
|
|
68
|
+
letta_client/core/client_wrapper.py,sha256=oB_S7J3NfdLa_T2UD9s14p8y3930PmlR4Z9RYwZiZZw,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
|
|
@@ -415,6 +415,6 @@ letta_client/types/web_search_options_user_location_approximate.py,sha256=Ywk01J
|
|
|
415
415
|
letta_client/version.py,sha256=bttKLbIhO3UonCYQlqs600zzbQgfhCCMjeXR9WRzid4,79
|
|
416
416
|
letta_client/voice/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
417
417
|
letta_client/voice/client.py,sha256=47iQYCuW_qpKI4hM3pYVxn3hw7kgQj3emU1_oRpkRMA,5811
|
|
418
|
-
letta_client-0.1.
|
|
419
|
-
letta_client-0.1.
|
|
420
|
-
letta_client-0.1.
|
|
418
|
+
letta_client-0.1.188.dist-info/METADATA,sha256=TEkQ5V_UrMFFUnhCY6eoYmSUg35MedSSfdkuIuhHwTM,5177
|
|
419
|
+
letta_client-0.1.188.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
|
420
|
+
letta_client-0.1.188.dist-info/RECORD,,
|
|
File without changes
|