letta-client 0.1.60__py3-none-any.whl → 0.1.62__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.

@@ -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.60",
19
+ "X-Fern-SDK-Version": "0.1.62",
20
20
  }
21
21
  if self.token is not None:
22
22
  headers["Authorization"] = f"Bearer {self.token}"
@@ -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
- retriable_400s = [429, 408, 409]
89
- return response.status_code >= 500 or response.status_code in retriable_400s
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 = 0,
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 = 0,
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 = 0,
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 = 0,
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 begining with `model_` to be used in the model
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 multi-plexed given the levers exposed in Pydantic V1 vs V2
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
@@ -3,5 +3,18 @@
3
3
  import typing
4
4
 
5
5
  AppAuthSchemeAuthMode = typing.Union[
6
- typing.Literal["OAUTH2", "OAUTH1", "API_KEY", "BASIC", "BEARER_TOKEN", "BASIC_WITH_JWT", "NO_AUTH"], typing.Any
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
  ]
@@ -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, *, request: CreateVoiceChatCompletionsRequest, request_options: typing.Optional[RequestOptions] = None
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, *, request: CreateVoiceChatCompletionsRequest, request_options: typing.Optional[RequestOptions] = None
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.60
3
+ Version: 0.1.62
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 retriable and the number of retry attempts has not grown larger than the configured
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 retriable when any of the following HTTP status codes is returned:
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=10KV9Su41lR--W7MnFWuWra2qmD3mAjUwu3W11OMUBI,1997
213
+ letta_client/core/client_wrapper.py,sha256=0hY2lLP6bDbajMY_zOt9n-F4QR_zjxIoxydYDVfyWPU,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=siUQ6UV0ARZALlxubqWSSAAPC9B4VW8y6MGlHStfaeo,19552
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=Pj_AIcjRR-xc28URvV4t2XssDPjLvpN6HAcsY3MVLRM,11973
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
@@ -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=4zgUPTye_olDGcfbwpyCAbwU-11WPGaAxO_PeA-0I0c,236
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=j3feSlNzeTVFXE7RUKEHGeMl_w0TJFBRUI3pXpLpUEI,6148
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.60.dist-info/METADATA,sha256=NIp1pzrdvA6orQsPZp1AfQdTzSgfQvwI6D4ck0M7yAk,4942
603
- letta_client-0.1.60.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
604
- letta_client-0.1.60.dist-info/RECORD,,
602
+ letta_client-0.1.62.dist-info/METADATA,sha256=qRM3R0WYKTHRU5xOCMhjGilW0fjbSayQ5njIKKeF_y0,4942
603
+ letta_client-0.1.62.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
604
+ letta_client-0.1.62.dist-info/RECORD,,