letta-client 0.1.122__py3-none-any.whl → 0.1.124__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 +18 -22
- letta_client/agents/client.py +4 -88
- letta_client/base_client.py +4 -12
- letta_client/batches/client.py +50 -8
- letta_client/client_side_access_tokens/__init__.py +12 -12
- letta_client/client_side_access_tokens/client.py +28 -32
- letta_client/client_side_access_tokens/types/__init__.py +15 -21
- letta_client/client_side_access_tokens/types/{client_side_access_tokens_create_client_side_access_token_request_policy_item.py → client_side_access_tokens_create_request_policy_item.py} +4 -4
- letta_client/client_side_access_tokens/types/{client_side_access_tokens_create_client_side_access_token_request_policy_item_access_item.py → client_side_access_tokens_create_request_policy_item_access_item.py} +1 -1
- letta_client/client_side_access_tokens/types/{client_side_access_tokens_create_client_side_access_token_response.py → client_side_access_tokens_create_response.py} +3 -5
- letta_client/client_side_access_tokens/types/{client_side_access_tokens_create_client_side_access_token_response_policy.py → client_side_access_tokens_create_response_policy.py} +4 -4
- letta_client/client_side_access_tokens/types/{client_side_access_tokens_create_client_side_access_token_response_policy_data_item.py → client_side_access_tokens_create_response_policy_data_item.py} +4 -4
- letta_client/client_side_access_tokens/types/{client_side_access_tokens_create_client_side_access_token_response_policy_data_item_access_item.py → client_side_access_tokens_create_response_policy_data_item_access_item.py} +1 -1
- letta_client/core/client_wrapper.py +1 -1
- letta_client/projects/__init__.py +2 -2
- letta_client/projects/client.py +13 -13
- letta_client/projects/types/__init__.py +3 -3
- letta_client/projects/types/{projects_list_projects_response.py → projects_list_response.py} +3 -3
- letta_client/projects/types/{projects_list_projects_response_projects_item.py → projects_list_response_projects_item.py} +1 -1
- letta_client/providers/client.py +20 -196
- letta_client/runs/client.py +4 -78
- letta_client/tags/client.py +85 -8
- letta_client/templates/__init__.py +2 -7
- letta_client/templates/client.py +13 -13
- letta_client/templates/types/__init__.py +3 -3
- letta_client/templates/types/{templates_list_templates_response.py → templates_list_response.py} +3 -3
- letta_client/templates/types/{templates_list_templates_response_templates_item.py → templates_list_response_templates_item.py} +1 -1
- {letta_client-0.1.122.dist-info → letta_client-0.1.124.dist-info}/METADATA +1 -1
- {letta_client-0.1.122.dist-info → letta_client-0.1.124.dist-info}/RECORD +30 -34
- letta_client/messages/__init__.py +0 -2
- letta_client/messages/client.py +0 -146
- letta_client/tag/__init__.py +0 -2
- letta_client/tag/client.py +0 -169
- {letta_client-0.1.122.dist-info → letta_client-0.1.124.dist-info}/WHEEL +0 -0
letta_client/__init__.py
CHANGED
|
@@ -232,14 +232,12 @@ from . import (
|
|
|
232
232
|
health,
|
|
233
233
|
identities,
|
|
234
234
|
jobs,
|
|
235
|
-
messages,
|
|
236
235
|
models,
|
|
237
236
|
projects,
|
|
238
237
|
providers,
|
|
239
238
|
runs,
|
|
240
239
|
sources,
|
|
241
240
|
steps,
|
|
242
|
-
tag,
|
|
243
241
|
tags,
|
|
244
242
|
templates,
|
|
245
243
|
tools,
|
|
@@ -258,17 +256,17 @@ from .agents import (
|
|
|
258
256
|
)
|
|
259
257
|
from .client import AsyncLetta, Letta
|
|
260
258
|
from .client_side_access_tokens import (
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
259
|
+
ClientSideAccessTokensCreateRequestPolicyItem,
|
|
260
|
+
ClientSideAccessTokensCreateRequestPolicyItemAccessItem,
|
|
261
|
+
ClientSideAccessTokensCreateResponse,
|
|
262
|
+
ClientSideAccessTokensCreateResponsePolicy,
|
|
263
|
+
ClientSideAccessTokensCreateResponsePolicyDataItem,
|
|
264
|
+
ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem,
|
|
267
265
|
)
|
|
268
266
|
from .environment import LettaEnvironment
|
|
269
267
|
from .groups import GroupCreateManagerConfig, GroupUpdateManagerConfig
|
|
270
|
-
from .projects import
|
|
271
|
-
from .templates import
|
|
268
|
+
from .projects import ProjectsListResponse, ProjectsListResponseProjectsItem
|
|
269
|
+
from .templates import TemplatesListResponse, TemplatesListResponseTemplatesItem
|
|
272
270
|
from .tools import (
|
|
273
271
|
AddMcpServerRequest,
|
|
274
272
|
AddMcpServerResponseItem,
|
|
@@ -343,12 +341,12 @@ __all__ = [
|
|
|
343
341
|
"ChatCompletionUserMessageParamContentItem",
|
|
344
342
|
"ChildToolRule",
|
|
345
343
|
"ChildToolRuleSchema",
|
|
346
|
-
"
|
|
347
|
-
"
|
|
348
|
-
"
|
|
349
|
-
"
|
|
350
|
-
"
|
|
351
|
-
"
|
|
344
|
+
"ClientSideAccessTokensCreateRequestPolicyItem",
|
|
345
|
+
"ClientSideAccessTokensCreateRequestPolicyItemAccessItem",
|
|
346
|
+
"ClientSideAccessTokensCreateResponse",
|
|
347
|
+
"ClientSideAccessTokensCreateResponsePolicy",
|
|
348
|
+
"ClientSideAccessTokensCreateResponsePolicyDataItem",
|
|
349
|
+
"ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem",
|
|
352
350
|
"CompletionCreateParamsNonStreaming",
|
|
353
351
|
"CompletionCreateParamsNonStreamingFunctionCall",
|
|
354
352
|
"CompletionCreateParamsNonStreamingMessagesItem",
|
|
@@ -460,8 +458,8 @@ __all__ = [
|
|
|
460
458
|
"ParentToolRule",
|
|
461
459
|
"Passage",
|
|
462
460
|
"PipRequirement",
|
|
463
|
-
"
|
|
464
|
-
"
|
|
461
|
+
"ProjectsListResponse",
|
|
462
|
+
"ProjectsListResponseProjectsItem",
|
|
465
463
|
"Provider",
|
|
466
464
|
"ReasoningContent",
|
|
467
465
|
"ReasoningMessage",
|
|
@@ -492,8 +490,8 @@ __all__ = [
|
|
|
492
490
|
"SupervisorManagerUpdate",
|
|
493
491
|
"SystemMessage",
|
|
494
492
|
"TagSchema",
|
|
495
|
-
"
|
|
496
|
-
"
|
|
493
|
+
"TemplatesListResponse",
|
|
494
|
+
"TemplatesListResponseTemplatesItem",
|
|
497
495
|
"TerminalToolRule",
|
|
498
496
|
"TextContent",
|
|
499
497
|
"Tool",
|
|
@@ -542,14 +540,12 @@ __all__ = [
|
|
|
542
540
|
"health",
|
|
543
541
|
"identities",
|
|
544
542
|
"jobs",
|
|
545
|
-
"messages",
|
|
546
543
|
"models",
|
|
547
544
|
"projects",
|
|
548
545
|
"providers",
|
|
549
546
|
"runs",
|
|
550
547
|
"sources",
|
|
551
548
|
"steps",
|
|
552
|
-
"tag",
|
|
553
549
|
"tags",
|
|
554
550
|
"templates",
|
|
555
551
|
"tools",
|
letta_client/agents/client.py
CHANGED
|
@@ -448,7 +448,7 @@ class AgentsClient:
|
|
|
448
448
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
449
449
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
450
450
|
|
|
451
|
-
def
|
|
451
|
+
def export(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> str:
|
|
452
452
|
"""
|
|
453
453
|
Export the serialized JSON representation of an agent, formatted with indentation.
|
|
454
454
|
|
|
@@ -471,7 +471,7 @@ class AgentsClient:
|
|
|
471
471
|
client = Letta(
|
|
472
472
|
token="YOUR_TOKEN",
|
|
473
473
|
)
|
|
474
|
-
client.agents.
|
|
474
|
+
client.agents.export(
|
|
475
475
|
agent_id="agent_id",
|
|
476
476
|
)
|
|
477
477
|
"""
|
|
@@ -504,43 +504,6 @@ class AgentsClient:
|
|
|
504
504
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
505
505
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
506
506
|
|
|
507
|
-
def export(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
508
|
-
"""
|
|
509
|
-
Parameters
|
|
510
|
-
----------
|
|
511
|
-
agent_id : str
|
|
512
|
-
|
|
513
|
-
request_options : typing.Optional[RequestOptions]
|
|
514
|
-
Request-specific configuration.
|
|
515
|
-
|
|
516
|
-
Returns
|
|
517
|
-
-------
|
|
518
|
-
None
|
|
519
|
-
|
|
520
|
-
Examples
|
|
521
|
-
--------
|
|
522
|
-
from letta_client import Letta
|
|
523
|
-
|
|
524
|
-
client = Letta(
|
|
525
|
-
token="YOUR_TOKEN",
|
|
526
|
-
)
|
|
527
|
-
client.agents.export(
|
|
528
|
-
agent_id="agent_id",
|
|
529
|
-
)
|
|
530
|
-
"""
|
|
531
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
532
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/export",
|
|
533
|
-
method="POST",
|
|
534
|
-
request_options=request_options,
|
|
535
|
-
)
|
|
536
|
-
try:
|
|
537
|
-
if 200 <= _response.status_code < 300:
|
|
538
|
-
return
|
|
539
|
-
_response_json = _response.json()
|
|
540
|
-
except JSONDecodeError:
|
|
541
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
542
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
543
|
-
|
|
544
507
|
def import_(
|
|
545
508
|
self,
|
|
546
509
|
*,
|
|
@@ -1414,9 +1377,7 @@ class AsyncAgentsClient:
|
|
|
1414
1377
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1415
1378
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1416
1379
|
|
|
1417
|
-
async def
|
|
1418
|
-
self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
1419
|
-
) -> str:
|
|
1380
|
+
async def export(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> str:
|
|
1420
1381
|
"""
|
|
1421
1382
|
Export the serialized JSON representation of an agent, formatted with indentation.
|
|
1422
1383
|
|
|
@@ -1444,7 +1405,7 @@ class AsyncAgentsClient:
|
|
|
1444
1405
|
|
|
1445
1406
|
|
|
1446
1407
|
async def main() -> None:
|
|
1447
|
-
await client.agents.
|
|
1408
|
+
await client.agents.export(
|
|
1448
1409
|
agent_id="agent_id",
|
|
1449
1410
|
)
|
|
1450
1411
|
|
|
@@ -1480,51 +1441,6 @@ class AsyncAgentsClient:
|
|
|
1480
1441
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1481
1442
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1482
1443
|
|
|
1483
|
-
async def export(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
1484
|
-
"""
|
|
1485
|
-
Parameters
|
|
1486
|
-
----------
|
|
1487
|
-
agent_id : str
|
|
1488
|
-
|
|
1489
|
-
request_options : typing.Optional[RequestOptions]
|
|
1490
|
-
Request-specific configuration.
|
|
1491
|
-
|
|
1492
|
-
Returns
|
|
1493
|
-
-------
|
|
1494
|
-
None
|
|
1495
|
-
|
|
1496
|
-
Examples
|
|
1497
|
-
--------
|
|
1498
|
-
import asyncio
|
|
1499
|
-
|
|
1500
|
-
from letta_client import AsyncLetta
|
|
1501
|
-
|
|
1502
|
-
client = AsyncLetta(
|
|
1503
|
-
token="YOUR_TOKEN",
|
|
1504
|
-
)
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
async def main() -> None:
|
|
1508
|
-
await client.agents.export(
|
|
1509
|
-
agent_id="agent_id",
|
|
1510
|
-
)
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
asyncio.run(main())
|
|
1514
|
-
"""
|
|
1515
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
1516
|
-
f"v1/agents/{jsonable_encoder(agent_id)}/export",
|
|
1517
|
-
method="POST",
|
|
1518
|
-
request_options=request_options,
|
|
1519
|
-
)
|
|
1520
|
-
try:
|
|
1521
|
-
if 200 <= _response.status_code < 300:
|
|
1522
|
-
return
|
|
1523
|
-
_response_json = _response.json()
|
|
1524
|
-
except JSONDecodeError:
|
|
1525
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1526
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1527
|
-
|
|
1528
1444
|
async def import_(
|
|
1529
1445
|
self,
|
|
1530
1446
|
*,
|
letta_client/base_client.py
CHANGED
|
@@ -17,14 +17,12 @@ from .health.client import HealthClient
|
|
|
17
17
|
from .providers.client import ProvidersClient
|
|
18
18
|
from .runs.client import RunsClient
|
|
19
19
|
from .steps.client import StepsClient
|
|
20
|
-
from .
|
|
20
|
+
from .tags.client import TagsClient
|
|
21
21
|
from .batches.client import BatchesClient
|
|
22
|
-
from .messages.client import MessagesClient
|
|
23
22
|
from .voice.client import VoiceClient
|
|
24
23
|
from .templates.client import TemplatesClient
|
|
25
24
|
from .client_side_access_tokens.client import ClientSideAccessTokensClient
|
|
26
25
|
from .projects.client import ProjectsClient
|
|
27
|
-
from .tags.client import TagsClient
|
|
28
26
|
from .core.client_wrapper import AsyncClientWrapper
|
|
29
27
|
from .tools.client import AsyncToolsClient
|
|
30
28
|
from .sources.client import AsyncSourcesClient
|
|
@@ -39,14 +37,12 @@ from .health.client import AsyncHealthClient
|
|
|
39
37
|
from .providers.client import AsyncProvidersClient
|
|
40
38
|
from .runs.client import AsyncRunsClient
|
|
41
39
|
from .steps.client import AsyncStepsClient
|
|
42
|
-
from .
|
|
40
|
+
from .tags.client import AsyncTagsClient
|
|
43
41
|
from .batches.client import AsyncBatchesClient
|
|
44
|
-
from .messages.client import AsyncMessagesClient
|
|
45
42
|
from .voice.client import AsyncVoiceClient
|
|
46
43
|
from .templates.client import AsyncTemplatesClient
|
|
47
44
|
from .client_side_access_tokens.client import AsyncClientSideAccessTokensClient
|
|
48
45
|
from .projects.client import AsyncProjectsClient
|
|
49
|
-
from .tags.client import AsyncTagsClient
|
|
50
46
|
|
|
51
47
|
|
|
52
48
|
class LettaBase:
|
|
@@ -120,14 +116,12 @@ class LettaBase:
|
|
|
120
116
|
self.providers = ProvidersClient(client_wrapper=self._client_wrapper)
|
|
121
117
|
self.runs = RunsClient(client_wrapper=self._client_wrapper)
|
|
122
118
|
self.steps = StepsClient(client_wrapper=self._client_wrapper)
|
|
123
|
-
self.
|
|
119
|
+
self.tags = TagsClient(client_wrapper=self._client_wrapper)
|
|
124
120
|
self.batches = BatchesClient(client_wrapper=self._client_wrapper)
|
|
125
|
-
self.messages = MessagesClient(client_wrapper=self._client_wrapper)
|
|
126
121
|
self.voice = VoiceClient(client_wrapper=self._client_wrapper)
|
|
127
122
|
self.templates = TemplatesClient(client_wrapper=self._client_wrapper)
|
|
128
123
|
self.client_side_access_tokens = ClientSideAccessTokensClient(client_wrapper=self._client_wrapper)
|
|
129
124
|
self.projects = ProjectsClient(client_wrapper=self._client_wrapper)
|
|
130
|
-
self.tags = TagsClient(client_wrapper=self._client_wrapper)
|
|
131
125
|
|
|
132
126
|
|
|
133
127
|
class AsyncLettaBase:
|
|
@@ -201,14 +195,12 @@ class AsyncLettaBase:
|
|
|
201
195
|
self.providers = AsyncProvidersClient(client_wrapper=self._client_wrapper)
|
|
202
196
|
self.runs = AsyncRunsClient(client_wrapper=self._client_wrapper)
|
|
203
197
|
self.steps = AsyncStepsClient(client_wrapper=self._client_wrapper)
|
|
204
|
-
self.
|
|
198
|
+
self.tags = AsyncTagsClient(client_wrapper=self._client_wrapper)
|
|
205
199
|
self.batches = AsyncBatchesClient(client_wrapper=self._client_wrapper)
|
|
206
|
-
self.messages = AsyncMessagesClient(client_wrapper=self._client_wrapper)
|
|
207
200
|
self.voice = AsyncVoiceClient(client_wrapper=self._client_wrapper)
|
|
208
201
|
self.templates = AsyncTemplatesClient(client_wrapper=self._client_wrapper)
|
|
209
202
|
self.client_side_access_tokens = AsyncClientSideAccessTokensClient(client_wrapper=self._client_wrapper)
|
|
210
203
|
self.projects = AsyncProjectsClient(client_wrapper=self._client_wrapper)
|
|
211
|
-
self.tags = AsyncTagsClient(client_wrapper=self._client_wrapper)
|
|
212
204
|
|
|
213
205
|
|
|
214
206
|
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: LettaEnvironment) -> str:
|
letta_client/batches/client.py
CHANGED
|
@@ -221,8 +221,12 @@ class BatchesClient:
|
|
|
221
221
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
222
222
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
223
223
|
|
|
224
|
-
def cancel(
|
|
224
|
+
def cancel(
|
|
225
|
+
self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
226
|
+
) -> typing.Optional[typing.Any]:
|
|
225
227
|
"""
|
|
228
|
+
Cancel a batch run.
|
|
229
|
+
|
|
226
230
|
Parameters
|
|
227
231
|
----------
|
|
228
232
|
batch_id : str
|
|
@@ -232,7 +236,8 @@ class BatchesClient:
|
|
|
232
236
|
|
|
233
237
|
Returns
|
|
234
238
|
-------
|
|
235
|
-
|
|
239
|
+
typing.Optional[typing.Any]
|
|
240
|
+
Successful Response
|
|
236
241
|
|
|
237
242
|
Examples
|
|
238
243
|
--------
|
|
@@ -246,13 +251,29 @@ class BatchesClient:
|
|
|
246
251
|
)
|
|
247
252
|
"""
|
|
248
253
|
_response = self._client_wrapper.httpx_client.request(
|
|
249
|
-
f"v1/messages/batches/{jsonable_encoder(batch_id)}",
|
|
254
|
+
f"v1/messages/batches/{jsonable_encoder(batch_id)}/cancel",
|
|
250
255
|
method="PATCH",
|
|
251
256
|
request_options=request_options,
|
|
252
257
|
)
|
|
253
258
|
try:
|
|
254
259
|
if 200 <= _response.status_code < 300:
|
|
255
|
-
return
|
|
260
|
+
return typing.cast(
|
|
261
|
+
typing.Optional[typing.Any],
|
|
262
|
+
construct_type(
|
|
263
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
264
|
+
object_=_response.json(),
|
|
265
|
+
),
|
|
266
|
+
)
|
|
267
|
+
if _response.status_code == 422:
|
|
268
|
+
raise UnprocessableEntityError(
|
|
269
|
+
typing.cast(
|
|
270
|
+
HttpValidationError,
|
|
271
|
+
construct_type(
|
|
272
|
+
type_=HttpValidationError, # type: ignore
|
|
273
|
+
object_=_response.json(),
|
|
274
|
+
),
|
|
275
|
+
)
|
|
276
|
+
)
|
|
256
277
|
_response_json = _response.json()
|
|
257
278
|
except JSONDecodeError:
|
|
258
279
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -491,8 +512,12 @@ class AsyncBatchesClient:
|
|
|
491
512
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
492
513
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
493
514
|
|
|
494
|
-
async def cancel(
|
|
515
|
+
async def cancel(
|
|
516
|
+
self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
517
|
+
) -> typing.Optional[typing.Any]:
|
|
495
518
|
"""
|
|
519
|
+
Cancel a batch run.
|
|
520
|
+
|
|
496
521
|
Parameters
|
|
497
522
|
----------
|
|
498
523
|
batch_id : str
|
|
@@ -502,7 +527,8 @@ class AsyncBatchesClient:
|
|
|
502
527
|
|
|
503
528
|
Returns
|
|
504
529
|
-------
|
|
505
|
-
|
|
530
|
+
typing.Optional[typing.Any]
|
|
531
|
+
Successful Response
|
|
506
532
|
|
|
507
533
|
Examples
|
|
508
534
|
--------
|
|
@@ -524,13 +550,29 @@ class AsyncBatchesClient:
|
|
|
524
550
|
asyncio.run(main())
|
|
525
551
|
"""
|
|
526
552
|
_response = await self._client_wrapper.httpx_client.request(
|
|
527
|
-
f"v1/messages/batches/{jsonable_encoder(batch_id)}",
|
|
553
|
+
f"v1/messages/batches/{jsonable_encoder(batch_id)}/cancel",
|
|
528
554
|
method="PATCH",
|
|
529
555
|
request_options=request_options,
|
|
530
556
|
)
|
|
531
557
|
try:
|
|
532
558
|
if 200 <= _response.status_code < 300:
|
|
533
|
-
return
|
|
559
|
+
return typing.cast(
|
|
560
|
+
typing.Optional[typing.Any],
|
|
561
|
+
construct_type(
|
|
562
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
563
|
+
object_=_response.json(),
|
|
564
|
+
),
|
|
565
|
+
)
|
|
566
|
+
if _response.status_code == 422:
|
|
567
|
+
raise UnprocessableEntityError(
|
|
568
|
+
typing.cast(
|
|
569
|
+
HttpValidationError,
|
|
570
|
+
construct_type(
|
|
571
|
+
type_=HttpValidationError, # type: ignore
|
|
572
|
+
object_=_response.json(),
|
|
573
|
+
),
|
|
574
|
+
)
|
|
575
|
+
)
|
|
534
576
|
_response_json = _response.json()
|
|
535
577
|
except JSONDecodeError:
|
|
536
578
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
from .types import (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
ClientSideAccessTokensCreateRequestPolicyItem,
|
|
5
|
+
ClientSideAccessTokensCreateRequestPolicyItemAccessItem,
|
|
6
|
+
ClientSideAccessTokensCreateResponse,
|
|
7
|
+
ClientSideAccessTokensCreateResponsePolicy,
|
|
8
|
+
ClientSideAccessTokensCreateResponsePolicyDataItem,
|
|
9
|
+
ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem,
|
|
10
10
|
)
|
|
11
11
|
|
|
12
12
|
__all__ = [
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
13
|
+
"ClientSideAccessTokensCreateRequestPolicyItem",
|
|
14
|
+
"ClientSideAccessTokensCreateRequestPolicyItemAccessItem",
|
|
15
|
+
"ClientSideAccessTokensCreateResponse",
|
|
16
|
+
"ClientSideAccessTokensCreateResponsePolicy",
|
|
17
|
+
"ClientSideAccessTokensCreateResponsePolicyDataItem",
|
|
18
|
+
"ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem",
|
|
19
19
|
]
|
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
from ..core.client_wrapper import SyncClientWrapper
|
|
5
|
-
from .types.
|
|
6
|
-
ClientSideAccessTokensCreateClientSideAccessTokenRequestPolicyItem,
|
|
7
|
-
)
|
|
5
|
+
from .types.client_side_access_tokens_create_request_policy_item import ClientSideAccessTokensCreateRequestPolicyItem
|
|
8
6
|
from ..core.request_options import RequestOptions
|
|
9
|
-
from .types.
|
|
10
|
-
ClientSideAccessTokensCreateClientSideAccessTokenResponse,
|
|
11
|
-
)
|
|
7
|
+
from .types.client_side_access_tokens_create_response import ClientSideAccessTokensCreateResponse
|
|
12
8
|
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
13
9
|
from ..core.unchecked_base_model import construct_type
|
|
14
10
|
from ..errors.bad_request_error import BadRequestError
|
|
@@ -25,20 +21,20 @@ class ClientSideAccessTokensClient:
|
|
|
25
21
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
26
22
|
self._client_wrapper = client_wrapper
|
|
27
23
|
|
|
28
|
-
def
|
|
24
|
+
def create(
|
|
29
25
|
self,
|
|
30
26
|
*,
|
|
31
|
-
policy: typing.Sequence[
|
|
27
|
+
policy: typing.Sequence[ClientSideAccessTokensCreateRequestPolicyItem],
|
|
32
28
|
hostname: str,
|
|
33
29
|
expires_at: typing.Optional[str] = OMIT,
|
|
34
30
|
request_options: typing.Optional[RequestOptions] = None,
|
|
35
|
-
) ->
|
|
31
|
+
) -> ClientSideAccessTokensCreateResponse:
|
|
36
32
|
"""
|
|
37
33
|
Create a new client side access token with the specified configuration.
|
|
38
34
|
|
|
39
35
|
Parameters
|
|
40
36
|
----------
|
|
41
|
-
policy : typing.Sequence[
|
|
37
|
+
policy : typing.Sequence[ClientSideAccessTokensCreateRequestPolicyItem]
|
|
42
38
|
|
|
43
39
|
hostname : str
|
|
44
40
|
The hostname of the client side application. Please specify the full URL including the protocol (http or https).
|
|
@@ -51,22 +47,22 @@ class ClientSideAccessTokensClient:
|
|
|
51
47
|
|
|
52
48
|
Returns
|
|
53
49
|
-------
|
|
54
|
-
|
|
50
|
+
ClientSideAccessTokensCreateResponse
|
|
55
51
|
201
|
|
56
52
|
|
|
57
53
|
Examples
|
|
58
54
|
--------
|
|
59
55
|
from letta_client import Letta
|
|
60
56
|
from letta_client.client_side_access_tokens import (
|
|
61
|
-
|
|
57
|
+
ClientSideAccessTokensCreateRequestPolicyItem,
|
|
62
58
|
)
|
|
63
59
|
|
|
64
60
|
client = Letta(
|
|
65
61
|
token="YOUR_TOKEN",
|
|
66
62
|
)
|
|
67
|
-
client.client_side_access_tokens.
|
|
63
|
+
client.client_side_access_tokens.create(
|
|
68
64
|
policy=[
|
|
69
|
-
|
|
65
|
+
ClientSideAccessTokensCreateRequestPolicyItem(
|
|
70
66
|
id="id",
|
|
71
67
|
access=["read_messages"],
|
|
72
68
|
)
|
|
@@ -80,7 +76,7 @@ class ClientSideAccessTokensClient:
|
|
|
80
76
|
json={
|
|
81
77
|
"policy": convert_and_respect_annotation_metadata(
|
|
82
78
|
object_=policy,
|
|
83
|
-
annotation=typing.Sequence[
|
|
79
|
+
annotation=typing.Sequence[ClientSideAccessTokensCreateRequestPolicyItem],
|
|
84
80
|
direction="write",
|
|
85
81
|
),
|
|
86
82
|
"hostname": hostname,
|
|
@@ -95,9 +91,9 @@ class ClientSideAccessTokensClient:
|
|
|
95
91
|
try:
|
|
96
92
|
if 200 <= _response.status_code < 300:
|
|
97
93
|
return typing.cast(
|
|
98
|
-
|
|
94
|
+
ClientSideAccessTokensCreateResponse,
|
|
99
95
|
construct_type(
|
|
100
|
-
type_=
|
|
96
|
+
type_=ClientSideAccessTokensCreateResponse, # type: ignore
|
|
101
97
|
object_=_response.json(),
|
|
102
98
|
),
|
|
103
99
|
)
|
|
@@ -116,7 +112,7 @@ class ClientSideAccessTokensClient:
|
|
|
116
112
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
117
113
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
118
114
|
|
|
119
|
-
def
|
|
115
|
+
def delete(
|
|
120
116
|
self,
|
|
121
117
|
token: str,
|
|
122
118
|
*,
|
|
@@ -148,7 +144,7 @@ class ClientSideAccessTokensClient:
|
|
|
148
144
|
client = Letta(
|
|
149
145
|
token="YOUR_TOKEN",
|
|
150
146
|
)
|
|
151
|
-
client.client_side_access_tokens.
|
|
147
|
+
client.client_side_access_tokens.delete(
|
|
152
148
|
token="token",
|
|
153
149
|
request={"key": "value"},
|
|
154
150
|
)
|
|
@@ -189,20 +185,20 @@ class AsyncClientSideAccessTokensClient:
|
|
|
189
185
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
190
186
|
self._client_wrapper = client_wrapper
|
|
191
187
|
|
|
192
|
-
async def
|
|
188
|
+
async def create(
|
|
193
189
|
self,
|
|
194
190
|
*,
|
|
195
|
-
policy: typing.Sequence[
|
|
191
|
+
policy: typing.Sequence[ClientSideAccessTokensCreateRequestPolicyItem],
|
|
196
192
|
hostname: str,
|
|
197
193
|
expires_at: typing.Optional[str] = OMIT,
|
|
198
194
|
request_options: typing.Optional[RequestOptions] = None,
|
|
199
|
-
) ->
|
|
195
|
+
) -> ClientSideAccessTokensCreateResponse:
|
|
200
196
|
"""
|
|
201
197
|
Create a new client side access token with the specified configuration.
|
|
202
198
|
|
|
203
199
|
Parameters
|
|
204
200
|
----------
|
|
205
|
-
policy : typing.Sequence[
|
|
201
|
+
policy : typing.Sequence[ClientSideAccessTokensCreateRequestPolicyItem]
|
|
206
202
|
|
|
207
203
|
hostname : str
|
|
208
204
|
The hostname of the client side application. Please specify the full URL including the protocol (http or https).
|
|
@@ -215,7 +211,7 @@ class AsyncClientSideAccessTokensClient:
|
|
|
215
211
|
|
|
216
212
|
Returns
|
|
217
213
|
-------
|
|
218
|
-
|
|
214
|
+
ClientSideAccessTokensCreateResponse
|
|
219
215
|
201
|
|
220
216
|
|
|
221
217
|
Examples
|
|
@@ -224,7 +220,7 @@ class AsyncClientSideAccessTokensClient:
|
|
|
224
220
|
|
|
225
221
|
from letta_client import AsyncLetta
|
|
226
222
|
from letta_client.client_side_access_tokens import (
|
|
227
|
-
|
|
223
|
+
ClientSideAccessTokensCreateRequestPolicyItem,
|
|
228
224
|
)
|
|
229
225
|
|
|
230
226
|
client = AsyncLetta(
|
|
@@ -233,9 +229,9 @@ class AsyncClientSideAccessTokensClient:
|
|
|
233
229
|
|
|
234
230
|
|
|
235
231
|
async def main() -> None:
|
|
236
|
-
await client.client_side_access_tokens.
|
|
232
|
+
await client.client_side_access_tokens.create(
|
|
237
233
|
policy=[
|
|
238
|
-
|
|
234
|
+
ClientSideAccessTokensCreateRequestPolicyItem(
|
|
239
235
|
id="id",
|
|
240
236
|
access=["read_messages"],
|
|
241
237
|
)
|
|
@@ -252,7 +248,7 @@ class AsyncClientSideAccessTokensClient:
|
|
|
252
248
|
json={
|
|
253
249
|
"policy": convert_and_respect_annotation_metadata(
|
|
254
250
|
object_=policy,
|
|
255
|
-
annotation=typing.Sequence[
|
|
251
|
+
annotation=typing.Sequence[ClientSideAccessTokensCreateRequestPolicyItem],
|
|
256
252
|
direction="write",
|
|
257
253
|
),
|
|
258
254
|
"hostname": hostname,
|
|
@@ -267,9 +263,9 @@ class AsyncClientSideAccessTokensClient:
|
|
|
267
263
|
try:
|
|
268
264
|
if 200 <= _response.status_code < 300:
|
|
269
265
|
return typing.cast(
|
|
270
|
-
|
|
266
|
+
ClientSideAccessTokensCreateResponse,
|
|
271
267
|
construct_type(
|
|
272
|
-
type_=
|
|
268
|
+
type_=ClientSideAccessTokensCreateResponse, # type: ignore
|
|
273
269
|
object_=_response.json(),
|
|
274
270
|
),
|
|
275
271
|
)
|
|
@@ -288,7 +284,7 @@ class AsyncClientSideAccessTokensClient:
|
|
|
288
284
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
289
285
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
290
286
|
|
|
291
|
-
async def
|
|
287
|
+
async def delete(
|
|
292
288
|
self,
|
|
293
289
|
token: str,
|
|
294
290
|
*,
|
|
@@ -325,7 +321,7 @@ class AsyncClientSideAccessTokensClient:
|
|
|
325
321
|
|
|
326
322
|
|
|
327
323
|
async def main() -> None:
|
|
328
|
-
await client.client_side_access_tokens.
|
|
324
|
+
await client.client_side_access_tokens.delete(
|
|
329
325
|
token="token",
|
|
330
326
|
request={"key": "value"},
|
|
331
327
|
)
|