letta-client 0.1.156__py3-none-any.whl → 0.1.158__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 CHANGED
@@ -131,7 +131,6 @@ from .types import (
131
131
  LettaRequestConfig,
132
132
  LettaResponse,
133
133
  LettaStopReason,
134
- LettaStopReasonStopReason,
135
134
  LettaStreamingRequest,
136
135
  LettaUsageStatistics,
137
136
  LettaUserMessageContentUnion,
@@ -197,6 +196,7 @@ from .types import (
197
196
  SseServerConfig,
198
197
  StdioServerConfig,
199
198
  Step,
199
+ StopReasonType,
200
200
  SupervisorManager,
201
201
  SupervisorManagerUpdate,
202
202
  SystemMessage,
@@ -308,7 +308,6 @@ from .tools import (
308
308
  ListMcpServersResponseValue,
309
309
  )
310
310
  from .version import __version__
311
- from .voice import CreateVoiceChatCompletionsRequestBody
312
311
 
313
312
  __all__ = [
314
313
  "ActionModel",
@@ -414,7 +413,6 @@ __all__ = [
414
413
  "CreateAgentRequestResponseFormat",
415
414
  "CreateAgentRequestToolRulesItem",
416
415
  "CreateBlock",
417
- "CreateVoiceChatCompletionsRequestBody",
418
416
  "DeleteMcpServerResponseItem",
419
417
  "DynamicManager",
420
418
  "DynamicManagerUpdate",
@@ -468,7 +466,6 @@ __all__ = [
468
466
  "LettaRequestConfig",
469
467
  "LettaResponse",
470
468
  "LettaStopReason",
471
- "LettaStopReasonStopReason",
472
469
  "LettaStreamingRequest",
473
470
  "LettaUsageStatistics",
474
471
  "LettaUserMessageContentUnion",
@@ -539,6 +536,7 @@ __all__ = [
539
536
  "SseServerConfig",
540
537
  "StdioServerConfig",
541
538
  "Step",
539
+ "StopReasonType",
542
540
  "SupervisorManager",
543
541
  "SupervisorManagerUpdate",
544
542
  "SystemMessage",
@@ -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.156",
19
+ "X-Fern-SDK-Version": "0.1.158",
20
20
  }
21
21
  if self.token is not None:
22
22
  headers["Authorization"] = f"Bearer {self.token}"
@@ -130,7 +130,6 @@ from .letta_request import LettaRequest
130
130
  from .letta_request_config import LettaRequestConfig
131
131
  from .letta_response import LettaResponse
132
132
  from .letta_stop_reason import LettaStopReason
133
- from .letta_stop_reason_stop_reason import LettaStopReasonStopReason
134
133
  from .letta_streaming_request import LettaStreamingRequest
135
134
  from .letta_usage_statistics import LettaUsageStatistics
136
135
  from .letta_user_message_content_union import LettaUserMessageContentUnion
@@ -200,6 +199,7 @@ from .source import Source
200
199
  from .sse_server_config import SseServerConfig
201
200
  from .stdio_server_config import StdioServerConfig
202
201
  from .step import Step
202
+ from .stop_reason_type import StopReasonType
203
203
  from .supervisor_manager import SupervisorManager
204
204
  from .supervisor_manager_update import SupervisorManagerUpdate
205
205
  from .system_message import SystemMessage
@@ -378,7 +378,6 @@ __all__ = [
378
378
  "LettaRequestConfig",
379
379
  "LettaResponse",
380
380
  "LettaStopReason",
381
- "LettaStopReasonStopReason",
382
381
  "LettaStreamingRequest",
383
382
  "LettaUsageStatistics",
384
383
  "LettaUserMessageContentUnion",
@@ -444,6 +443,7 @@ __all__ = [
444
443
  "SseServerConfig",
445
444
  "StdioServerConfig",
446
445
  "Step",
446
+ "StopReasonType",
447
447
  "SupervisorManager",
448
448
  "SupervisorManagerUpdate",
449
449
  "SystemMessage",
@@ -4,6 +4,7 @@ from ..core.unchecked_base_model import UncheckedBaseModel
4
4
  import typing
5
5
  from .letta_message_union import LettaMessageUnion
6
6
  import pydantic
7
+ from .letta_stop_reason import LettaStopReason
7
8
  from .letta_usage_statistics import LettaUsageStatistics
8
9
  from ..core.pydantic_utilities import IS_PYDANTIC_V2
9
10
 
@@ -23,6 +24,7 @@ class LettaResponse(UncheckedBaseModel):
23
24
  The messages returned by the agent.
24
25
  """
25
26
 
27
+ stop_reason: LettaStopReason
26
28
  usage: LettaUsageStatistics = pydantic.Field()
27
29
  """
28
30
  The usage statistics of the agent.
@@ -3,13 +3,13 @@
3
3
  from ..core.unchecked_base_model import UncheckedBaseModel
4
4
  import typing
5
5
  import pydantic
6
- from .letta_stop_reason_stop_reason import LettaStopReasonStopReason
6
+ from .stop_reason_type import StopReasonType
7
7
  from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
8
 
9
9
 
10
10
  class LettaStopReason(UncheckedBaseModel):
11
11
  """
12
- Letta provided stop reason for why agent loop ended.
12
+ The stop reason from Letta indicating why agent loop stopped execution.
13
13
  """
14
14
 
15
15
  message_type: typing.Optional[typing.Literal["stop_reason"]] = pydantic.Field(default=None)
@@ -17,7 +17,10 @@ class LettaStopReason(UncheckedBaseModel):
17
17
  The type of the message.
18
18
  """
19
19
 
20
- stop_reason: LettaStopReasonStopReason
20
+ stop_reason: StopReasonType = pydantic.Field()
21
+ """
22
+ The reason why execution stopped.
23
+ """
21
24
 
22
25
  if IS_PYDANTIC_V2:
23
26
  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
- LettaStopReasonStopReason = typing.Union[
6
- typing.Literal["end_turn", "error", "invalid_tool_call", "max_steps", "no_tool_call"], typing.Any
5
+ StopReasonType = typing.Union[
6
+ typing.Literal["end_turn", "error", "invalid_tool_call", "max_steps", "no_tool_call", "tool_rule"], typing.Any
7
7
  ]
@@ -1,5 +1,2 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from .types import CreateVoiceChatCompletionsRequestBody
4
-
5
- __all__ = ["CreateVoiceChatCompletionsRequestBody"]
@@ -2,10 +2,8 @@
2
2
 
3
3
  import typing
4
4
  from ..core.client_wrapper import SyncClientWrapper
5
- from .types.create_voice_chat_completions_request_body import CreateVoiceChatCompletionsRequestBody
6
5
  from ..core.request_options import RequestOptions
7
6
  from ..core.jsonable_encoder import jsonable_encoder
8
- from ..core.serialization import convert_and_respect_annotation_metadata
9
7
  from ..core.unchecked_base_model import construct_type
10
8
  from ..errors.unprocessable_entity_error import UnprocessableEntityError
11
9
  from ..types.http_validation_error import HttpValidationError
@@ -25,7 +23,7 @@ class VoiceClient:
25
23
  self,
26
24
  agent_id: str,
27
25
  *,
28
- request: CreateVoiceChatCompletionsRequestBody,
26
+ request: typing.Dict[str, typing.Optional[typing.Any]],
29
27
  user_id: typing.Optional[str] = None,
30
28
  request_options: typing.Optional[RequestOptions] = None,
31
29
  ) -> typing.Optional[typing.Any]:
@@ -34,7 +32,7 @@ class VoiceClient:
34
32
  ----------
35
33
  agent_id : str
36
34
 
37
- request : CreateVoiceChatCompletionsRequestBody
35
+ request : typing.Dict[str, typing.Optional[typing.Any]]
38
36
 
39
37
  user_id : typing.Optional[str]
40
38
 
@@ -48,33 +46,20 @@ class VoiceClient:
48
46
 
49
47
  Examples
50
48
  --------
51
- from letta_client import (
52
- ChatCompletionDeveloperMessageParam,
53
- CompletionCreateParamsNonStreaming,
54
- Letta,
55
- )
49
+ from letta_client import Letta
56
50
 
57
51
  client = Letta(
58
52
  token="YOUR_TOKEN",
59
53
  )
60
54
  client.voice.create_voice_chat_completions(
61
55
  agent_id="agent_id",
62
- request=CompletionCreateParamsNonStreaming(
63
- messages=[
64
- ChatCompletionDeveloperMessageParam(
65
- content="content",
66
- )
67
- ],
68
- model="model",
69
- ),
56
+ request={"key": "value"},
70
57
  )
71
58
  """
72
59
  _response = self._client_wrapper.httpx_client.request(
73
60
  f"v1/voice-beta/{jsonable_encoder(agent_id)}/chat/completions",
74
61
  method="POST",
75
- json=convert_and_respect_annotation_metadata(
76
- object_=request, annotation=CreateVoiceChatCompletionsRequestBody, direction="write"
77
- ),
62
+ json=request,
78
63
  headers={
79
64
  "user-id": str(user_id) if user_id is not None else None,
80
65
  },
@@ -114,7 +99,7 @@ class AsyncVoiceClient:
114
99
  self,
115
100
  agent_id: str,
116
101
  *,
117
- request: CreateVoiceChatCompletionsRequestBody,
102
+ request: typing.Dict[str, typing.Optional[typing.Any]],
118
103
  user_id: typing.Optional[str] = None,
119
104
  request_options: typing.Optional[RequestOptions] = None,
120
105
  ) -> typing.Optional[typing.Any]:
@@ -123,7 +108,7 @@ class AsyncVoiceClient:
123
108
  ----------
124
109
  agent_id : str
125
110
 
126
- request : CreateVoiceChatCompletionsRequestBody
111
+ request : typing.Dict[str, typing.Optional[typing.Any]]
127
112
 
128
113
  user_id : typing.Optional[str]
129
114
 
@@ -139,11 +124,7 @@ class AsyncVoiceClient:
139
124
  --------
140
125
  import asyncio
141
126
 
142
- from letta_client import (
143
- AsyncLetta,
144
- ChatCompletionDeveloperMessageParam,
145
- CompletionCreateParamsNonStreaming,
146
- )
127
+ from letta_client import AsyncLetta
147
128
 
148
129
  client = AsyncLetta(
149
130
  token="YOUR_TOKEN",
@@ -153,14 +134,7 @@ class AsyncVoiceClient:
153
134
  async def main() -> None:
154
135
  await client.voice.create_voice_chat_completions(
155
136
  agent_id="agent_id",
156
- request=CompletionCreateParamsNonStreaming(
157
- messages=[
158
- ChatCompletionDeveloperMessageParam(
159
- content="content",
160
- )
161
- ],
162
- model="model",
163
- ),
137
+ request={"key": "value"},
164
138
  )
165
139
 
166
140
 
@@ -169,9 +143,7 @@ class AsyncVoiceClient:
169
143
  _response = await self._client_wrapper.httpx_client.request(
170
144
  f"v1/voice-beta/{jsonable_encoder(agent_id)}/chat/completions",
171
145
  method="POST",
172
- json=convert_and_respect_annotation_metadata(
173
- object_=request, annotation=CreateVoiceChatCompletionsRequestBody, direction="write"
174
- ),
146
+ json=request,
175
147
  headers={
176
148
  "user-id": str(user_id) if user_id is not None else None,
177
149
  },
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-client
3
- Version: 0.1.156
3
+ Version: 0.1.158
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -1,4 +1,4 @@
1
- letta_client/__init__.py,sha256=7u0luArqfecdYLSMewasD0fxBxN9gF3fXJizNWKmwvQ,17318
1
+ letta_client/__init__.py,sha256=2X95vFIKPYYoAtp_d437qy_T9kGhn3tSjgvglH3upKE,17194
2
2
  letta_client/agents/__init__.py,sha256=3oFWVxaaxkphkjGJVk31Llb9ll9dKoCGx3B_r3qqtes,1716
3
3
  letta_client/agents/blocks/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
4
4
  letta_client/agents/blocks/client.py,sha256=ecE03lE5tP1AtCMFLT9FzdYyQMx_D7NI5m42b41pV40,24684
@@ -62,7 +62,7 @@ letta_client/client_side_access_tokens/types/client_side_access_tokens_create_re
62
62
  letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy_data_item_access_item.py,sha256=R-H25IpNp9feSrW8Yj3h9O3UTMVvFniQJElogKxLuoE,254
63
63
  letta_client/core/__init__.py,sha256=OKbX2aCZXgHCDUsCouqv-OiX32xA6eFFCKIUH9M5Vzk,1591
64
64
  letta_client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
65
- letta_client/core/client_wrapper.py,sha256=qYScC7kO2sbo1qhstEPj1w5fdEAUL6BomWfIp4Nq42M,1998
65
+ letta_client/core/client_wrapper.py,sha256=nKg5nPtYoLHksAm6lUSNv3-Pw5OsuE2E5Gbkr-eEoBo,1998
66
66
  letta_client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
67
67
  letta_client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
68
68
  letta_client/core/http_client.py,sha256=Z77OIxIbL4OAB2IDqjRq_sYa5yNYAWfmdhdCSSvh6Y4,19552
@@ -150,7 +150,7 @@ letta_client/tools/types/add_mcp_server_request.py,sha256=EieZjfOT95sjkpxXdqy7gl
150
150
  letta_client/tools/types/add_mcp_server_response_item.py,sha256=pb3A4IoP7Qpen0UDDniXrASYEJZWnYnnrZThtPkvZt4,270
151
151
  letta_client/tools/types/delete_mcp_server_response_item.py,sha256=hKc4uehqcubO8BzpgMlvk2jJAjHXOWRM_zmWsCz_vZE,273
152
152
  letta_client/tools/types/list_mcp_servers_response_value.py,sha256=AIoXu4bO8QNSU7zjL1jj0Rg4313wVtPaTt13W0aevLQ,273
153
- letta_client/types/__init__.py,sha256=2e-vGb4Xk9AWaVhsOBlh3DREgh3WfbAdEHPQUGvBnpY,21755
153
+ letta_client/types/__init__.py,sha256=4sJJKkC2a_9Tt-jwNSuO_he06cojsUlkYpk45V3cL3Q,21720
154
154
  letta_client/types/action_model.py,sha256=y1e2XMv3skFaNJIBdYoBKgiORzGh05aOVvu-qVR9uHg,1240
155
155
  letta_client/types/action_parameters_model.py,sha256=LgKf5aPZG3-OHGxFdXiSokIDgce8c02xPYIAY05VgW8,828
156
156
  letta_client/types/action_response_model.py,sha256=yq2Fd9UU8j7vvtE3VqXUoRRvDzWcfJPj_95ynGdeHCs,824
@@ -279,9 +279,8 @@ letta_client/types/letta_message_content_union.py,sha256=ypGyeR8PGqPGaAWtLWjDkWw
279
279
  letta_client/types/letta_message_union.py,sha256=TTQwlur2CZNdZ466Nb_2TFcSFXrgoMliaNzD33t7Ktw,603
280
280
  letta_client/types/letta_request.py,sha256=vhS3qQYxNN2dlE_kXWPW3BJekBDMTSRp1MXmj4-ztfQ,1659
281
281
  letta_client/types/letta_request_config.py,sha256=b6K4QtDdHjcZKfBb1fugUuoPrT2N4d5TTB0PIRNI2SU,1085
282
- letta_client/types/letta_response.py,sha256=i5gAUTgWzIst_RP8I_zSh0GSnLIS3z--1BmK6EF1mkQ,1315
283
- letta_client/types/letta_stop_reason.py,sha256=urH4dc6Y6o_5rS8shE-qiUgBs1cM6DmCyTgrTNPXiN0,874
284
- letta_client/types/letta_stop_reason_stop_reason.py,sha256=cssk6ZibCFcf4sR6O71fC1kasDxuul5WntxLIIaRdZU,226
282
+ letta_client/types/letta_response.py,sha256=5brJ39B8PxTBpm5_clL9XGP1SQ1pox-G0gxMDkitMlw,1395
283
+ letta_client/types/letta_stop_reason.py,sha256=5uqJibhaT6LFTj6Sf6m0VJKS1FJzIIgymjZTvu2a0Zk,931
285
284
  letta_client/types/letta_streaming_request.py,sha256=YJ_6ge5xrzQjOs2UTY3FxwhTv6QoCi9XWv5Rod01W1E,1884
286
285
  letta_client/types/letta_usage_statistics.py,sha256=k6V72J2TEPd-RQBuUQxF3oylrAMcuSKBskd2nnZmGOw,1886
287
286
  letta_client/types/letta_user_message_content_union.py,sha256=3Gbs3mRk-tJj2z0Mf-BNDomWHEytQd3OTUN4xnEVsuE,229
@@ -347,6 +346,7 @@ letta_client/types/source.py,sha256=BsfE9yrefXREQtskGZnR-TFGqmHkFKIGHC5udtHUi14,
347
346
  letta_client/types/sse_server_config.py,sha256=b-h5FLm5MELZ5A9bwZt-02Zx_f3UbfKAQS--yHQVOQU,844
348
347
  letta_client/types/stdio_server_config.py,sha256=dEQ7bguiLikGemLxYZJ3JCmmEQgAMsSPO_P52oHZSl0,1091
349
348
  letta_client/types/step.py,sha256=-5KHfBc6NZnYGLXHJMK6Bdyw2ae0G1zPFzsURjPiN3c,3133
349
+ letta_client/types/stop_reason_type.py,sha256=PyYTS9bIvCSDfzyG4wJyk6bi9fCdDBNsoleLd7nMJYI,228
350
350
  letta_client/types/supervisor_manager.py,sha256=VdR1ySp4k43apxM8Bb5uNoBvADsvz8oMEEtDy2F5K6M,676
351
351
  letta_client/types/supervisor_manager_update.py,sha256=UJ_TcWcF_PK152Gni0tgRCe3bthCgJbQHCZIb5LLsL0,711
352
352
  letta_client/types/system_message.py,sha256=Dn1GkT1INUGLHkwBsqJL0HtkcGXx0CAKqzSl34jZ4xM,1302
@@ -394,10 +394,8 @@ letta_client/types/web_search_options_search_context_size.py,sha256=RgJGV4rkuaCT
394
394
  letta_client/types/web_search_options_user_location.py,sha256=4aXfFcwUBu7YNA5XBjfhmD6tgRb0e8LTFexmn-rkDfw,770
395
395
  letta_client/types/web_search_options_user_location_approximate.py,sha256=Ywk01J9H67L6_498E5E6ceJ2VbJUfcLiIJWD_s92_M0,731
396
396
  letta_client/version.py,sha256=bttKLbIhO3UonCYQlqs600zzbQgfhCCMjeXR9WRzid4,79
397
- letta_client/voice/__init__.py,sha256=7hX85553PiRMtIMM12a0DSoFzsglNiUziYR2ekS84Qw,175
398
- letta_client/voice/client.py,sha256=STjswa5oOLoP59QwTJvQwi73kgn0UzKOaXc2CsTRI4k,6912
399
- letta_client/voice/types/__init__.py,sha256=FRc3iKRTONE4N8Lf1IqvnqWZ2kXdrFFvkL7PxVcR8Ew,212
400
- letta_client/voice/types/create_voice_chat_completions_request_body.py,sha256=ZLfKgNK1T6IAwLEvaBVFfy7jEAoPUXP28n-nfmHkklc,391
401
- letta_client-0.1.156.dist-info/METADATA,sha256=bc9GJPKvPfTNAESMSJeKDYwYoA_bAEnh-rlEWHEyAU8,5093
402
- letta_client-0.1.156.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
403
- letta_client-0.1.156.dist-info/RECORD,,
397
+ letta_client/voice/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
398
+ letta_client/voice/client.py,sha256=EX79F2D5bieXNP8g1ZPw8xwAzqE1A3hshCHUSlTV1kw,5739
399
+ letta_client-0.1.158.dist-info/METADATA,sha256=TADPzFpKPXVxzN0-didPXQNa94hW9b36Tzq96tj5y2Y,5093
400
+ letta_client-0.1.158.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
401
+ letta_client-0.1.158.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- from .create_voice_chat_completions_request_body import CreateVoiceChatCompletionsRequestBody
4
-
5
- __all__ = ["CreateVoiceChatCompletionsRequestBody"]
@@ -1,9 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
- from ...types.completion_create_params_non_streaming import CompletionCreateParamsNonStreaming
5
- from ...types.completion_create_params_streaming import CompletionCreateParamsStreaming
6
-
7
- CreateVoiceChatCompletionsRequestBody = typing.Union[
8
- CompletionCreateParamsNonStreaming, CompletionCreateParamsStreaming
9
- ]