letta-client 0.1.16__py3-none-any.whl → 0.1.17__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 +0 -4
- letta_client/agents/__init__.py +1 -12
- letta_client/agents/archival_memory/client.py +7 -132
- letta_client/agents/client.py +14 -18
- letta_client/agents/core_memory/client.py +17 -144
- letta_client/agents/memory_variables/client.py +2 -2
- letta_client/agents/messages/client.py +12 -12
- letta_client/core/client_wrapper.py +1 -1
- letta_client/providers/client.py +74 -74
- letta_client/tools/client.py +0 -120
- letta_client/types/__init__.py +0 -4
- letta_client/types/embedding_config_embedding_endpoint_type.py +1 -0
- letta_client/types/letta_schemas_message_message.py +5 -0
- letta_client/types/llm_config_model_endpoint_type.py +1 -0
- {letta_client-0.1.16.dist-info → letta_client-0.1.17.dist-info}/METADATA +2 -2
- {letta_client-0.1.16.dist-info → letta_client-0.1.17.dist-info}/RECORD +17 -21
- letta_client/agents/recall_memory/__init__.py +0 -2
- letta_client/agents/recall_memory/client.py +0 -147
- letta_client/types/archival_memory_summary.py +0 -22
- letta_client/types/recall_memory_summary.py +0 -22
- {letta_client-0.1.16.dist-info → letta_client-0.1.17.dist-info}/WHEEL +0 -0
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
from ...core.client_wrapper import SyncClientWrapper
|
|
4
|
-
import typing
|
|
5
|
-
from ...core.request_options import RequestOptions
|
|
6
|
-
from ...types.recall_memory_summary import RecallMemorySummary
|
|
7
|
-
from ...core.jsonable_encoder import jsonable_encoder
|
|
8
|
-
from ...core.unchecked_base_model import construct_type
|
|
9
|
-
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
10
|
-
from ...types.http_validation_error import HttpValidationError
|
|
11
|
-
from json.decoder import JSONDecodeError
|
|
12
|
-
from ...core.api_error import ApiError
|
|
13
|
-
from ...core.client_wrapper import AsyncClientWrapper
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class RecallMemoryClient:
|
|
17
|
-
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
18
|
-
self._client_wrapper = client_wrapper
|
|
19
|
-
|
|
20
|
-
def get_summary(
|
|
21
|
-
self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
22
|
-
) -> RecallMemorySummary:
|
|
23
|
-
"""
|
|
24
|
-
Retrieve the summary of the recall memory of a specific agent.
|
|
25
|
-
|
|
26
|
-
Parameters
|
|
27
|
-
----------
|
|
28
|
-
agent_id : str
|
|
29
|
-
|
|
30
|
-
request_options : typing.Optional[RequestOptions]
|
|
31
|
-
Request-specific configuration.
|
|
32
|
-
|
|
33
|
-
Returns
|
|
34
|
-
-------
|
|
35
|
-
RecallMemorySummary
|
|
36
|
-
Successful Response
|
|
37
|
-
|
|
38
|
-
Examples
|
|
39
|
-
--------
|
|
40
|
-
from letta_client import Letta
|
|
41
|
-
|
|
42
|
-
client = Letta(
|
|
43
|
-
token="YOUR_TOKEN",
|
|
44
|
-
)
|
|
45
|
-
client.agents.recall_memory.get_summary(
|
|
46
|
-
agent_id="agent_id",
|
|
47
|
-
)
|
|
48
|
-
"""
|
|
49
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
50
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/memory/recall",
|
|
51
|
-
method="GET",
|
|
52
|
-
request_options=request_options,
|
|
53
|
-
)
|
|
54
|
-
try:
|
|
55
|
-
if 200 <= _response.status_code < 300:
|
|
56
|
-
return typing.cast(
|
|
57
|
-
RecallMemorySummary,
|
|
58
|
-
construct_type(
|
|
59
|
-
type_=RecallMemorySummary, # type: ignore
|
|
60
|
-
object_=_response.json(),
|
|
61
|
-
),
|
|
62
|
-
)
|
|
63
|
-
if _response.status_code == 422:
|
|
64
|
-
raise UnprocessableEntityError(
|
|
65
|
-
typing.cast(
|
|
66
|
-
HttpValidationError,
|
|
67
|
-
construct_type(
|
|
68
|
-
type_=HttpValidationError, # type: ignore
|
|
69
|
-
object_=_response.json(),
|
|
70
|
-
),
|
|
71
|
-
)
|
|
72
|
-
)
|
|
73
|
-
_response_json = _response.json()
|
|
74
|
-
except JSONDecodeError:
|
|
75
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
76
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
class AsyncRecallMemoryClient:
|
|
80
|
-
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
81
|
-
self._client_wrapper = client_wrapper
|
|
82
|
-
|
|
83
|
-
async def get_summary(
|
|
84
|
-
self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
85
|
-
) -> RecallMemorySummary:
|
|
86
|
-
"""
|
|
87
|
-
Retrieve the summary of the recall memory of a specific agent.
|
|
88
|
-
|
|
89
|
-
Parameters
|
|
90
|
-
----------
|
|
91
|
-
agent_id : str
|
|
92
|
-
|
|
93
|
-
request_options : typing.Optional[RequestOptions]
|
|
94
|
-
Request-specific configuration.
|
|
95
|
-
|
|
96
|
-
Returns
|
|
97
|
-
-------
|
|
98
|
-
RecallMemorySummary
|
|
99
|
-
Successful Response
|
|
100
|
-
|
|
101
|
-
Examples
|
|
102
|
-
--------
|
|
103
|
-
import asyncio
|
|
104
|
-
|
|
105
|
-
from letta_client import AsyncLetta
|
|
106
|
-
|
|
107
|
-
client = AsyncLetta(
|
|
108
|
-
token="YOUR_TOKEN",
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
async def main() -> None:
|
|
113
|
-
await client.agents.recall_memory.get_summary(
|
|
114
|
-
agent_id="agent_id",
|
|
115
|
-
)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
asyncio.run(main())
|
|
119
|
-
"""
|
|
120
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
121
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/memory/recall",
|
|
122
|
-
method="GET",
|
|
123
|
-
request_options=request_options,
|
|
124
|
-
)
|
|
125
|
-
try:
|
|
126
|
-
if 200 <= _response.status_code < 300:
|
|
127
|
-
return typing.cast(
|
|
128
|
-
RecallMemorySummary,
|
|
129
|
-
construct_type(
|
|
130
|
-
type_=RecallMemorySummary, # type: ignore
|
|
131
|
-
object_=_response.json(),
|
|
132
|
-
),
|
|
133
|
-
)
|
|
134
|
-
if _response.status_code == 422:
|
|
135
|
-
raise UnprocessableEntityError(
|
|
136
|
-
typing.cast(
|
|
137
|
-
HttpValidationError,
|
|
138
|
-
construct_type(
|
|
139
|
-
type_=HttpValidationError, # type: ignore
|
|
140
|
-
object_=_response.json(),
|
|
141
|
-
),
|
|
142
|
-
)
|
|
143
|
-
)
|
|
144
|
-
_response_json = _response.json()
|
|
145
|
-
except JSONDecodeError:
|
|
146
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
147
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
-
import pydantic
|
|
5
|
-
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
-
import typing
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ArchivalMemorySummary(UncheckedBaseModel):
|
|
10
|
-
size: int = pydantic.Field()
|
|
11
|
-
"""
|
|
12
|
-
Number of rows in archival memory
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
if IS_PYDANTIC_V2:
|
|
16
|
-
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
17
|
-
else:
|
|
18
|
-
|
|
19
|
-
class Config:
|
|
20
|
-
frozen = True
|
|
21
|
-
smart_union = True
|
|
22
|
-
extra = pydantic.Extra.allow
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
-
import pydantic
|
|
5
|
-
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
-
import typing
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class RecallMemorySummary(UncheckedBaseModel):
|
|
10
|
-
size: int = pydantic.Field()
|
|
11
|
-
"""
|
|
12
|
-
Number of rows in recall memory
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
if IS_PYDANTIC_V2:
|
|
16
|
-
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
17
|
-
else:
|
|
18
|
-
|
|
19
|
-
class Config:
|
|
20
|
-
frozen = True
|
|
21
|
-
smart_union = True
|
|
22
|
-
extra = pydantic.Extra.allow
|
|
File without changes
|