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
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from .
|
|
4
|
-
|
|
3
|
+
from .client_side_access_tokens_create_request_policy_item import ClientSideAccessTokensCreateRequestPolicyItem
|
|
4
|
+
from .client_side_access_tokens_create_request_policy_item_access_item import (
|
|
5
|
+
ClientSideAccessTokensCreateRequestPolicyItemAccessItem,
|
|
5
6
|
)
|
|
6
|
-
from .
|
|
7
|
-
|
|
7
|
+
from .client_side_access_tokens_create_response import ClientSideAccessTokensCreateResponse
|
|
8
|
+
from .client_side_access_tokens_create_response_policy import ClientSideAccessTokensCreateResponsePolicy
|
|
9
|
+
from .client_side_access_tokens_create_response_policy_data_item import (
|
|
10
|
+
ClientSideAccessTokensCreateResponsePolicyDataItem,
|
|
8
11
|
)
|
|
9
|
-
from .
|
|
10
|
-
|
|
11
|
-
)
|
|
12
|
-
from .client_side_access_tokens_create_client_side_access_token_response_policy import (
|
|
13
|
-
ClientSideAccessTokensCreateClientSideAccessTokenResponsePolicy,
|
|
14
|
-
)
|
|
15
|
-
from .client_side_access_tokens_create_client_side_access_token_response_policy_data_item import (
|
|
16
|
-
ClientSideAccessTokensCreateClientSideAccessTokenResponsePolicyDataItem,
|
|
17
|
-
)
|
|
18
|
-
from .client_side_access_tokens_create_client_side_access_token_response_policy_data_item_access_item import (
|
|
19
|
-
ClientSideAccessTokensCreateClientSideAccessTokenResponsePolicyDataItemAccessItem,
|
|
12
|
+
from .client_side_access_tokens_create_response_policy_data_item_access_item import (
|
|
13
|
+
ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem,
|
|
20
14
|
)
|
|
21
15
|
|
|
22
16
|
__all__ = [
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
17
|
+
"ClientSideAccessTokensCreateRequestPolicyItem",
|
|
18
|
+
"ClientSideAccessTokensCreateRequestPolicyItemAccessItem",
|
|
19
|
+
"ClientSideAccessTokensCreateResponse",
|
|
20
|
+
"ClientSideAccessTokensCreateResponsePolicy",
|
|
21
|
+
"ClientSideAccessTokensCreateResponsePolicyDataItem",
|
|
22
|
+
"ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem",
|
|
29
23
|
]
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
|
-
from .
|
|
6
|
-
|
|
5
|
+
from .client_side_access_tokens_create_request_policy_item_access_item import (
|
|
6
|
+
ClientSideAccessTokensCreateRequestPolicyItemAccessItem,
|
|
7
7
|
)
|
|
8
8
|
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
9
|
import pydantic
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class
|
|
12
|
+
class ClientSideAccessTokensCreateRequestPolicyItem(UncheckedBaseModel):
|
|
13
13
|
type: typing.Literal["agent"] = "agent"
|
|
14
14
|
id: str
|
|
15
|
-
access: typing.List[
|
|
15
|
+
access: typing.List[ClientSideAccessTokensCreateRequestPolicyItemAccessItem]
|
|
16
16
|
|
|
17
17
|
if IS_PYDANTIC_V2:
|
|
18
18
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
ClientSideAccessTokensCreateRequestPolicyItemAccessItem = typing.Union[
|
|
6
6
|
typing.Literal["read_messages", "write_messages", "read_agent", "write_agent"], typing.Any
|
|
7
7
|
]
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
-
from .
|
|
5
|
-
ClientSideAccessTokensCreateClientSideAccessTokenResponsePolicy,
|
|
6
|
-
)
|
|
4
|
+
from .client_side_access_tokens_create_response_policy import ClientSideAccessTokensCreateResponsePolicy
|
|
7
5
|
import typing_extensions
|
|
8
6
|
from ...core.serialization import FieldMetadata
|
|
9
7
|
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
@@ -11,8 +9,8 @@ import typing
|
|
|
11
9
|
import pydantic
|
|
12
10
|
|
|
13
11
|
|
|
14
|
-
class
|
|
15
|
-
policy:
|
|
12
|
+
class ClientSideAccessTokensCreateResponse(UncheckedBaseModel):
|
|
13
|
+
policy: ClientSideAccessTokensCreateResponsePolicy
|
|
16
14
|
token: str
|
|
17
15
|
hostname: str
|
|
18
16
|
expires_at: typing_extensions.Annotated[str, FieldMetadata(alias="expiresAt")]
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
|
-
from .
|
|
6
|
-
|
|
5
|
+
from .client_side_access_tokens_create_response_policy_data_item import (
|
|
6
|
+
ClientSideAccessTokensCreateResponsePolicyDataItem,
|
|
7
7
|
)
|
|
8
8
|
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
9
|
import pydantic
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class
|
|
12
|
+
class ClientSideAccessTokensCreateResponsePolicy(UncheckedBaseModel):
|
|
13
13
|
version: typing.Literal["1"] = "1"
|
|
14
|
-
data: typing.List[
|
|
14
|
+
data: typing.List[ClientSideAccessTokensCreateResponsePolicyDataItem]
|
|
15
15
|
|
|
16
16
|
if IS_PYDANTIC_V2:
|
|
17
17
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
|
-
from .
|
|
6
|
-
|
|
5
|
+
from .client_side_access_tokens_create_response_policy_data_item_access_item import (
|
|
6
|
+
ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem,
|
|
7
7
|
)
|
|
8
8
|
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
9
|
import pydantic
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class
|
|
12
|
+
class ClientSideAccessTokensCreateResponsePolicyDataItem(UncheckedBaseModel):
|
|
13
13
|
type: typing.Literal["agent"] = "agent"
|
|
14
14
|
id: str
|
|
15
|
-
access: typing.List[
|
|
15
|
+
access: typing.List[ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem]
|
|
16
16
|
|
|
17
17
|
if IS_PYDANTIC_V2:
|
|
18
18
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
ClientSideAccessTokensCreateResponsePolicyDataItemAccessItem = typing.Union[
|
|
6
6
|
typing.Literal["read_messages", "write_messages", "read_agent", "write_agent"], typing.Any
|
|
7
7
|
]
|
|
@@ -16,7 +16,7 @@ class BaseClientWrapper:
|
|
|
16
16
|
headers: typing.Dict[str, str] = {
|
|
17
17
|
"X-Fern-Language": "Python",
|
|
18
18
|
"X-Fern-SDK-Name": "letta-client",
|
|
19
|
-
"X-Fern-SDK-Version": "0.1.
|
|
19
|
+
"X-Fern-SDK-Version": "0.1.124",
|
|
20
20
|
}
|
|
21
21
|
if self.token is not None:
|
|
22
22
|
headers["Authorization"] = f"Bearer {self.token}"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from .types import
|
|
3
|
+
from .types import ProjectsListResponse, ProjectsListResponseProjectsItem
|
|
4
4
|
|
|
5
|
-
__all__ = ["
|
|
5
|
+
__all__ = ["ProjectsListResponse", "ProjectsListResponseProjectsItem"]
|
letta_client/projects/client.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from ..core.client_wrapper import SyncClientWrapper
|
|
4
4
|
import typing
|
|
5
5
|
from ..core.request_options import RequestOptions
|
|
6
|
-
from .types.
|
|
6
|
+
from .types.projects_list_response import ProjectsListResponse
|
|
7
7
|
from ..core.unchecked_base_model import construct_type
|
|
8
8
|
from json.decoder import JSONDecodeError
|
|
9
9
|
from ..core.api_error import ApiError
|
|
@@ -14,14 +14,14 @@ class ProjectsClient:
|
|
|
14
14
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
15
15
|
self._client_wrapper = client_wrapper
|
|
16
16
|
|
|
17
|
-
def
|
|
17
|
+
def list(
|
|
18
18
|
self,
|
|
19
19
|
*,
|
|
20
20
|
name: typing.Optional[str] = None,
|
|
21
21
|
offset: typing.Optional[str] = None,
|
|
22
22
|
limit: typing.Optional[str] = None,
|
|
23
23
|
request_options: typing.Optional[RequestOptions] = None,
|
|
24
|
-
) ->
|
|
24
|
+
) -> ProjectsListResponse:
|
|
25
25
|
"""
|
|
26
26
|
List all projects
|
|
27
27
|
|
|
@@ -38,7 +38,7 @@ class ProjectsClient:
|
|
|
38
38
|
|
|
39
39
|
Returns
|
|
40
40
|
-------
|
|
41
|
-
|
|
41
|
+
ProjectsListResponse
|
|
42
42
|
200
|
|
43
43
|
|
|
44
44
|
Examples
|
|
@@ -48,7 +48,7 @@ class ProjectsClient:
|
|
|
48
48
|
client = Letta(
|
|
49
49
|
token="YOUR_TOKEN",
|
|
50
50
|
)
|
|
51
|
-
client.projects.
|
|
51
|
+
client.projects.list()
|
|
52
52
|
"""
|
|
53
53
|
_response = self._client_wrapper.httpx_client.request(
|
|
54
54
|
"v1/projects",
|
|
@@ -63,9 +63,9 @@ class ProjectsClient:
|
|
|
63
63
|
try:
|
|
64
64
|
if 200 <= _response.status_code < 300:
|
|
65
65
|
return typing.cast(
|
|
66
|
-
|
|
66
|
+
ProjectsListResponse,
|
|
67
67
|
construct_type(
|
|
68
|
-
type_=
|
|
68
|
+
type_=ProjectsListResponse, # type: ignore
|
|
69
69
|
object_=_response.json(),
|
|
70
70
|
),
|
|
71
71
|
)
|
|
@@ -79,14 +79,14 @@ class AsyncProjectsClient:
|
|
|
79
79
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
80
80
|
self._client_wrapper = client_wrapper
|
|
81
81
|
|
|
82
|
-
async def
|
|
82
|
+
async def list(
|
|
83
83
|
self,
|
|
84
84
|
*,
|
|
85
85
|
name: typing.Optional[str] = None,
|
|
86
86
|
offset: typing.Optional[str] = None,
|
|
87
87
|
limit: typing.Optional[str] = None,
|
|
88
88
|
request_options: typing.Optional[RequestOptions] = None,
|
|
89
|
-
) ->
|
|
89
|
+
) -> ProjectsListResponse:
|
|
90
90
|
"""
|
|
91
91
|
List all projects
|
|
92
92
|
|
|
@@ -103,7 +103,7 @@ class AsyncProjectsClient:
|
|
|
103
103
|
|
|
104
104
|
Returns
|
|
105
105
|
-------
|
|
106
|
-
|
|
106
|
+
ProjectsListResponse
|
|
107
107
|
200
|
|
108
108
|
|
|
109
109
|
Examples
|
|
@@ -118,7 +118,7 @@ class AsyncProjectsClient:
|
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
async def main() -> None:
|
|
121
|
-
await client.projects.
|
|
121
|
+
await client.projects.list()
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
asyncio.run(main())
|
|
@@ -136,9 +136,9 @@ class AsyncProjectsClient:
|
|
|
136
136
|
try:
|
|
137
137
|
if 200 <= _response.status_code < 300:
|
|
138
138
|
return typing.cast(
|
|
139
|
-
|
|
139
|
+
ProjectsListResponse,
|
|
140
140
|
construct_type(
|
|
141
|
-
type_=
|
|
141
|
+
type_=ProjectsListResponse, # type: ignore
|
|
142
142
|
object_=_response.json(),
|
|
143
143
|
),
|
|
144
144
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from .
|
|
4
|
-
from .
|
|
3
|
+
from .projects_list_response import ProjectsListResponse
|
|
4
|
+
from .projects_list_response_projects_item import ProjectsListResponseProjectsItem
|
|
5
5
|
|
|
6
|
-
__all__ = ["
|
|
6
|
+
__all__ = ["ProjectsListResponse", "ProjectsListResponseProjectsItem"]
|
letta_client/projects/types/{projects_list_projects_response.py → projects_list_response.py}
RENAMED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
|
-
from .
|
|
5
|
+
from .projects_list_response_projects_item import ProjectsListResponseProjectsItem
|
|
6
6
|
import typing_extensions
|
|
7
7
|
from ...core.serialization import FieldMetadata
|
|
8
8
|
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
9
|
import pydantic
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class
|
|
13
|
-
projects: typing.List[
|
|
12
|
+
class ProjectsListResponse(UncheckedBaseModel):
|
|
13
|
+
projects: typing.List[ProjectsListResponseProjectsItem]
|
|
14
14
|
has_next_page: typing_extensions.Annotated[bool, FieldMetadata(alias="hasNextPage")]
|
|
15
15
|
|
|
16
16
|
if IS_PYDANTIC_V2:
|
letta_client/providers/client.py
CHANGED
|
@@ -155,8 +155,8 @@ class ProvidersClient:
|
|
|
155
155
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
156
156
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
157
157
|
|
|
158
|
-
def
|
|
159
|
-
self,
|
|
158
|
+
def delete(
|
|
159
|
+
self, provider_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
160
160
|
) -> typing.Optional[typing.Any]:
|
|
161
161
|
"""
|
|
162
162
|
Delete an existing custom provider
|
|
@@ -164,7 +164,6 @@ class ProvidersClient:
|
|
|
164
164
|
Parameters
|
|
165
165
|
----------
|
|
166
166
|
provider_id : str
|
|
167
|
-
The provider_id key to be deleted.
|
|
168
167
|
|
|
169
168
|
request_options : typing.Optional[RequestOptions]
|
|
170
169
|
Request-specific configuration.
|
|
@@ -181,16 +180,13 @@ class ProvidersClient:
|
|
|
181
180
|
client = Letta(
|
|
182
181
|
token="YOUR_TOKEN",
|
|
183
182
|
)
|
|
184
|
-
client.providers.
|
|
183
|
+
client.providers.delete(
|
|
185
184
|
provider_id="provider_id",
|
|
186
185
|
)
|
|
187
186
|
"""
|
|
188
187
|
_response = self._client_wrapper.httpx_client.request(
|
|
189
|
-
"v1/providers/",
|
|
188
|
+
f"v1/providers/{jsonable_encoder(provider_id)}",
|
|
190
189
|
method="DELETE",
|
|
191
|
-
params={
|
|
192
|
-
"provider_id": provider_id,
|
|
193
|
-
},
|
|
194
190
|
request_options=request_options,
|
|
195
191
|
)
|
|
196
192
|
try:
|
|
@@ -217,16 +213,15 @@ class ProvidersClient:
|
|
|
217
213
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
218
214
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
219
215
|
|
|
220
|
-
def
|
|
221
|
-
self,
|
|
216
|
+
def modify(
|
|
217
|
+
self, provider_id: str, *, api_key: str, request_options: typing.Optional[RequestOptions] = None
|
|
222
218
|
) -> Provider:
|
|
223
219
|
"""
|
|
224
220
|
Update an existing custom provider
|
|
225
221
|
|
|
226
222
|
Parameters
|
|
227
223
|
----------
|
|
228
|
-
|
|
229
|
-
The id of the provider to update.
|
|
224
|
+
provider_id : str
|
|
230
225
|
|
|
231
226
|
api_key : str
|
|
232
227
|
API key used for requests to the provider.
|
|
@@ -246,16 +241,15 @@ class ProvidersClient:
|
|
|
246
241
|
client = Letta(
|
|
247
242
|
token="YOUR_TOKEN",
|
|
248
243
|
)
|
|
249
|
-
client.providers.
|
|
250
|
-
|
|
244
|
+
client.providers.modify(
|
|
245
|
+
provider_id="provider_id",
|
|
251
246
|
api_key="api_key",
|
|
252
247
|
)
|
|
253
248
|
"""
|
|
254
249
|
_response = self._client_wrapper.httpx_client.request(
|
|
255
|
-
"v1/providers/",
|
|
250
|
+
f"v1/providers/{jsonable_encoder(provider_id)}",
|
|
256
251
|
method="PATCH",
|
|
257
252
|
json={
|
|
258
|
-
"id": id,
|
|
259
253
|
"api_key": api_key,
|
|
260
254
|
},
|
|
261
255
|
headers={
|
|
@@ -288,80 +282,6 @@ class ProvidersClient:
|
|
|
288
282
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
289
283
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
290
284
|
|
|
291
|
-
def delete(self, provider_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
292
|
-
"""
|
|
293
|
-
Parameters
|
|
294
|
-
----------
|
|
295
|
-
provider_id : str
|
|
296
|
-
|
|
297
|
-
request_options : typing.Optional[RequestOptions]
|
|
298
|
-
Request-specific configuration.
|
|
299
|
-
|
|
300
|
-
Returns
|
|
301
|
-
-------
|
|
302
|
-
None
|
|
303
|
-
|
|
304
|
-
Examples
|
|
305
|
-
--------
|
|
306
|
-
from letta_client import Letta
|
|
307
|
-
|
|
308
|
-
client = Letta(
|
|
309
|
-
token="YOUR_TOKEN",
|
|
310
|
-
)
|
|
311
|
-
client.providers.delete(
|
|
312
|
-
provider_id="provider_id",
|
|
313
|
-
)
|
|
314
|
-
"""
|
|
315
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
316
|
-
f"v1/providers/{jsonable_encoder(provider_id)}",
|
|
317
|
-
method="DELETE",
|
|
318
|
-
request_options=request_options,
|
|
319
|
-
)
|
|
320
|
-
try:
|
|
321
|
-
if 200 <= _response.status_code < 300:
|
|
322
|
-
return
|
|
323
|
-
_response_json = _response.json()
|
|
324
|
-
except JSONDecodeError:
|
|
325
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
326
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
327
|
-
|
|
328
|
-
def modify(self, provider_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
329
|
-
"""
|
|
330
|
-
Parameters
|
|
331
|
-
----------
|
|
332
|
-
provider_id : str
|
|
333
|
-
|
|
334
|
-
request_options : typing.Optional[RequestOptions]
|
|
335
|
-
Request-specific configuration.
|
|
336
|
-
|
|
337
|
-
Returns
|
|
338
|
-
-------
|
|
339
|
-
None
|
|
340
|
-
|
|
341
|
-
Examples
|
|
342
|
-
--------
|
|
343
|
-
from letta_client import Letta
|
|
344
|
-
|
|
345
|
-
client = Letta(
|
|
346
|
-
token="YOUR_TOKEN",
|
|
347
|
-
)
|
|
348
|
-
client.providers.modify(
|
|
349
|
-
provider_id="provider_id",
|
|
350
|
-
)
|
|
351
|
-
"""
|
|
352
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
353
|
-
f"v1/providers/{jsonable_encoder(provider_id)}",
|
|
354
|
-
method="PATCH",
|
|
355
|
-
request_options=request_options,
|
|
356
|
-
)
|
|
357
|
-
try:
|
|
358
|
-
if 200 <= _response.status_code < 300:
|
|
359
|
-
return
|
|
360
|
-
_response_json = _response.json()
|
|
361
|
-
except JSONDecodeError:
|
|
362
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
363
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
364
|
-
|
|
365
285
|
|
|
366
286
|
class AsyncProvidersClient:
|
|
367
287
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -520,8 +440,8 @@ class AsyncProvidersClient:
|
|
|
520
440
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
521
441
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
522
442
|
|
|
523
|
-
async def
|
|
524
|
-
self,
|
|
443
|
+
async def delete(
|
|
444
|
+
self, provider_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
525
445
|
) -> typing.Optional[typing.Any]:
|
|
526
446
|
"""
|
|
527
447
|
Delete an existing custom provider
|
|
@@ -529,7 +449,6 @@ class AsyncProvidersClient:
|
|
|
529
449
|
Parameters
|
|
530
450
|
----------
|
|
531
451
|
provider_id : str
|
|
532
|
-
The provider_id key to be deleted.
|
|
533
452
|
|
|
534
453
|
request_options : typing.Optional[RequestOptions]
|
|
535
454
|
Request-specific configuration.
|
|
@@ -551,7 +470,7 @@ class AsyncProvidersClient:
|
|
|
551
470
|
|
|
552
471
|
|
|
553
472
|
async def main() -> None:
|
|
554
|
-
await client.providers.
|
|
473
|
+
await client.providers.delete(
|
|
555
474
|
provider_id="provider_id",
|
|
556
475
|
)
|
|
557
476
|
|
|
@@ -559,11 +478,8 @@ class AsyncProvidersClient:
|
|
|
559
478
|
asyncio.run(main())
|
|
560
479
|
"""
|
|
561
480
|
_response = await self._client_wrapper.httpx_client.request(
|
|
562
|
-
"v1/providers/",
|
|
481
|
+
f"v1/providers/{jsonable_encoder(provider_id)}",
|
|
563
482
|
method="DELETE",
|
|
564
|
-
params={
|
|
565
|
-
"provider_id": provider_id,
|
|
566
|
-
},
|
|
567
483
|
request_options=request_options,
|
|
568
484
|
)
|
|
569
485
|
try:
|
|
@@ -590,16 +506,15 @@ class AsyncProvidersClient:
|
|
|
590
506
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
591
507
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
592
508
|
|
|
593
|
-
async def
|
|
594
|
-
self,
|
|
509
|
+
async def modify(
|
|
510
|
+
self, provider_id: str, *, api_key: str, request_options: typing.Optional[RequestOptions] = None
|
|
595
511
|
) -> Provider:
|
|
596
512
|
"""
|
|
597
513
|
Update an existing custom provider
|
|
598
514
|
|
|
599
515
|
Parameters
|
|
600
516
|
----------
|
|
601
|
-
|
|
602
|
-
The id of the provider to update.
|
|
517
|
+
provider_id : str
|
|
603
518
|
|
|
604
519
|
api_key : str
|
|
605
520
|
API key used for requests to the provider.
|
|
@@ -624,8 +539,8 @@ class AsyncProvidersClient:
|
|
|
624
539
|
|
|
625
540
|
|
|
626
541
|
async def main() -> None:
|
|
627
|
-
await client.providers.
|
|
628
|
-
|
|
542
|
+
await client.providers.modify(
|
|
543
|
+
provider_id="provider_id",
|
|
629
544
|
api_key="api_key",
|
|
630
545
|
)
|
|
631
546
|
|
|
@@ -633,10 +548,9 @@ class AsyncProvidersClient:
|
|
|
633
548
|
asyncio.run(main())
|
|
634
549
|
"""
|
|
635
550
|
_response = await self._client_wrapper.httpx_client.request(
|
|
636
|
-
"v1/providers/",
|
|
551
|
+
f"v1/providers/{jsonable_encoder(provider_id)}",
|
|
637
552
|
method="PATCH",
|
|
638
553
|
json={
|
|
639
|
-
"id": id,
|
|
640
554
|
"api_key": api_key,
|
|
641
555
|
},
|
|
642
556
|
headers={
|
|
@@ -668,93 +582,3 @@ class AsyncProvidersClient:
|
|
|
668
582
|
except JSONDecodeError:
|
|
669
583
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
670
584
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
671
|
-
|
|
672
|
-
async def delete(self, provider_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
673
|
-
"""
|
|
674
|
-
Parameters
|
|
675
|
-
----------
|
|
676
|
-
provider_id : str
|
|
677
|
-
|
|
678
|
-
request_options : typing.Optional[RequestOptions]
|
|
679
|
-
Request-specific configuration.
|
|
680
|
-
|
|
681
|
-
Returns
|
|
682
|
-
-------
|
|
683
|
-
None
|
|
684
|
-
|
|
685
|
-
Examples
|
|
686
|
-
--------
|
|
687
|
-
import asyncio
|
|
688
|
-
|
|
689
|
-
from letta_client import AsyncLetta
|
|
690
|
-
|
|
691
|
-
client = AsyncLetta(
|
|
692
|
-
token="YOUR_TOKEN",
|
|
693
|
-
)
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
async def main() -> None:
|
|
697
|
-
await client.providers.delete(
|
|
698
|
-
provider_id="provider_id",
|
|
699
|
-
)
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
asyncio.run(main())
|
|
703
|
-
"""
|
|
704
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
705
|
-
f"v1/providers/{jsonable_encoder(provider_id)}",
|
|
706
|
-
method="DELETE",
|
|
707
|
-
request_options=request_options,
|
|
708
|
-
)
|
|
709
|
-
try:
|
|
710
|
-
if 200 <= _response.status_code < 300:
|
|
711
|
-
return
|
|
712
|
-
_response_json = _response.json()
|
|
713
|
-
except JSONDecodeError:
|
|
714
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
715
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
716
|
-
|
|
717
|
-
async def modify(self, provider_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
718
|
-
"""
|
|
719
|
-
Parameters
|
|
720
|
-
----------
|
|
721
|
-
provider_id : str
|
|
722
|
-
|
|
723
|
-
request_options : typing.Optional[RequestOptions]
|
|
724
|
-
Request-specific configuration.
|
|
725
|
-
|
|
726
|
-
Returns
|
|
727
|
-
-------
|
|
728
|
-
None
|
|
729
|
-
|
|
730
|
-
Examples
|
|
731
|
-
--------
|
|
732
|
-
import asyncio
|
|
733
|
-
|
|
734
|
-
from letta_client import AsyncLetta
|
|
735
|
-
|
|
736
|
-
client = AsyncLetta(
|
|
737
|
-
token="YOUR_TOKEN",
|
|
738
|
-
)
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
async def main() -> None:
|
|
742
|
-
await client.providers.modify(
|
|
743
|
-
provider_id="provider_id",
|
|
744
|
-
)
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
asyncio.run(main())
|
|
748
|
-
"""
|
|
749
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
750
|
-
f"v1/providers/{jsonable_encoder(provider_id)}",
|
|
751
|
-
method="PATCH",
|
|
752
|
-
request_options=request_options,
|
|
753
|
-
)
|
|
754
|
-
try:
|
|
755
|
-
if 200 <= _response.status_code < 300:
|
|
756
|
-
return
|
|
757
|
-
_response_json = _response.json()
|
|
758
|
-
except JSONDecodeError:
|
|
759
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
760
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|