letta-client 0.1.59__py3-none-any.whl → 0.1.61__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of letta-client might be problematic. Click here for more details.
- letta_client/core/client_wrapper.py +1 -1
- letta_client/core/http_client.py +6 -6
- letta_client/core/pydantic_utilities.py +2 -2
- letta_client/templates/client.py +10 -0
- letta_client/types/app_auth_scheme_auth_mode.py +14 -1
- letta_client/voice/client.py +19 -4
- {letta_client-0.1.59.dist-info → letta_client-0.1.61.dist-info}/METADATA +3 -3
- {letta_client-0.1.59.dist-info → letta_client-0.1.61.dist-info}/RECORD +9 -9
- {letta_client-0.1.59.dist-info → letta_client-0.1.61.dist-info}/WHEEL +0 -0
|
@@ -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.61",
|
|
20
20
|
}
|
|
21
21
|
if self.token is not None:
|
|
22
22
|
headers["Authorization"] = f"Bearer {self.token}"
|
letta_client/core/http_client.py
CHANGED
|
@@ -85,8 +85,8 @@ def _retry_timeout(response: httpx.Response, retries: int) -> float:
|
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
def _should_retry(response: httpx.Response) -> bool:
|
|
88
|
-
|
|
89
|
-
return response.status_code >= 500 or response.status_code in
|
|
88
|
+
retryable_400s = [429, 408, 409]
|
|
89
|
+
return response.status_code >= 500 or response.status_code in retryable_400s
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
def remove_omit_from_dict(
|
|
@@ -183,7 +183,7 @@ class HttpClient:
|
|
|
183
183
|
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
|
|
184
184
|
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
|
185
185
|
request_options: typing.Optional[RequestOptions] = None,
|
|
186
|
-
retries: int =
|
|
186
|
+
retries: int = 2,
|
|
187
187
|
omit: typing.Optional[typing.Any] = None,
|
|
188
188
|
) -> httpx.Response:
|
|
189
189
|
base_url = self.get_base_url(base_url)
|
|
@@ -269,7 +269,7 @@ class HttpClient:
|
|
|
269
269
|
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
|
|
270
270
|
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
|
271
271
|
request_options: typing.Optional[RequestOptions] = None,
|
|
272
|
-
retries: int =
|
|
272
|
+
retries: int = 2,
|
|
273
273
|
omit: typing.Optional[typing.Any] = None,
|
|
274
274
|
) -> typing.Iterator[httpx.Response]:
|
|
275
275
|
base_url = self.get_base_url(base_url)
|
|
@@ -359,7 +359,7 @@ class AsyncHttpClient:
|
|
|
359
359
|
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
|
|
360
360
|
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
|
361
361
|
request_options: typing.Optional[RequestOptions] = None,
|
|
362
|
-
retries: int =
|
|
362
|
+
retries: int = 2,
|
|
363
363
|
omit: typing.Optional[typing.Any] = None,
|
|
364
364
|
) -> httpx.Response:
|
|
365
365
|
base_url = self.get_base_url(base_url)
|
|
@@ -445,7 +445,7 @@ class AsyncHttpClient:
|
|
|
445
445
|
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
|
|
446
446
|
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
|
447
447
|
request_options: typing.Optional[RequestOptions] = None,
|
|
448
|
-
retries: int =
|
|
448
|
+
retries: int = 2,
|
|
449
449
|
omit: typing.Optional[typing.Any] = None,
|
|
450
450
|
) -> typing.AsyncIterator[httpx.Response]:
|
|
451
451
|
base_url = self.get_base_url(base_url)
|
|
@@ -79,7 +79,7 @@ def to_jsonable_with_fallback(
|
|
|
79
79
|
class UniversalBaseModel(pydantic.BaseModel):
|
|
80
80
|
if IS_PYDANTIC_V2:
|
|
81
81
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
82
|
-
# Allow fields
|
|
82
|
+
# Allow fields beginning with `model_` to be used in the model
|
|
83
83
|
protected_namespaces=(),
|
|
84
84
|
) # type: ignore # Pydantic v2
|
|
85
85
|
|
|
@@ -128,7 +128,7 @@ class UniversalBaseModel(pydantic.BaseModel):
|
|
|
128
128
|
Override the default dict method to `exclude_unset` by default. This function patches
|
|
129
129
|
`exclude_unset` to work include fields within non-None default values.
|
|
130
130
|
"""
|
|
131
|
-
# Note: the logic here is
|
|
131
|
+
# Note: the logic here is multiplexed given the levers exposed in Pydantic V1 vs V2
|
|
132
132
|
# Pydantic V1's .dict can be extremely slow, so we do not want to call it twice.
|
|
133
133
|
#
|
|
134
134
|
# We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models
|
letta_client/templates/client.py
CHANGED
|
@@ -27,6 +27,7 @@ class TemplatesClient:
|
|
|
27
27
|
agent_name: typing.Optional[str] = OMIT,
|
|
28
28
|
memory_variables: typing.Optional[typing.Dict[str, str]] = OMIT,
|
|
29
29
|
tool_variables: typing.Optional[typing.Dict[str, str]] = OMIT,
|
|
30
|
+
identity_ids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
30
31
|
request_options: typing.Optional[RequestOptions] = None,
|
|
31
32
|
) -> TemplatesCreateAgentsResponse:
|
|
32
33
|
"""
|
|
@@ -52,6 +53,9 @@ class TemplatesClient:
|
|
|
52
53
|
tool_variables : typing.Optional[typing.Dict[str, str]]
|
|
53
54
|
The tool variables to assign to the agent
|
|
54
55
|
|
|
56
|
+
identity_ids : typing.Optional[typing.Sequence[str]]
|
|
57
|
+
The identity ids to assign to the agent
|
|
58
|
+
|
|
55
59
|
request_options : typing.Optional[RequestOptions]
|
|
56
60
|
Request-specific configuration.
|
|
57
61
|
|
|
@@ -80,6 +84,7 @@ class TemplatesClient:
|
|
|
80
84
|
"agent_name": agent_name,
|
|
81
85
|
"memory_variables": memory_variables,
|
|
82
86
|
"tool_variables": tool_variables,
|
|
87
|
+
"identity_ids": identity_ids,
|
|
83
88
|
},
|
|
84
89
|
headers={
|
|
85
90
|
"content-type": "application/json",
|
|
@@ -115,6 +120,7 @@ class AsyncTemplatesClient:
|
|
|
115
120
|
agent_name: typing.Optional[str] = OMIT,
|
|
116
121
|
memory_variables: typing.Optional[typing.Dict[str, str]] = OMIT,
|
|
117
122
|
tool_variables: typing.Optional[typing.Dict[str, str]] = OMIT,
|
|
123
|
+
identity_ids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
118
124
|
request_options: typing.Optional[RequestOptions] = None,
|
|
119
125
|
) -> TemplatesCreateAgentsResponse:
|
|
120
126
|
"""
|
|
@@ -140,6 +146,9 @@ class AsyncTemplatesClient:
|
|
|
140
146
|
tool_variables : typing.Optional[typing.Dict[str, str]]
|
|
141
147
|
The tool variables to assign to the agent
|
|
142
148
|
|
|
149
|
+
identity_ids : typing.Optional[typing.Sequence[str]]
|
|
150
|
+
The identity ids to assign to the agent
|
|
151
|
+
|
|
143
152
|
request_options : typing.Optional[RequestOptions]
|
|
144
153
|
Request-specific configuration.
|
|
145
154
|
|
|
@@ -176,6 +185,7 @@ class AsyncTemplatesClient:
|
|
|
176
185
|
"agent_name": agent_name,
|
|
177
186
|
"memory_variables": memory_variables,
|
|
178
187
|
"tool_variables": tool_variables,
|
|
188
|
+
"identity_ids": identity_ids,
|
|
179
189
|
},
|
|
180
190
|
headers={
|
|
181
191
|
"content-type": "application/json",
|
|
@@ -3,5 +3,18 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
5
|
AppAuthSchemeAuthMode = typing.Union[
|
|
6
|
-
typing.Literal[
|
|
6
|
+
typing.Literal[
|
|
7
|
+
"OAUTH2",
|
|
8
|
+
"OAUTH1",
|
|
9
|
+
"API_KEY",
|
|
10
|
+
"BASIC",
|
|
11
|
+
"BEARER_TOKEN",
|
|
12
|
+
"BASIC_WITH_JWT",
|
|
13
|
+
"GOOGLE_SERVICE_ACCOUNT",
|
|
14
|
+
"GOOGLEADS_AUTH",
|
|
15
|
+
"NO_AUTH",
|
|
16
|
+
"COMPOSIO_LINK",
|
|
17
|
+
"CALCOM_AUTH",
|
|
18
|
+
],
|
|
19
|
+
typing.Any,
|
|
7
20
|
]
|
letta_client/voice/client.py
CHANGED
|
@@ -4,6 +4,7 @@ import typing
|
|
|
4
4
|
from ..core.client_wrapper import SyncClientWrapper
|
|
5
5
|
from .types.create_voice_chat_completions_request import CreateVoiceChatCompletionsRequest
|
|
6
6
|
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..core.jsonable_encoder import jsonable_encoder
|
|
7
8
|
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
8
9
|
from ..core.unchecked_base_model import construct_type
|
|
9
10
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
@@ -21,11 +22,17 @@ class VoiceClient:
|
|
|
21
22
|
self._client_wrapper = client_wrapper
|
|
22
23
|
|
|
23
24
|
def create_voice_chat_completions(
|
|
24
|
-
self,
|
|
25
|
+
self,
|
|
26
|
+
agent_id: str,
|
|
27
|
+
*,
|
|
28
|
+
request: CreateVoiceChatCompletionsRequest,
|
|
29
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
25
30
|
) -> typing.Optional[typing.Any]:
|
|
26
31
|
"""
|
|
27
32
|
Parameters
|
|
28
33
|
----------
|
|
34
|
+
agent_id : str
|
|
35
|
+
|
|
29
36
|
request : CreateVoiceChatCompletionsRequest
|
|
30
37
|
|
|
31
38
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -48,6 +55,7 @@ class VoiceClient:
|
|
|
48
55
|
token="YOUR_TOKEN",
|
|
49
56
|
)
|
|
50
57
|
client.voice.create_voice_chat_completions(
|
|
58
|
+
agent_id="agent_id",
|
|
51
59
|
request=CompletionCreateParamsNonStreaming(
|
|
52
60
|
messages=[
|
|
53
61
|
ChatCompletionDeveloperMessageParam(
|
|
@@ -59,7 +67,7 @@ class VoiceClient:
|
|
|
59
67
|
)
|
|
60
68
|
"""
|
|
61
69
|
_response = self._client_wrapper.httpx_client.request(
|
|
62
|
-
"v1/voice/chat/completions",
|
|
70
|
+
f"v1/voice/{jsonable_encoder(agent_id)}/chat/completions",
|
|
63
71
|
method="POST",
|
|
64
72
|
json=convert_and_respect_annotation_metadata(
|
|
65
73
|
object_=request, annotation=CreateVoiceChatCompletionsRequest, direction="write"
|
|
@@ -97,11 +105,17 @@ class AsyncVoiceClient:
|
|
|
97
105
|
self._client_wrapper = client_wrapper
|
|
98
106
|
|
|
99
107
|
async def create_voice_chat_completions(
|
|
100
|
-
self,
|
|
108
|
+
self,
|
|
109
|
+
agent_id: str,
|
|
110
|
+
*,
|
|
111
|
+
request: CreateVoiceChatCompletionsRequest,
|
|
112
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
101
113
|
) -> typing.Optional[typing.Any]:
|
|
102
114
|
"""
|
|
103
115
|
Parameters
|
|
104
116
|
----------
|
|
117
|
+
agent_id : str
|
|
118
|
+
|
|
105
119
|
request : CreateVoiceChatCompletionsRequest
|
|
106
120
|
|
|
107
121
|
request_options : typing.Optional[RequestOptions]
|
|
@@ -129,6 +143,7 @@ class AsyncVoiceClient:
|
|
|
129
143
|
|
|
130
144
|
async def main() -> None:
|
|
131
145
|
await client.voice.create_voice_chat_completions(
|
|
146
|
+
agent_id="agent_id",
|
|
132
147
|
request=CompletionCreateParamsNonStreaming(
|
|
133
148
|
messages=[
|
|
134
149
|
ChatCompletionDeveloperMessageParam(
|
|
@@ -143,7 +158,7 @@ class AsyncVoiceClient:
|
|
|
143
158
|
asyncio.run(main())
|
|
144
159
|
"""
|
|
145
160
|
_response = await self._client_wrapper.httpx_client.request(
|
|
146
|
-
"v1/voice/chat/completions",
|
|
161
|
+
f"v1/voice/{jsonable_encoder(agent_id)}/chat/completions",
|
|
147
162
|
method="POST",
|
|
148
163
|
json=convert_and_respect_annotation_metadata(
|
|
149
164
|
object_=request, annotation=CreateVoiceChatCompletionsRequest, direction="write"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: letta-client
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.61
|
|
4
4
|
Summary:
|
|
5
5
|
Requires-Python: >=3.8,<4.0
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -123,10 +123,10 @@ for chunk in response:
|
|
|
123
123
|
### Retries
|
|
124
124
|
|
|
125
125
|
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
|
|
126
|
-
as the request is deemed
|
|
126
|
+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
|
|
127
127
|
retry limit (default: 2).
|
|
128
128
|
|
|
129
|
-
A request is deemed
|
|
129
|
+
A request is deemed retryable when any of the following HTTP status codes is returned:
|
|
130
130
|
|
|
131
131
|
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
|
|
132
132
|
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
|
|
@@ -210,12 +210,12 @@ letta_client/blocks/client.py,sha256=AeQQ-IdYhV-zqLTt3PTrJOtJ6XtBZcXNC108Y5EogVU
|
|
|
210
210
|
letta_client/client.py,sha256=xdSrD4IkWokZHujowd1r7zESBoVgKGNvo6RqgZ3f0Fg,12808
|
|
211
211
|
letta_client/core/__init__.py,sha256=OKbX2aCZXgHCDUsCouqv-OiX32xA6eFFCKIUH9M5Vzk,1591
|
|
212
212
|
letta_client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
|
213
|
-
letta_client/core/client_wrapper.py,sha256=
|
|
213
|
+
letta_client/core/client_wrapper.py,sha256=PaWs3oVGFTTFjdIUGnegCqPZLhStjavktwtoeHmzT1E,1997
|
|
214
214
|
letta_client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
|
215
215
|
letta_client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
|
216
|
-
letta_client/core/http_client.py,sha256=
|
|
216
|
+
letta_client/core/http_client.py,sha256=Z77OIxIbL4OAB2IDqjRq_sYa5yNYAWfmdhdCSSvh6Y4,19552
|
|
217
217
|
letta_client/core/jsonable_encoder.py,sha256=qaF1gtgH-kQZb4kJskETwcCsOPUof-NnYVdszHkb-dM,3656
|
|
218
|
-
letta_client/core/pydantic_utilities.py,sha256=
|
|
218
|
+
letta_client/core/pydantic_utilities.py,sha256=UibVGGYmBDsV834x8CtckRDrTIL4lYJPMrcq9yvf7RM,11973
|
|
219
219
|
letta_client/core/query_encoder.py,sha256=ekulqNd0j8TgD7ox-Qbz7liqX8-KP9blvT9DsRCenYM,2144
|
|
220
220
|
letta_client/core/remove_none_from_dict.py,sha256=EU9SGgYidWq7SexuJbNs4-PZ-5Bl3Vppd864mS6vQZw,342
|
|
221
221
|
letta_client/core/request_options.py,sha256=h0QUNCFVdCW_7GclVySCAY2w4NhtXVBUCmHgmzaxpcg,1681
|
|
@@ -251,7 +251,7 @@ letta_client/steps/client.py,sha256=g4XUUtdKzkSiRkxJW6ACrYe8ySvJ_tUMGK4ag6QRZT4,
|
|
|
251
251
|
letta_client/tag/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
252
252
|
letta_client/tag/client.py,sha256=TBAotdb0e2_x2pANF4dOE1qmWY3GIgb7nOhvN7iZ3_4,5183
|
|
253
253
|
letta_client/templates/__init__.py,sha256=67hjKjA8ZYiqjIAHObdIQLVgtbMX7kb6RNaxOUkeQBw,24253
|
|
254
|
-
letta_client/templates/client.py,sha256=
|
|
254
|
+
letta_client/templates/client.py,sha256=k1eya9jpfKw8CwKP8U7qIhKVmpk1IBqPG-oeK8C6fOM,7188
|
|
255
255
|
letta_client/templates/types/__init__.py,sha256=LGDzJg0Gv_Ewfq8plfFOvaD6K2cRLi21mii9xcS01NE,39681
|
|
256
256
|
letta_client/templates/types/templates_create_agents_response.py,sha256=UNMZSUckqoug1sq-gqC7luO392eItxxy0NNdUL0CRfQ,725
|
|
257
257
|
letta_client/templates/types/templates_create_agents_response_agents_item.py,sha256=xaEfez_Y4tIlVnCUXrtY9VgQ2XjodS0ua-9trsO9IJQ,5203
|
|
@@ -432,7 +432,7 @@ letta_client/types/agent_state.py,sha256=nym-OgbsFyhaffhKqDoKB3IRs_kRXgoULjaSYUl
|
|
|
432
432
|
letta_client/types/agent_state_tool_rules_item.py,sha256=qWQIVi8G-ulUjHJqkUDOZQdSN7aajyOxwg3Y7rBBrOs,448
|
|
433
433
|
letta_client/types/agent_type.py,sha256=BvztKbFTW_Acvc3QPIvzK7JGwSLie1V407byu-VZHz0,195
|
|
434
434
|
letta_client/types/app_auth_scheme.py,sha256=_6FLlw3drQ3HDSP9SecStBwQyE0DgL6UvKFArCC4yp8,1242
|
|
435
|
-
letta_client/types/app_auth_scheme_auth_mode.py,sha256=
|
|
435
|
+
letta_client/types/app_auth_scheme_auth_mode.py,sha256=KfJ8AQVxlvWo2DgDGak9yXtx5F2lvRULB2KVGy2aSJo,412
|
|
436
436
|
letta_client/types/app_model.py,sha256=cypZdZ12NW9pbG23XW9qTtGnZNwNlJxoxBERaFcLmso,1519
|
|
437
437
|
letta_client/types/assistant_message.py,sha256=OWJz-tAsuiA1bZguDbvIBJezzjYiQWt8kWCxwxK-zN4,779
|
|
438
438
|
letta_client/types/assistant_message_content.py,sha256=2XtIgU1tzCHgp-NwWIkUFohOd1GClieiRk9OATTEcew,188
|
|
@@ -596,9 +596,9 @@ letta_client/types/validation_error.py,sha256=ACDS7wL5nQbS8ymFhWljwbBJmbugNa8bs2
|
|
|
596
596
|
letta_client/types/validation_error_loc_item.py,sha256=LAtjCHIllWRBFXvAZ5QZpp7CPXjdtN9EB7HrLVo6EP0,128
|
|
597
597
|
letta_client/version.py,sha256=bttKLbIhO3UonCYQlqs600zzbQgfhCCMjeXR9WRzid4,79
|
|
598
598
|
letta_client/voice/__init__.py,sha256=ZrZEuXIukVGhsfM-i0dIFfqjeSOBMPeEgDva7VvnipE,167
|
|
599
|
-
letta_client/voice/client.py,sha256=
|
|
599
|
+
letta_client/voice/client.py,sha256=O38dLq__WTwLPlFTtvw1hgqaPYK9alds_ft12Bnp5fs,6475
|
|
600
600
|
letta_client/voice/types/__init__.py,sha256=hBLJcrom99DkDxxsVRU2ni8kPx6SsCy8gtAJvNOz26w,199
|
|
601
601
|
letta_client/voice/types/create_voice_chat_completions_request.py,sha256=K4__83rXRCshfdobyAmH-5fUDJQ_PeSQetTUeC4Abk0,381
|
|
602
|
-
letta_client-0.1.
|
|
603
|
-
letta_client-0.1.
|
|
604
|
-
letta_client-0.1.
|
|
602
|
+
letta_client-0.1.61.dist-info/METADATA,sha256=6zLZ_3Kcw-_jn0YQQAzcs__x7jx0iTVLoataSzsZCPQ,4942
|
|
603
|
+
letta_client-0.1.61.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
|
604
|
+
letta_client-0.1.61.dist-info/RECORD,,
|
|
File without changes
|