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.

Files changed (34) hide show
  1. letta_client/__init__.py +18 -22
  2. letta_client/agents/client.py +4 -88
  3. letta_client/base_client.py +4 -12
  4. letta_client/batches/client.py +50 -8
  5. letta_client/client_side_access_tokens/__init__.py +12 -12
  6. letta_client/client_side_access_tokens/client.py +28 -32
  7. letta_client/client_side_access_tokens/types/__init__.py +15 -21
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. letta_client/core/client_wrapper.py +1 -1
  15. letta_client/projects/__init__.py +2 -2
  16. letta_client/projects/client.py +13 -13
  17. letta_client/projects/types/__init__.py +3 -3
  18. letta_client/projects/types/{projects_list_projects_response.py → projects_list_response.py} +3 -3
  19. letta_client/projects/types/{projects_list_projects_response_projects_item.py → projects_list_response_projects_item.py} +1 -1
  20. letta_client/providers/client.py +20 -196
  21. letta_client/runs/client.py +4 -78
  22. letta_client/tags/client.py +85 -8
  23. letta_client/templates/__init__.py +2 -7
  24. letta_client/templates/client.py +13 -13
  25. letta_client/templates/types/__init__.py +3 -3
  26. letta_client/templates/types/{templates_list_templates_response.py → templates_list_response.py} +3 -3
  27. letta_client/templates/types/{templates_list_templates_response_templates_item.py → templates_list_response_templates_item.py} +1 -1
  28. {letta_client-0.1.122.dist-info → letta_client-0.1.124.dist-info}/METADATA +1 -1
  29. {letta_client-0.1.122.dist-info → letta_client-0.1.124.dist-info}/RECORD +30 -34
  30. letta_client/messages/__init__.py +0 -2
  31. letta_client/messages/client.py +0 -146
  32. letta_client/tag/__init__.py +0 -2
  33. letta_client/tag/client.py +0 -169
  34. {letta_client-0.1.122.dist-info → letta_client-0.1.124.dist-info}/WHEEL +0 -0
@@ -1,146 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from ..core.client_wrapper import SyncClientWrapper
4
- import typing
5
- from ..core.request_options import RequestOptions
6
- from ..core.jsonable_encoder import jsonable_encoder
7
- from ..core.unchecked_base_model import construct_type
8
- from ..errors.unprocessable_entity_error import UnprocessableEntityError
9
- from ..types.http_validation_error import HttpValidationError
10
- from json.decoder import JSONDecodeError
11
- from ..core.api_error import ApiError
12
- from ..core.client_wrapper import AsyncClientWrapper
13
-
14
-
15
- class MessagesClient:
16
- def __init__(self, *, client_wrapper: SyncClientWrapper):
17
- self._client_wrapper = client_wrapper
18
-
19
- def cancel_batch_run(
20
- self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None
21
- ) -> typing.Optional[typing.Any]:
22
- """
23
- Cancel a batch run.
24
-
25
- Parameters
26
- ----------
27
- batch_id : str
28
-
29
- request_options : typing.Optional[RequestOptions]
30
- Request-specific configuration.
31
-
32
- Returns
33
- -------
34
- typing.Optional[typing.Any]
35
- Successful Response
36
-
37
- Examples
38
- --------
39
- from letta_client import Letta
40
-
41
- client = Letta(
42
- token="YOUR_TOKEN",
43
- )
44
- client.messages.cancel_batch_run(
45
- batch_id="batch_id",
46
- )
47
- """
48
- _response = self._client_wrapper.httpx_client.request(
49
- f"v1/messages/batches/{jsonable_encoder(batch_id)}/cancel",
50
- method="PATCH",
51
- request_options=request_options,
52
- )
53
- try:
54
- if 200 <= _response.status_code < 300:
55
- return typing.cast(
56
- typing.Optional[typing.Any],
57
- construct_type(
58
- type_=typing.Optional[typing.Any], # type: ignore
59
- object_=_response.json(),
60
- ),
61
- )
62
- if _response.status_code == 422:
63
- raise UnprocessableEntityError(
64
- typing.cast(
65
- HttpValidationError,
66
- construct_type(
67
- type_=HttpValidationError, # type: ignore
68
- object_=_response.json(),
69
- ),
70
- )
71
- )
72
- _response_json = _response.json()
73
- except JSONDecodeError:
74
- raise ApiError(status_code=_response.status_code, body=_response.text)
75
- raise ApiError(status_code=_response.status_code, body=_response_json)
76
-
77
-
78
- class AsyncMessagesClient:
79
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
80
- self._client_wrapper = client_wrapper
81
-
82
- async def cancel_batch_run(
83
- self, batch_id: str, *, request_options: typing.Optional[RequestOptions] = None
84
- ) -> typing.Optional[typing.Any]:
85
- """
86
- Cancel a batch run.
87
-
88
- Parameters
89
- ----------
90
- batch_id : str
91
-
92
- request_options : typing.Optional[RequestOptions]
93
- Request-specific configuration.
94
-
95
- Returns
96
- -------
97
- typing.Optional[typing.Any]
98
- Successful Response
99
-
100
- Examples
101
- --------
102
- import asyncio
103
-
104
- from letta_client import AsyncLetta
105
-
106
- client = AsyncLetta(
107
- token="YOUR_TOKEN",
108
- )
109
-
110
-
111
- async def main() -> None:
112
- await client.messages.cancel_batch_run(
113
- batch_id="batch_id",
114
- )
115
-
116
-
117
- asyncio.run(main())
118
- """
119
- _response = await self._client_wrapper.httpx_client.request(
120
- f"v1/messages/batches/{jsonable_encoder(batch_id)}/cancel",
121
- method="PATCH",
122
- request_options=request_options,
123
- )
124
- try:
125
- if 200 <= _response.status_code < 300:
126
- return typing.cast(
127
- typing.Optional[typing.Any],
128
- construct_type(
129
- type_=typing.Optional[typing.Any], # type: ignore
130
- object_=_response.json(),
131
- ),
132
- )
133
- if _response.status_code == 422:
134
- raise UnprocessableEntityError(
135
- typing.cast(
136
- HttpValidationError,
137
- construct_type(
138
- type_=HttpValidationError, # type: ignore
139
- object_=_response.json(),
140
- ),
141
- )
142
- )
143
- _response_json = _response.json()
144
- except JSONDecodeError:
145
- raise ApiError(status_code=_response.status_code, body=_response.text)
146
- raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -1,2 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
@@ -1,169 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from ..core.client_wrapper import SyncClientWrapper
4
- import typing
5
- from ..core.request_options import RequestOptions
6
- from ..core.unchecked_base_model import construct_type
7
- from ..errors.unprocessable_entity_error import UnprocessableEntityError
8
- from ..types.http_validation_error import HttpValidationError
9
- from json.decoder import JSONDecodeError
10
- from ..core.api_error import ApiError
11
- from ..core.client_wrapper import AsyncClientWrapper
12
-
13
-
14
- class TagClient:
15
- def __init__(self, *, client_wrapper: SyncClientWrapper):
16
- self._client_wrapper = client_wrapper
17
-
18
- def list_tags(
19
- self,
20
- *,
21
- after: typing.Optional[str] = None,
22
- limit: typing.Optional[int] = None,
23
- query_text: typing.Optional[str] = None,
24
- request_options: typing.Optional[RequestOptions] = None,
25
- ) -> typing.List[str]:
26
- """
27
- Get a list of all tags in the database
28
-
29
- Parameters
30
- ----------
31
- after : typing.Optional[str]
32
-
33
- limit : typing.Optional[int]
34
-
35
- query_text : typing.Optional[str]
36
-
37
- request_options : typing.Optional[RequestOptions]
38
- Request-specific configuration.
39
-
40
- Returns
41
- -------
42
- typing.List[str]
43
- Successful Response
44
-
45
- Examples
46
- --------
47
- from letta_client import Letta
48
-
49
- client = Letta(
50
- token="YOUR_TOKEN",
51
- )
52
- client.tag.list_tags()
53
- """
54
- _response = self._client_wrapper.httpx_client.request(
55
- "v1/tags/",
56
- method="GET",
57
- params={
58
- "after": after,
59
- "limit": limit,
60
- "query_text": query_text,
61
- },
62
- request_options=request_options,
63
- )
64
- try:
65
- if 200 <= _response.status_code < 300:
66
- return typing.cast(
67
- typing.List[str],
68
- construct_type(
69
- type_=typing.List[str], # type: ignore
70
- object_=_response.json(),
71
- ),
72
- )
73
- if _response.status_code == 422:
74
- raise UnprocessableEntityError(
75
- typing.cast(
76
- HttpValidationError,
77
- construct_type(
78
- type_=HttpValidationError, # type: ignore
79
- object_=_response.json(),
80
- ),
81
- )
82
- )
83
- _response_json = _response.json()
84
- except JSONDecodeError:
85
- raise ApiError(status_code=_response.status_code, body=_response.text)
86
- raise ApiError(status_code=_response.status_code, body=_response_json)
87
-
88
-
89
- class AsyncTagClient:
90
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
91
- self._client_wrapper = client_wrapper
92
-
93
- async def list_tags(
94
- self,
95
- *,
96
- after: typing.Optional[str] = None,
97
- limit: typing.Optional[int] = None,
98
- query_text: typing.Optional[str] = None,
99
- request_options: typing.Optional[RequestOptions] = None,
100
- ) -> typing.List[str]:
101
- """
102
- Get a list of all tags in the database
103
-
104
- Parameters
105
- ----------
106
- after : typing.Optional[str]
107
-
108
- limit : typing.Optional[int]
109
-
110
- query_text : typing.Optional[str]
111
-
112
- request_options : typing.Optional[RequestOptions]
113
- Request-specific configuration.
114
-
115
- Returns
116
- -------
117
- typing.List[str]
118
- Successful Response
119
-
120
- Examples
121
- --------
122
- import asyncio
123
-
124
- from letta_client import AsyncLetta
125
-
126
- client = AsyncLetta(
127
- token="YOUR_TOKEN",
128
- )
129
-
130
-
131
- async def main() -> None:
132
- await client.tag.list_tags()
133
-
134
-
135
- asyncio.run(main())
136
- """
137
- _response = await self._client_wrapper.httpx_client.request(
138
- "v1/tags/",
139
- method="GET",
140
- params={
141
- "after": after,
142
- "limit": limit,
143
- "query_text": query_text,
144
- },
145
- request_options=request_options,
146
- )
147
- try:
148
- if 200 <= _response.status_code < 300:
149
- return typing.cast(
150
- typing.List[str],
151
- construct_type(
152
- type_=typing.List[str], # type: ignore
153
- object_=_response.json(),
154
- ),
155
- )
156
- if _response.status_code == 422:
157
- raise UnprocessableEntityError(
158
- typing.cast(
159
- HttpValidationError,
160
- construct_type(
161
- type_=HttpValidationError, # type: ignore
162
- object_=_response.json(),
163
- ),
164
- )
165
- )
166
- _response_json = _response.json()
167
- except JSONDecodeError:
168
- raise ApiError(status_code=_response.status_code, body=_response.text)
169
- raise ApiError(status_code=_response.status_code, body=_response_json)