letta-client 0.1.202__py3-none-any.whl → 0.1.204__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 +10 -0
- letta_client/client_side_access_tokens/__init__.py +10 -0
- letta_client/client_side_access_tokens/client.py +162 -3
- letta_client/client_side_access_tokens/types/__init__.py +20 -0
- letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response.py +25 -0
- letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item.py +27 -0
- letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy.py +23 -0
- letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy_data_item.py +24 -0
- 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 +7 -0
- letta_client/core/client_wrapper.py +1 -1
- letta_client/sources/client.py +126 -0
- {letta_client-0.1.202.dist-info → letta_client-0.1.204.dist-info}/METADATA +1 -1
- {letta_client-0.1.202.dist-info → letta_client-0.1.204.dist-info}/RECORD +14 -9
- {letta_client-0.1.202.dist-info → letta_client-0.1.204.dist-info}/WHEEL +0 -0
letta_client/__init__.py
CHANGED
|
@@ -313,6 +313,11 @@ from .client_side_access_tokens import (
|
|
|
313
313
|
ClientSideAccessTokensCreateResponsePolicy,
|
|
314
314
|
ClientSideAccessTokensCreateResponsePolicyDataItem,
|
|
315
315
|
ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem,
|
|
316
|
+
ClientSideAccessTokensListClientSideAccessTokensResponse,
|
|
317
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem,
|
|
318
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy,
|
|
319
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem,
|
|
320
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem,
|
|
316
321
|
)
|
|
317
322
|
from .environment import LettaEnvironment
|
|
318
323
|
from .groups import GroupCreateManagerConfig, GroupUpdateManagerConfig
|
|
@@ -406,6 +411,11 @@ __all__ = [
|
|
|
406
411
|
"ClientSideAccessTokensCreateResponsePolicy",
|
|
407
412
|
"ClientSideAccessTokensCreateResponsePolicyDataItem",
|
|
408
413
|
"ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem",
|
|
414
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponse",
|
|
415
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem",
|
|
416
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy",
|
|
417
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem",
|
|
418
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem",
|
|
409
419
|
"CodeInput",
|
|
410
420
|
"CompletionCreateParamsNonStreaming",
|
|
411
421
|
"CompletionCreateParamsNonStreamingFunctionCall",
|
|
@@ -7,6 +7,11 @@ from .types import (
|
|
|
7
7
|
ClientSideAccessTokensCreateResponsePolicy,
|
|
8
8
|
ClientSideAccessTokensCreateResponsePolicyDataItem,
|
|
9
9
|
ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem,
|
|
10
|
+
ClientSideAccessTokensListClientSideAccessTokensResponse,
|
|
11
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem,
|
|
12
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy,
|
|
13
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem,
|
|
14
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem,
|
|
10
15
|
)
|
|
11
16
|
|
|
12
17
|
__all__ = [
|
|
@@ -16,4 +21,9 @@ __all__ = [
|
|
|
16
21
|
"ClientSideAccessTokensCreateResponsePolicy",
|
|
17
22
|
"ClientSideAccessTokensCreateResponsePolicyDataItem",
|
|
18
23
|
"ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem",
|
|
24
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponse",
|
|
25
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem",
|
|
26
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy",
|
|
27
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem",
|
|
28
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem",
|
|
19
29
|
]
|
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
from ..core.client_wrapper import SyncClientWrapper
|
|
5
|
-
from .types.client_side_access_tokens_create_request_policy_item import ClientSideAccessTokensCreateRequestPolicyItem
|
|
6
5
|
from ..core.request_options import RequestOptions
|
|
7
|
-
from .types.
|
|
8
|
-
|
|
6
|
+
from .types.client_side_access_tokens_list_client_side_access_tokens_response import (
|
|
7
|
+
ClientSideAccessTokensListClientSideAccessTokensResponse,
|
|
8
|
+
)
|
|
9
9
|
from ..core.unchecked_base_model import construct_type
|
|
10
10
|
from ..errors.bad_request_error import BadRequestError
|
|
11
11
|
from json.decoder import JSONDecodeError
|
|
12
12
|
from ..core.api_error import ApiError
|
|
13
|
+
from .types.client_side_access_tokens_create_request_policy_item import ClientSideAccessTokensCreateRequestPolicyItem
|
|
14
|
+
from .types.client_side_access_tokens_create_response import ClientSideAccessTokensCreateResponse
|
|
15
|
+
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
13
16
|
from ..core.jsonable_encoder import jsonable_encoder
|
|
14
17
|
from ..core.client_wrapper import AsyncClientWrapper
|
|
15
18
|
|
|
@@ -21,6 +24,80 @@ class ClientSideAccessTokensClient:
|
|
|
21
24
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
22
25
|
self._client_wrapper = client_wrapper
|
|
23
26
|
|
|
27
|
+
def client_side_access_tokens_list_client_side_access_tokens(
|
|
28
|
+
self,
|
|
29
|
+
*,
|
|
30
|
+
agent_id: typing.Optional[str] = None,
|
|
31
|
+
offset: typing.Optional[float] = None,
|
|
32
|
+
limit: typing.Optional[float] = None,
|
|
33
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
34
|
+
) -> ClientSideAccessTokensListClientSideAccessTokensResponse:
|
|
35
|
+
"""
|
|
36
|
+
List all client side access tokens for the current account. This is only available for cloud users.
|
|
37
|
+
|
|
38
|
+
Parameters
|
|
39
|
+
----------
|
|
40
|
+
agent_id : typing.Optional[str]
|
|
41
|
+
The agent ID to filter tokens by. If provided, only tokens for this agent will be returned.
|
|
42
|
+
|
|
43
|
+
offset : typing.Optional[float]
|
|
44
|
+
The offset for pagination. Defaults to 0.
|
|
45
|
+
|
|
46
|
+
limit : typing.Optional[float]
|
|
47
|
+
The number of tokens to return per page. Defaults to 10.
|
|
48
|
+
|
|
49
|
+
request_options : typing.Optional[RequestOptions]
|
|
50
|
+
Request-specific configuration.
|
|
51
|
+
|
|
52
|
+
Returns
|
|
53
|
+
-------
|
|
54
|
+
ClientSideAccessTokensListClientSideAccessTokensResponse
|
|
55
|
+
200
|
|
56
|
+
|
|
57
|
+
Examples
|
|
58
|
+
--------
|
|
59
|
+
from letta_client import Letta
|
|
60
|
+
|
|
61
|
+
client = Letta(
|
|
62
|
+
project="YOUR_PROJECT",
|
|
63
|
+
token="YOUR_TOKEN",
|
|
64
|
+
)
|
|
65
|
+
client.client_side_access_tokens.client_side_access_tokens_list_client_side_access_tokens()
|
|
66
|
+
"""
|
|
67
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
68
|
+
"v1/client-side-access-tokens",
|
|
69
|
+
method="GET",
|
|
70
|
+
params={
|
|
71
|
+
"agentId": agent_id,
|
|
72
|
+
"offset": offset,
|
|
73
|
+
"limit": limit,
|
|
74
|
+
},
|
|
75
|
+
request_options=request_options,
|
|
76
|
+
)
|
|
77
|
+
try:
|
|
78
|
+
if 200 <= _response.status_code < 300:
|
|
79
|
+
return typing.cast(
|
|
80
|
+
ClientSideAccessTokensListClientSideAccessTokensResponse,
|
|
81
|
+
construct_type(
|
|
82
|
+
type_=ClientSideAccessTokensListClientSideAccessTokensResponse, # type: ignore
|
|
83
|
+
object_=_response.json(),
|
|
84
|
+
),
|
|
85
|
+
)
|
|
86
|
+
if _response.status_code == 400:
|
|
87
|
+
raise BadRequestError(
|
|
88
|
+
typing.cast(
|
|
89
|
+
typing.Optional[typing.Any],
|
|
90
|
+
construct_type(
|
|
91
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
92
|
+
object_=_response.json(),
|
|
93
|
+
),
|
|
94
|
+
)
|
|
95
|
+
)
|
|
96
|
+
_response_json = _response.json()
|
|
97
|
+
except JSONDecodeError:
|
|
98
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
99
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
100
|
+
|
|
24
101
|
def create(
|
|
25
102
|
self,
|
|
26
103
|
*,
|
|
@@ -187,6 +264,88 @@ class AsyncClientSideAccessTokensClient:
|
|
|
187
264
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
188
265
|
self._client_wrapper = client_wrapper
|
|
189
266
|
|
|
267
|
+
async def client_side_access_tokens_list_client_side_access_tokens(
|
|
268
|
+
self,
|
|
269
|
+
*,
|
|
270
|
+
agent_id: typing.Optional[str] = None,
|
|
271
|
+
offset: typing.Optional[float] = None,
|
|
272
|
+
limit: typing.Optional[float] = None,
|
|
273
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
274
|
+
) -> ClientSideAccessTokensListClientSideAccessTokensResponse:
|
|
275
|
+
"""
|
|
276
|
+
List all client side access tokens for the current account. This is only available for cloud users.
|
|
277
|
+
|
|
278
|
+
Parameters
|
|
279
|
+
----------
|
|
280
|
+
agent_id : typing.Optional[str]
|
|
281
|
+
The agent ID to filter tokens by. If provided, only tokens for this agent will be returned.
|
|
282
|
+
|
|
283
|
+
offset : typing.Optional[float]
|
|
284
|
+
The offset for pagination. Defaults to 0.
|
|
285
|
+
|
|
286
|
+
limit : typing.Optional[float]
|
|
287
|
+
The number of tokens to return per page. Defaults to 10.
|
|
288
|
+
|
|
289
|
+
request_options : typing.Optional[RequestOptions]
|
|
290
|
+
Request-specific configuration.
|
|
291
|
+
|
|
292
|
+
Returns
|
|
293
|
+
-------
|
|
294
|
+
ClientSideAccessTokensListClientSideAccessTokensResponse
|
|
295
|
+
200
|
|
296
|
+
|
|
297
|
+
Examples
|
|
298
|
+
--------
|
|
299
|
+
import asyncio
|
|
300
|
+
|
|
301
|
+
from letta_client import AsyncLetta
|
|
302
|
+
|
|
303
|
+
client = AsyncLetta(
|
|
304
|
+
project="YOUR_PROJECT",
|
|
305
|
+
token="YOUR_TOKEN",
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
async def main() -> None:
|
|
310
|
+
await client.client_side_access_tokens.client_side_access_tokens_list_client_side_access_tokens()
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
asyncio.run(main())
|
|
314
|
+
"""
|
|
315
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
316
|
+
"v1/client-side-access-tokens",
|
|
317
|
+
method="GET",
|
|
318
|
+
params={
|
|
319
|
+
"agentId": agent_id,
|
|
320
|
+
"offset": offset,
|
|
321
|
+
"limit": limit,
|
|
322
|
+
},
|
|
323
|
+
request_options=request_options,
|
|
324
|
+
)
|
|
325
|
+
try:
|
|
326
|
+
if 200 <= _response.status_code < 300:
|
|
327
|
+
return typing.cast(
|
|
328
|
+
ClientSideAccessTokensListClientSideAccessTokensResponse,
|
|
329
|
+
construct_type(
|
|
330
|
+
type_=ClientSideAccessTokensListClientSideAccessTokensResponse, # type: ignore
|
|
331
|
+
object_=_response.json(),
|
|
332
|
+
),
|
|
333
|
+
)
|
|
334
|
+
if _response.status_code == 400:
|
|
335
|
+
raise BadRequestError(
|
|
336
|
+
typing.cast(
|
|
337
|
+
typing.Optional[typing.Any],
|
|
338
|
+
construct_type(
|
|
339
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
340
|
+
object_=_response.json(),
|
|
341
|
+
),
|
|
342
|
+
)
|
|
343
|
+
)
|
|
344
|
+
_response_json = _response.json()
|
|
345
|
+
except JSONDecodeError:
|
|
346
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
347
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
348
|
+
|
|
190
349
|
async def create(
|
|
191
350
|
self,
|
|
192
351
|
*,
|
|
@@ -12,6 +12,21 @@ from .client_side_access_tokens_create_response_policy_data_item import (
|
|
|
12
12
|
from .client_side_access_tokens_create_response_policy_data_item_access_item import (
|
|
13
13
|
ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem,
|
|
14
14
|
)
|
|
15
|
+
from .client_side_access_tokens_list_client_side_access_tokens_response import (
|
|
16
|
+
ClientSideAccessTokensListClientSideAccessTokensResponse,
|
|
17
|
+
)
|
|
18
|
+
from .client_side_access_tokens_list_client_side_access_tokens_response_tokens_item import (
|
|
19
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem,
|
|
20
|
+
)
|
|
21
|
+
from .client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy import (
|
|
22
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy,
|
|
23
|
+
)
|
|
24
|
+
from .client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy_data_item import (
|
|
25
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem,
|
|
26
|
+
)
|
|
27
|
+
from .client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy_data_item_access_item import (
|
|
28
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem,
|
|
29
|
+
)
|
|
15
30
|
|
|
16
31
|
__all__ = [
|
|
17
32
|
"ClientSideAccessTokensCreateRequestPolicyItem",
|
|
@@ -20,4 +35,9 @@ __all__ = [
|
|
|
20
35
|
"ClientSideAccessTokensCreateResponsePolicy",
|
|
21
36
|
"ClientSideAccessTokensCreateResponsePolicyDataItem",
|
|
22
37
|
"ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem",
|
|
38
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponse",
|
|
39
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem",
|
|
40
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy",
|
|
41
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem",
|
|
42
|
+
"ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem",
|
|
23
43
|
]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from .client_side_access_tokens_list_client_side_access_tokens_response_tokens_item import (
|
|
6
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem,
|
|
7
|
+
)
|
|
8
|
+
import typing_extensions
|
|
9
|
+
from ...core.serialization import FieldMetadata
|
|
10
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
11
|
+
import pydantic
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ClientSideAccessTokensListClientSideAccessTokensResponse(UncheckedBaseModel):
|
|
15
|
+
tokens: typing.List[ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem]
|
|
16
|
+
has_next_page: typing_extensions.Annotated[bool, FieldMetadata(alias="hasNextPage")]
|
|
17
|
+
|
|
18
|
+
if IS_PYDANTIC_V2:
|
|
19
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
20
|
+
else:
|
|
21
|
+
|
|
22
|
+
class Config:
|
|
23
|
+
frozen = True
|
|
24
|
+
smart_union = True
|
|
25
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
from .client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy import (
|
|
5
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy,
|
|
6
|
+
)
|
|
7
|
+
import typing_extensions
|
|
8
|
+
from ...core.serialization import FieldMetadata
|
|
9
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
10
|
+
import typing
|
|
11
|
+
import pydantic
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ClientSideAccessTokensListClientSideAccessTokensResponseTokensItem(UncheckedBaseModel):
|
|
15
|
+
policy: ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy
|
|
16
|
+
token: str
|
|
17
|
+
hostname: str
|
|
18
|
+
expires_at: typing_extensions.Annotated[str, FieldMetadata(alias="expiresAt")]
|
|
19
|
+
|
|
20
|
+
if IS_PYDANTIC_V2:
|
|
21
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
22
|
+
else:
|
|
23
|
+
|
|
24
|
+
class Config:
|
|
25
|
+
frozen = True
|
|
26
|
+
smart_union = True
|
|
27
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from .client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy_data_item import (
|
|
6
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem,
|
|
7
|
+
)
|
|
8
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
|
+
import pydantic
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicy(UncheckedBaseModel):
|
|
13
|
+
version: typing.Literal["1"] = "1"
|
|
14
|
+
data: typing.List[ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem]
|
|
15
|
+
|
|
16
|
+
if IS_PYDANTIC_V2:
|
|
17
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
18
|
+
else:
|
|
19
|
+
|
|
20
|
+
class Config:
|
|
21
|
+
frozen = True
|
|
22
|
+
smart_union = True
|
|
23
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from .client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy_data_item_access_item import (
|
|
6
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem,
|
|
7
|
+
)
|
|
8
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
|
+
import pydantic
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItem(UncheckedBaseModel):
|
|
13
|
+
type: typing.Literal["agent"] = "agent"
|
|
14
|
+
id: str
|
|
15
|
+
access: typing.List[ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem]
|
|
16
|
+
|
|
17
|
+
if IS_PYDANTIC_V2:
|
|
18
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
19
|
+
else:
|
|
20
|
+
|
|
21
|
+
class Config:
|
|
22
|
+
frozen = True
|
|
23
|
+
smart_union = True
|
|
24
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
ClientSideAccessTokensListClientSideAccessTokensResponseTokensItemPolicyDataItemAccessItem = typing.Union[
|
|
6
|
+
typing.Literal["read_messages", "write_messages", "read_agent", "write_agent"], typing.Any
|
|
7
|
+
]
|
|
@@ -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.204",
|
|
28
28
|
}
|
|
29
29
|
if self._project is not None:
|
|
30
30
|
headers["X-Project"] = self._project
|
letta_client/sources/client.py
CHANGED
|
@@ -575,6 +575,65 @@ class SourcesClient:
|
|
|
575
575
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
576
576
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
577
577
|
|
|
578
|
+
def get_agents_for_source(
|
|
579
|
+
self, source_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
580
|
+
) -> typing.List[str]:
|
|
581
|
+
"""
|
|
582
|
+
Get all agent IDs that have the specified source attached.
|
|
583
|
+
|
|
584
|
+
Parameters
|
|
585
|
+
----------
|
|
586
|
+
source_id : str
|
|
587
|
+
|
|
588
|
+
request_options : typing.Optional[RequestOptions]
|
|
589
|
+
Request-specific configuration.
|
|
590
|
+
|
|
591
|
+
Returns
|
|
592
|
+
-------
|
|
593
|
+
typing.List[str]
|
|
594
|
+
Successful Response
|
|
595
|
+
|
|
596
|
+
Examples
|
|
597
|
+
--------
|
|
598
|
+
from letta_client import Letta
|
|
599
|
+
|
|
600
|
+
client = Letta(
|
|
601
|
+
project="YOUR_PROJECT",
|
|
602
|
+
token="YOUR_TOKEN",
|
|
603
|
+
)
|
|
604
|
+
client.sources.get_agents_for_source(
|
|
605
|
+
source_id="source_id",
|
|
606
|
+
)
|
|
607
|
+
"""
|
|
608
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
609
|
+
f"v1/sources/{jsonable_encoder(source_id)}/agents",
|
|
610
|
+
method="GET",
|
|
611
|
+
request_options=request_options,
|
|
612
|
+
)
|
|
613
|
+
try:
|
|
614
|
+
if 200 <= _response.status_code < 300:
|
|
615
|
+
return typing.cast(
|
|
616
|
+
typing.List[str],
|
|
617
|
+
construct_type(
|
|
618
|
+
type_=typing.List[str], # type: ignore
|
|
619
|
+
object_=_response.json(),
|
|
620
|
+
),
|
|
621
|
+
)
|
|
622
|
+
if _response.status_code == 422:
|
|
623
|
+
raise UnprocessableEntityError(
|
|
624
|
+
typing.cast(
|
|
625
|
+
HttpValidationError,
|
|
626
|
+
construct_type(
|
|
627
|
+
type_=HttpValidationError, # type: ignore
|
|
628
|
+
object_=_response.json(),
|
|
629
|
+
),
|
|
630
|
+
)
|
|
631
|
+
)
|
|
632
|
+
_response_json = _response.json()
|
|
633
|
+
except JSONDecodeError:
|
|
634
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
635
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
636
|
+
|
|
578
637
|
def get_file_metadata(
|
|
579
638
|
self,
|
|
580
639
|
source_id: str,
|
|
@@ -1266,6 +1325,73 @@ class AsyncSourcesClient:
|
|
|
1266
1325
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1267
1326
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1268
1327
|
|
|
1328
|
+
async def get_agents_for_source(
|
|
1329
|
+
self, source_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
1330
|
+
) -> typing.List[str]:
|
|
1331
|
+
"""
|
|
1332
|
+
Get all agent IDs that have the specified source attached.
|
|
1333
|
+
|
|
1334
|
+
Parameters
|
|
1335
|
+
----------
|
|
1336
|
+
source_id : str
|
|
1337
|
+
|
|
1338
|
+
request_options : typing.Optional[RequestOptions]
|
|
1339
|
+
Request-specific configuration.
|
|
1340
|
+
|
|
1341
|
+
Returns
|
|
1342
|
+
-------
|
|
1343
|
+
typing.List[str]
|
|
1344
|
+
Successful Response
|
|
1345
|
+
|
|
1346
|
+
Examples
|
|
1347
|
+
--------
|
|
1348
|
+
import asyncio
|
|
1349
|
+
|
|
1350
|
+
from letta_client import AsyncLetta
|
|
1351
|
+
|
|
1352
|
+
client = AsyncLetta(
|
|
1353
|
+
project="YOUR_PROJECT",
|
|
1354
|
+
token="YOUR_TOKEN",
|
|
1355
|
+
)
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
async def main() -> None:
|
|
1359
|
+
await client.sources.get_agents_for_source(
|
|
1360
|
+
source_id="source_id",
|
|
1361
|
+
)
|
|
1362
|
+
|
|
1363
|
+
|
|
1364
|
+
asyncio.run(main())
|
|
1365
|
+
"""
|
|
1366
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1367
|
+
f"v1/sources/{jsonable_encoder(source_id)}/agents",
|
|
1368
|
+
method="GET",
|
|
1369
|
+
request_options=request_options,
|
|
1370
|
+
)
|
|
1371
|
+
try:
|
|
1372
|
+
if 200 <= _response.status_code < 300:
|
|
1373
|
+
return typing.cast(
|
|
1374
|
+
typing.List[str],
|
|
1375
|
+
construct_type(
|
|
1376
|
+
type_=typing.List[str], # type: ignore
|
|
1377
|
+
object_=_response.json(),
|
|
1378
|
+
),
|
|
1379
|
+
)
|
|
1380
|
+
if _response.status_code == 422:
|
|
1381
|
+
raise UnprocessableEntityError(
|
|
1382
|
+
typing.cast(
|
|
1383
|
+
HttpValidationError,
|
|
1384
|
+
construct_type(
|
|
1385
|
+
type_=HttpValidationError, # type: ignore
|
|
1386
|
+
object_=_response.json(),
|
|
1387
|
+
),
|
|
1388
|
+
)
|
|
1389
|
+
)
|
|
1390
|
+
_response_json = _response.json()
|
|
1391
|
+
except JSONDecodeError:
|
|
1392
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1393
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1394
|
+
|
|
1269
1395
|
async def get_file_metadata(
|
|
1270
1396
|
self,
|
|
1271
1397
|
source_id: str,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
letta_client/__init__.py,sha256=
|
|
1
|
+
letta_client/__init__.py,sha256=DpCoPhi5qy7K-MmczqULa30OTff96XkneWc4tYISq_8,19164
|
|
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
|
|
@@ -55,18 +55,23 @@ letta_client/blocks/agents/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roe
|
|
|
55
55
|
letta_client/blocks/agents/client.py,sha256=2mBOt6CZanLUi_8Nc-bthaGoKhU3WgSA9vL1UjMdZE8,6066
|
|
56
56
|
letta_client/blocks/client.py,sha256=N4wZjI0gCDOQDgquwAnV9FfVPUudxo-js5AEzW8rJz0,32107
|
|
57
57
|
letta_client/client.py,sha256=iXqKTuQ0F9jIjkTwD73apLlLQqUF1IF6V_PhenY_CJo,22470
|
|
58
|
-
letta_client/client_side_access_tokens/__init__.py,sha256=
|
|
59
|
-
letta_client/client_side_access_tokens/client.py,sha256=
|
|
60
|
-
letta_client/client_side_access_tokens/types/__init__.py,sha256=
|
|
58
|
+
letta_client/client_side_access_tokens/__init__.py,sha256=e9NgxUsEnfbJVCM2npPuQ02dAS5jlXmneqU9DS6Q3d8,1561
|
|
59
|
+
letta_client/client_side_access_tokens/client.py,sha256=5aiqgKkzXElPgJszjyT-1wPRsBziH32UJwPVGQdZOFg,18215
|
|
60
|
+
letta_client/client_side_access_tokens/types/__init__.py,sha256=5wrSw59ckv2ZcwykPDixKyA63ca18tFXVCuMqa2Id5A,2468
|
|
61
61
|
letta_client/client_side_access_tokens/types/client_side_access_tokens_create_request_policy_item.py,sha256=smxAMDV1BFWc7uhbozbDND1JZyeNlXtTjKruvV7YIn0,858
|
|
62
62
|
letta_client/client_side_access_tokens/types/client_side_access_tokens_create_request_policy_item_access_item.py,sha256=ejnkPwWqilHZzy96dzydpYrQffibuXmf3twLMDlFF-c,249
|
|
63
63
|
letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response.py,sha256=6hac9F2uq4b3u9vHFaS9QTbDuLJGB_hAj_I4Sqjk3_Y,918
|
|
64
64
|
letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy.py,sha256=5nS86FKcdZ3oPxTf6InJ83nD-kqtofNZjQZljWDW0j8,820
|
|
65
65
|
letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy_data_item.py,sha256=K1RROIkjY85q-Q-FyuVvnEtIG9qzQF4WZTI_07YcNgM,879
|
|
66
66
|
letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy_data_item_access_item.py,sha256=R-H25IpNp9feSrW8Yj3h9O3UTMVvFniQJElogKxLuoE,254
|
|
67
|
+
letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response.py,sha256=FjBE-w2tM3abZ_mscb6F6ls-7ZxFVh-UVvZBW7uwPMU,1010
|
|
68
|
+
letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item.py,sha256=aPs8SVTpowwNu8zHnh86H1_06I8nUyTeX9Hq_g0TpoU,1053
|
|
69
|
+
letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy.py,sha256=hBcu55FcnEgWk7R-zyBDsmzimuxCbIzwKxts4_Fx9VU,946
|
|
70
|
+
letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy_data_item.py,sha256=O4xNUIzBKmzMScVyjxuzzVFIc-ZzE7s-_UQVU8kf358,1005
|
|
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
|
|
67
72
|
letta_client/core/__init__.py,sha256=OKbX2aCZXgHCDUsCouqv-OiX32xA6eFFCKIUH9M5Vzk,1591
|
|
68
73
|
letta_client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
|
69
|
-
letta_client/core/client_wrapper.py,sha256=
|
|
74
|
+
letta_client/core/client_wrapper.py,sha256=rXRB6xkX4_Tn_LtzxXIumVsopIheROCNvkNJ42yY1qE,2336
|
|
70
75
|
letta_client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
|
71
76
|
letta_client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
|
72
77
|
letta_client/core/http_client.py,sha256=Z77OIxIbL4OAB2IDqjRq_sYa5yNYAWfmdhdCSSvh6Y4,19552
|
|
@@ -127,7 +132,7 @@ letta_client/runs/steps/client.py,sha256=KgpKM6tLn7CgnkUlUihLvxucw4PW4bb_8XPVaEb
|
|
|
127
132
|
letta_client/runs/usage/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
128
133
|
letta_client/runs/usage/client.py,sha256=LGJL8cPGaVfTG5OBi85KRbwvv3P_jQNehFq2Kg0xrC4,4738
|
|
129
134
|
letta_client/sources/__init__.py,sha256=kswgCv4UdkSVk1Y4tsMM1HadOwvhh_Fr96VTSMV4Umc,128
|
|
130
|
-
letta_client/sources/client.py,sha256=
|
|
135
|
+
letta_client/sources/client.py,sha256=Wzpoo1VfRGTygnnTVlT_9LPod5iU-BtX57hVggjZRdo,47706
|
|
131
136
|
letta_client/sources/files/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
132
137
|
letta_client/sources/files/client.py,sha256=6RgAo1778b1o_BLUZKDbdrSvhsLCvK_TnwFXBEUISpM,14659
|
|
133
138
|
letta_client/sources/passages/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
@@ -423,6 +428,6 @@ letta_client/types/web_search_options_user_location_approximate.py,sha256=Ywk01J
|
|
|
423
428
|
letta_client/version.py,sha256=bttKLbIhO3UonCYQlqs600zzbQgfhCCMjeXR9WRzid4,79
|
|
424
429
|
letta_client/voice/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
425
430
|
letta_client/voice/client.py,sha256=47iQYCuW_qpKI4hM3pYVxn3hw7kgQj3emU1_oRpkRMA,5811
|
|
426
|
-
letta_client-0.1.
|
|
427
|
-
letta_client-0.1.
|
|
428
|
-
letta_client-0.1.
|
|
431
|
+
letta_client-0.1.204.dist-info/METADATA,sha256=Vr49Ut2kVW4bHQwpPxkNe8Atk28LeXsqoUFgVxjtzL0,5177
|
|
432
|
+
letta_client-0.1.204.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
|
433
|
+
letta_client-0.1.204.dist-info/RECORD,,
|
|
File without changes
|