letta-client 0.1.182__py3-none-any.whl → 0.1.183__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/core/client_wrapper.py +1 -1
- letta_client/steps/client.py +0 -145
- letta_client/steps/feedback/client.py +75 -10
- {letta_client-0.1.182.dist-info → letta_client-0.1.183.dist-info}/METADATA +1 -1
- {letta_client-0.1.182.dist-info → letta_client-0.1.183.dist-info}/RECORD +6 -6
- {letta_client-0.1.182.dist-info → letta_client-0.1.183.dist-info}/WHEEL +0 -0
|
@@ -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.183",
|
|
28
28
|
}
|
|
29
29
|
if self._project is not None:
|
|
30
30
|
headers["X-Project"] = self._project
|
letta_client/steps/client.py
CHANGED
|
@@ -12,7 +12,6 @@ from ..types.http_validation_error import HttpValidationError
|
|
|
12
12
|
from json.decoder import JSONDecodeError
|
|
13
13
|
from ..core.api_error import ApiError
|
|
14
14
|
from ..core.jsonable_encoder import jsonable_encoder
|
|
15
|
-
from ..types.feedback_type import FeedbackType
|
|
16
15
|
from ..core.client_wrapper import AsyncClientWrapper
|
|
17
16
|
from .feedback.client import AsyncFeedbackClient
|
|
18
17
|
|
|
@@ -199,74 +198,6 @@ class StepsClient:
|
|
|
199
198
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
200
199
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
201
200
|
|
|
202
|
-
def add_feedback(
|
|
203
|
-
self,
|
|
204
|
-
step_id: str,
|
|
205
|
-
*,
|
|
206
|
-
feedback: typing.Optional[FeedbackType] = None,
|
|
207
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
208
|
-
) -> Step:
|
|
209
|
-
"""
|
|
210
|
-
Add feedback to a step.
|
|
211
|
-
|
|
212
|
-
Parameters
|
|
213
|
-
----------
|
|
214
|
-
step_id : str
|
|
215
|
-
|
|
216
|
-
feedback : typing.Optional[FeedbackType]
|
|
217
|
-
|
|
218
|
-
request_options : typing.Optional[RequestOptions]
|
|
219
|
-
Request-specific configuration.
|
|
220
|
-
|
|
221
|
-
Returns
|
|
222
|
-
-------
|
|
223
|
-
Step
|
|
224
|
-
Successful Response
|
|
225
|
-
|
|
226
|
-
Examples
|
|
227
|
-
--------
|
|
228
|
-
from letta_client import Letta
|
|
229
|
-
|
|
230
|
-
client = Letta(
|
|
231
|
-
project="YOUR_PROJECT",
|
|
232
|
-
token="YOUR_TOKEN",
|
|
233
|
-
)
|
|
234
|
-
client.steps.add_feedback(
|
|
235
|
-
step_id="step_id",
|
|
236
|
-
)
|
|
237
|
-
"""
|
|
238
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
239
|
-
f"v1/steps/{jsonable_encoder(step_id)}/feedback",
|
|
240
|
-
method="PATCH",
|
|
241
|
-
params={
|
|
242
|
-
"feedback": feedback,
|
|
243
|
-
},
|
|
244
|
-
request_options=request_options,
|
|
245
|
-
)
|
|
246
|
-
try:
|
|
247
|
-
if 200 <= _response.status_code < 300:
|
|
248
|
-
return typing.cast(
|
|
249
|
-
Step,
|
|
250
|
-
construct_type(
|
|
251
|
-
type_=Step, # type: ignore
|
|
252
|
-
object_=_response.json(),
|
|
253
|
-
),
|
|
254
|
-
)
|
|
255
|
-
if _response.status_code == 422:
|
|
256
|
-
raise UnprocessableEntityError(
|
|
257
|
-
typing.cast(
|
|
258
|
-
HttpValidationError,
|
|
259
|
-
construct_type(
|
|
260
|
-
type_=HttpValidationError, # type: ignore
|
|
261
|
-
object_=_response.json(),
|
|
262
|
-
),
|
|
263
|
-
)
|
|
264
|
-
)
|
|
265
|
-
_response_json = _response.json()
|
|
266
|
-
except JSONDecodeError:
|
|
267
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
268
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
269
|
-
|
|
270
201
|
|
|
271
202
|
class AsyncStepsClient:
|
|
272
203
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -465,79 +396,3 @@ class AsyncStepsClient:
|
|
|
465
396
|
except JSONDecodeError:
|
|
466
397
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
467
398
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
468
|
-
|
|
469
|
-
async def add_feedback(
|
|
470
|
-
self,
|
|
471
|
-
step_id: str,
|
|
472
|
-
*,
|
|
473
|
-
feedback: typing.Optional[FeedbackType] = None,
|
|
474
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
475
|
-
) -> Step:
|
|
476
|
-
"""
|
|
477
|
-
Add feedback to a step.
|
|
478
|
-
|
|
479
|
-
Parameters
|
|
480
|
-
----------
|
|
481
|
-
step_id : str
|
|
482
|
-
|
|
483
|
-
feedback : typing.Optional[FeedbackType]
|
|
484
|
-
|
|
485
|
-
request_options : typing.Optional[RequestOptions]
|
|
486
|
-
Request-specific configuration.
|
|
487
|
-
|
|
488
|
-
Returns
|
|
489
|
-
-------
|
|
490
|
-
Step
|
|
491
|
-
Successful Response
|
|
492
|
-
|
|
493
|
-
Examples
|
|
494
|
-
--------
|
|
495
|
-
import asyncio
|
|
496
|
-
|
|
497
|
-
from letta_client import AsyncLetta
|
|
498
|
-
|
|
499
|
-
client = AsyncLetta(
|
|
500
|
-
project="YOUR_PROJECT",
|
|
501
|
-
token="YOUR_TOKEN",
|
|
502
|
-
)
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
async def main() -> None:
|
|
506
|
-
await client.steps.add_feedback(
|
|
507
|
-
step_id="step_id",
|
|
508
|
-
)
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
asyncio.run(main())
|
|
512
|
-
"""
|
|
513
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
514
|
-
f"v1/steps/{jsonable_encoder(step_id)}/feedback",
|
|
515
|
-
method="PATCH",
|
|
516
|
-
params={
|
|
517
|
-
"feedback": feedback,
|
|
518
|
-
},
|
|
519
|
-
request_options=request_options,
|
|
520
|
-
)
|
|
521
|
-
try:
|
|
522
|
-
if 200 <= _response.status_code < 300:
|
|
523
|
-
return typing.cast(
|
|
524
|
-
Step,
|
|
525
|
-
construct_type(
|
|
526
|
-
type_=Step, # type: ignore
|
|
527
|
-
object_=_response.json(),
|
|
528
|
-
),
|
|
529
|
-
)
|
|
530
|
-
if _response.status_code == 422:
|
|
531
|
-
raise UnprocessableEntityError(
|
|
532
|
-
typing.cast(
|
|
533
|
-
HttpValidationError,
|
|
534
|
-
construct_type(
|
|
535
|
-
type_=HttpValidationError, # type: ignore
|
|
536
|
-
object_=_response.json(),
|
|
537
|
-
),
|
|
538
|
-
)
|
|
539
|
-
)
|
|
540
|
-
_response_json = _response.json()
|
|
541
|
-
except JSONDecodeError:
|
|
542
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
543
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
from ...core.client_wrapper import SyncClientWrapper
|
|
4
4
|
import typing
|
|
5
|
+
from ...types.feedback_type import FeedbackType
|
|
5
6
|
from ...core.request_options import RequestOptions
|
|
7
|
+
from ...types.step import Step
|
|
6
8
|
from ...core.jsonable_encoder import jsonable_encoder
|
|
9
|
+
from ...core.unchecked_base_model import construct_type
|
|
10
|
+
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
11
|
+
from ...types.http_validation_error import HttpValidationError
|
|
7
12
|
from json.decoder import JSONDecodeError
|
|
8
13
|
from ...core.api_error import ApiError
|
|
9
14
|
from ...core.client_wrapper import AsyncClientWrapper
|
|
@@ -13,18 +18,29 @@ class FeedbackClient:
|
|
|
13
18
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
14
19
|
self._client_wrapper = client_wrapper
|
|
15
20
|
|
|
16
|
-
def
|
|
21
|
+
def create(
|
|
22
|
+
self,
|
|
23
|
+
step_id: str,
|
|
24
|
+
*,
|
|
25
|
+
feedback: typing.Optional[FeedbackType] = None,
|
|
26
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
27
|
+
) -> Step:
|
|
17
28
|
"""
|
|
29
|
+
Add feedback to a step.
|
|
30
|
+
|
|
18
31
|
Parameters
|
|
19
32
|
----------
|
|
20
33
|
step_id : str
|
|
21
34
|
|
|
35
|
+
feedback : typing.Optional[FeedbackType]
|
|
36
|
+
|
|
22
37
|
request_options : typing.Optional[RequestOptions]
|
|
23
38
|
Request-specific configuration.
|
|
24
39
|
|
|
25
40
|
Returns
|
|
26
41
|
-------
|
|
27
|
-
|
|
42
|
+
Step
|
|
43
|
+
Successful Response
|
|
28
44
|
|
|
29
45
|
Examples
|
|
30
46
|
--------
|
|
@@ -34,18 +50,37 @@ class FeedbackClient:
|
|
|
34
50
|
project="YOUR_PROJECT",
|
|
35
51
|
token="YOUR_TOKEN",
|
|
36
52
|
)
|
|
37
|
-
client.steps.feedback.
|
|
53
|
+
client.steps.feedback.create(
|
|
38
54
|
step_id="step_id",
|
|
39
55
|
)
|
|
40
56
|
"""
|
|
41
57
|
_response = self._client_wrapper.httpx_client.request(
|
|
42
58
|
f"v1/steps/{jsonable_encoder(step_id)}/feedback",
|
|
43
|
-
method="
|
|
59
|
+
method="PATCH",
|
|
60
|
+
params={
|
|
61
|
+
"feedback": feedback,
|
|
62
|
+
},
|
|
44
63
|
request_options=request_options,
|
|
45
64
|
)
|
|
46
65
|
try:
|
|
47
66
|
if 200 <= _response.status_code < 300:
|
|
48
|
-
return
|
|
67
|
+
return typing.cast(
|
|
68
|
+
Step,
|
|
69
|
+
construct_type(
|
|
70
|
+
type_=Step, # type: ignore
|
|
71
|
+
object_=_response.json(),
|
|
72
|
+
),
|
|
73
|
+
)
|
|
74
|
+
if _response.status_code == 422:
|
|
75
|
+
raise UnprocessableEntityError(
|
|
76
|
+
typing.cast(
|
|
77
|
+
HttpValidationError,
|
|
78
|
+
construct_type(
|
|
79
|
+
type_=HttpValidationError, # type: ignore
|
|
80
|
+
object_=_response.json(),
|
|
81
|
+
),
|
|
82
|
+
)
|
|
83
|
+
)
|
|
49
84
|
_response_json = _response.json()
|
|
50
85
|
except JSONDecodeError:
|
|
51
86
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -56,18 +91,29 @@ class AsyncFeedbackClient:
|
|
|
56
91
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
57
92
|
self._client_wrapper = client_wrapper
|
|
58
93
|
|
|
59
|
-
async def
|
|
94
|
+
async def create(
|
|
95
|
+
self,
|
|
96
|
+
step_id: str,
|
|
97
|
+
*,
|
|
98
|
+
feedback: typing.Optional[FeedbackType] = None,
|
|
99
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
100
|
+
) -> Step:
|
|
60
101
|
"""
|
|
102
|
+
Add feedback to a step.
|
|
103
|
+
|
|
61
104
|
Parameters
|
|
62
105
|
----------
|
|
63
106
|
step_id : str
|
|
64
107
|
|
|
108
|
+
feedback : typing.Optional[FeedbackType]
|
|
109
|
+
|
|
65
110
|
request_options : typing.Optional[RequestOptions]
|
|
66
111
|
Request-specific configuration.
|
|
67
112
|
|
|
68
113
|
Returns
|
|
69
114
|
-------
|
|
70
|
-
|
|
115
|
+
Step
|
|
116
|
+
Successful Response
|
|
71
117
|
|
|
72
118
|
Examples
|
|
73
119
|
--------
|
|
@@ -82,7 +128,7 @@ class AsyncFeedbackClient:
|
|
|
82
128
|
|
|
83
129
|
|
|
84
130
|
async def main() -> None:
|
|
85
|
-
await client.steps.feedback.
|
|
131
|
+
await client.steps.feedback.create(
|
|
86
132
|
step_id="step_id",
|
|
87
133
|
)
|
|
88
134
|
|
|
@@ -91,12 +137,31 @@ class AsyncFeedbackClient:
|
|
|
91
137
|
"""
|
|
92
138
|
_response = await self._client_wrapper.httpx_client.request(
|
|
93
139
|
f"v1/steps/{jsonable_encoder(step_id)}/feedback",
|
|
94
|
-
method="
|
|
140
|
+
method="PATCH",
|
|
141
|
+
params={
|
|
142
|
+
"feedback": feedback,
|
|
143
|
+
},
|
|
95
144
|
request_options=request_options,
|
|
96
145
|
)
|
|
97
146
|
try:
|
|
98
147
|
if 200 <= _response.status_code < 300:
|
|
99
|
-
return
|
|
148
|
+
return typing.cast(
|
|
149
|
+
Step,
|
|
150
|
+
construct_type(
|
|
151
|
+
type_=Step, # type: ignore
|
|
152
|
+
object_=_response.json(),
|
|
153
|
+
),
|
|
154
|
+
)
|
|
155
|
+
if _response.status_code == 422:
|
|
156
|
+
raise UnprocessableEntityError(
|
|
157
|
+
typing.cast(
|
|
158
|
+
HttpValidationError,
|
|
159
|
+
construct_type(
|
|
160
|
+
type_=HttpValidationError, # type: ignore
|
|
161
|
+
object_=_response.json(),
|
|
162
|
+
),
|
|
163
|
+
)
|
|
164
|
+
)
|
|
100
165
|
_response_json = _response.json()
|
|
101
166
|
except JSONDecodeError:
|
|
102
167
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -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=a0Nk_ZqULgLhVP-Wta3BZ5x_HoX_lDOLnfElO8Q5sXA,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
|
|
@@ -132,9 +132,9 @@ letta_client/sources/files/client.py,sha256=xyK22UrVGMqHSKR7HNM8YrSY2RUgcI4u_PrV
|
|
|
132
132
|
letta_client/sources/passages/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
133
133
|
letta_client/sources/passages/client.py,sha256=G1WtDHHd5RTImEIGMEZ5XXKg3HQQ__y2g6adcKpndfw,6041
|
|
134
134
|
letta_client/steps/__init__.py,sha256=Vitg85t2RrFWGxc4yqPbmd1dDZ44L0A1cnQFVTGRDCw,184
|
|
135
|
-
letta_client/steps/client.py,sha256=
|
|
135
|
+
letta_client/steps/client.py,sha256=YppOqkbvMTWKSIYValpaWjN_QeuSmA9SqQ1KfBvnlQY,13470
|
|
136
136
|
letta_client/steps/feedback/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
137
|
-
letta_client/steps/feedback/client.py,sha256=
|
|
137
|
+
letta_client/steps/feedback/client.py,sha256=F4815wJRjXnBrAT9_1l3C-HQ4anSzC1RVLl_HKaGM_U,5111
|
|
138
138
|
letta_client/steps/types/__init__.py,sha256=afgL6YcS_8FJ3Syf7DwWW82CmYDqb9zelSZpJ4Rt70o,171
|
|
139
139
|
letta_client/steps/types/steps_list_request_feedback.py,sha256=Au1YSn3UYRc_b4yxUT6hFqru4iJ-SX-_Ndb3PwCYGp8,172
|
|
140
140
|
letta_client/tags/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
@@ -414,6 +414,6 @@ letta_client/types/web_search_options_user_location_approximate.py,sha256=Ywk01J
|
|
|
414
414
|
letta_client/version.py,sha256=bttKLbIhO3UonCYQlqs600zzbQgfhCCMjeXR9WRzid4,79
|
|
415
415
|
letta_client/voice/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
416
416
|
letta_client/voice/client.py,sha256=47iQYCuW_qpKI4hM3pYVxn3hw7kgQj3emU1_oRpkRMA,5811
|
|
417
|
-
letta_client-0.1.
|
|
418
|
-
letta_client-0.1.
|
|
419
|
-
letta_client-0.1.
|
|
417
|
+
letta_client-0.1.183.dist-info/METADATA,sha256=9qTdf7KsGz2XxtpCv40GutrClPNijCBl_jLFe0kmcDI,5177
|
|
418
|
+
letta_client-0.1.183.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
|
419
|
+
letta_client-0.1.183.dist-info/RECORD,,
|
|
File without changes
|