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

@@ -198,6 +198,58 @@ class BlocksClient:
198
198
  raise ApiError(status_code=_response.status_code, body=_response.text)
199
199
  raise ApiError(status_code=_response.status_code, body=_response_json)
200
200
 
201
+ def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
202
+ """
203
+ Count all blocks created by a user.
204
+
205
+ Parameters
206
+ ----------
207
+ request_options : typing.Optional[RequestOptions]
208
+ Request-specific configuration.
209
+
210
+ Returns
211
+ -------
212
+ int
213
+ Successful Response
214
+
215
+ Examples
216
+ --------
217
+ from letta_client import Letta
218
+
219
+ client = Letta(
220
+ token="YOUR_TOKEN",
221
+ )
222
+ client.blocks.count()
223
+ """
224
+ _response = self._client_wrapper.httpx_client.request(
225
+ "v1/blocks/count",
226
+ method="GET",
227
+ request_options=request_options,
228
+ )
229
+ try:
230
+ if 200 <= _response.status_code < 300:
231
+ return typing.cast(
232
+ int,
233
+ construct_type(
234
+ type_=int, # type: ignore
235
+ object_=_response.json(),
236
+ ),
237
+ )
238
+ if _response.status_code == 422:
239
+ raise UnprocessableEntityError(
240
+ typing.cast(
241
+ HttpValidationError,
242
+ construct_type(
243
+ type_=HttpValidationError, # type: ignore
244
+ object_=_response.json(),
245
+ ),
246
+ )
247
+ )
248
+ _response_json = _response.json()
249
+ except JSONDecodeError:
250
+ raise ApiError(status_code=_response.status_code, body=_response.text)
251
+ raise ApiError(status_code=_response.status_code, body=_response_json)
252
+
201
253
  def retrieve(self, block_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Block:
202
254
  """
203
255
  Parameters
@@ -600,6 +652,66 @@ class AsyncBlocksClient:
600
652
  raise ApiError(status_code=_response.status_code, body=_response.text)
601
653
  raise ApiError(status_code=_response.status_code, body=_response_json)
602
654
 
655
+ async def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
656
+ """
657
+ Count all blocks created by a user.
658
+
659
+ Parameters
660
+ ----------
661
+ request_options : typing.Optional[RequestOptions]
662
+ Request-specific configuration.
663
+
664
+ Returns
665
+ -------
666
+ int
667
+ Successful Response
668
+
669
+ Examples
670
+ --------
671
+ import asyncio
672
+
673
+ from letta_client import AsyncLetta
674
+
675
+ client = AsyncLetta(
676
+ token="YOUR_TOKEN",
677
+ )
678
+
679
+
680
+ async def main() -> None:
681
+ await client.blocks.count()
682
+
683
+
684
+ asyncio.run(main())
685
+ """
686
+ _response = await self._client_wrapper.httpx_client.request(
687
+ "v1/blocks/count",
688
+ method="GET",
689
+ request_options=request_options,
690
+ )
691
+ try:
692
+ if 200 <= _response.status_code < 300:
693
+ return typing.cast(
694
+ int,
695
+ construct_type(
696
+ type_=int, # type: ignore
697
+ object_=_response.json(),
698
+ ),
699
+ )
700
+ if _response.status_code == 422:
701
+ raise UnprocessableEntityError(
702
+ typing.cast(
703
+ HttpValidationError,
704
+ construct_type(
705
+ type_=HttpValidationError, # type: ignore
706
+ object_=_response.json(),
707
+ ),
708
+ )
709
+ )
710
+ _response_json = _response.json()
711
+ except JSONDecodeError:
712
+ raise ApiError(status_code=_response.status_code, body=_response.text)
713
+ raise ApiError(status_code=_response.status_code, body=_response_json)
714
+
603
715
  async def retrieve(self, block_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Block:
604
716
  """
605
717
  Parameters
@@ -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.137",
19
+ "X-Fern-SDK-Version": "0.1.138",
20
20
  }
21
21
  if self.token is not None:
22
22
  headers["Authorization"] = f"Bearer {self.token}"
@@ -201,6 +201,58 @@ class GroupsClient:
201
201
  raise ApiError(status_code=_response.status_code, body=_response.text)
202
202
  raise ApiError(status_code=_response.status_code, body=_response_json)
203
203
 
204
+ def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
205
+ """
206
+ Get the count of all groups associated with a given user.
207
+
208
+ Parameters
209
+ ----------
210
+ request_options : typing.Optional[RequestOptions]
211
+ Request-specific configuration.
212
+
213
+ Returns
214
+ -------
215
+ int
216
+ Successful Response
217
+
218
+ Examples
219
+ --------
220
+ from letta_client import Letta
221
+
222
+ client = Letta(
223
+ token="YOUR_TOKEN",
224
+ )
225
+ client.groups.count()
226
+ """
227
+ _response = self._client_wrapper.httpx_client.request(
228
+ "v1/groups/count",
229
+ method="GET",
230
+ request_options=request_options,
231
+ )
232
+ try:
233
+ if 200 <= _response.status_code < 300:
234
+ return typing.cast(
235
+ int,
236
+ construct_type(
237
+ type_=int, # type: ignore
238
+ object_=_response.json(),
239
+ ),
240
+ )
241
+ if _response.status_code == 422:
242
+ raise UnprocessableEntityError(
243
+ typing.cast(
244
+ HttpValidationError,
245
+ construct_type(
246
+ type_=HttpValidationError, # type: ignore
247
+ object_=_response.json(),
248
+ ),
249
+ )
250
+ )
251
+ _response_json = _response.json()
252
+ except JSONDecodeError:
253
+ raise ApiError(status_code=_response.status_code, body=_response.text)
254
+ raise ApiError(status_code=_response.status_code, body=_response_json)
255
+
204
256
  def retrieve(self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Group:
205
257
  """
206
258
  Retrieve the group by id.
@@ -604,6 +656,66 @@ class AsyncGroupsClient:
604
656
  raise ApiError(status_code=_response.status_code, body=_response.text)
605
657
  raise ApiError(status_code=_response.status_code, body=_response_json)
606
658
 
659
+ async def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
660
+ """
661
+ Get the count of all groups associated with a given user.
662
+
663
+ Parameters
664
+ ----------
665
+ request_options : typing.Optional[RequestOptions]
666
+ Request-specific configuration.
667
+
668
+ Returns
669
+ -------
670
+ int
671
+ Successful Response
672
+
673
+ Examples
674
+ --------
675
+ import asyncio
676
+
677
+ from letta_client import AsyncLetta
678
+
679
+ client = AsyncLetta(
680
+ token="YOUR_TOKEN",
681
+ )
682
+
683
+
684
+ async def main() -> None:
685
+ await client.groups.count()
686
+
687
+
688
+ asyncio.run(main())
689
+ """
690
+ _response = await self._client_wrapper.httpx_client.request(
691
+ "v1/groups/count",
692
+ method="GET",
693
+ request_options=request_options,
694
+ )
695
+ try:
696
+ if 200 <= _response.status_code < 300:
697
+ return typing.cast(
698
+ int,
699
+ construct_type(
700
+ type_=int, # type: ignore
701
+ object_=_response.json(),
702
+ ),
703
+ )
704
+ if _response.status_code == 422:
705
+ raise UnprocessableEntityError(
706
+ typing.cast(
707
+ HttpValidationError,
708
+ construct_type(
709
+ type_=HttpValidationError, # type: ignore
710
+ object_=_response.json(),
711
+ ),
712
+ )
713
+ )
714
+ _response_json = _response.json()
715
+ except JSONDecodeError:
716
+ raise ApiError(status_code=_response.status_code, body=_response.text)
717
+ raise ApiError(status_code=_response.status_code, body=_response_json)
718
+
607
719
  async def retrieve(self, group_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Group:
608
720
  """
609
721
  Retrieve the group by id.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-client
3
- Version: 0.1.137
3
+ Version: 0.1.138
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -49,7 +49,7 @@ letta_client/batches/client.py,sha256=3uBs2SZbOP40b-Ck_DvicHuGJe5j3JAsK156zwsofp
49
49
  letta_client/blocks/__init__.py,sha256=c6SGOs9_YGdydYAzhe5TUiaXq52rpWT1mNMcke8qGTQ,108
50
50
  letta_client/blocks/agents/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
51
51
  letta_client/blocks/agents/client.py,sha256=-QywGs_ZfE5PbgzLYf2zzn9zAtpZmzGtHHZ5sXIYw0Y,4904
52
- letta_client/blocks/client.py,sha256=kES_YNaQqA1s0VxtGCtm22jIpW5ILkqtwh8f0Qfl4ps,26189
52
+ letta_client/blocks/client.py,sha256=uHRtyrDtM4396FmcuX1tnVAzL1us9x5e9Fd5dG3u-FQ,29645
53
53
  letta_client/client.py,sha256=k2mZqqEWciVmEQHgipjCK4kQILk74hpSqzcdNwdql9A,21212
54
54
  letta_client/client_side_access_tokens/__init__.py,sha256=z_wHT4UTBK7RzDIfLpdLMtBJBuuDosqgbzdmx-QME_o,763
55
55
  letta_client/client_side_access_tokens/client.py,sha256=Qt1nmL-il4QzqWZHxY6XsSvCY8ps9FWXsWtUTPclVCc,12272
@@ -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=1w2Z6gCqCNK3HHoF4tfEDGdOZJ_UoqjoMLhlyR6YdFU,1998
65
+ letta_client/core/client_wrapper.py,sha256=YLfrI78_-ouHZQgcW2msqArJv45LwbsB2HVQqF8DiDg,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
@@ -83,7 +83,7 @@ letta_client/errors/internal_server_error.py,sha256=8USCagXyJJ1MOm9snpcXIUt6eNXv
83
83
  letta_client/errors/not_found_error.py,sha256=tBVCeBC8n3C811WHRj_n-hs3h8MqwR5gp0vLiobk7W8,262
84
84
  letta_client/errors/unprocessable_entity_error.py,sha256=FvR7XPlV3Xx5nu8HNlmLhBRdk4so_gCHjYT5PyZe6sM,313
85
85
  letta_client/groups/__init__.py,sha256=WzkNp5Q_5zQj_NHv4hJCOKvW6ftM9EuNxw8hkPRRbko,434
86
- letta_client/groups/client.py,sha256=-DVnNW7scmSXkYrHZE9x2SRslp31tI2xf3-tLrz3Rgk,26393
86
+ letta_client/groups/client.py,sha256=xcW5PU_2Z4G92Sz9vuZM97xS88lsHlv2STG91Szleow,29893
87
87
  letta_client/groups/messages/__init__.py,sha256=M7Ar6Rmb8we4dfYE6jj3FCL9UvVFy1bNQIPflUXMWHA,243
88
88
  letta_client/groups/messages/client.py,sha256=7j-omx1dbEhqImBRQ_pk4JOVqkHFxVTya6WqNslUr00,33680
89
89
  letta_client/groups/messages/types/__init__.py,sha256=Oc2j0oGOs96IEFf9xsJIkjBjoq3OMtse64YwWv3F9Io,335
@@ -382,6 +382,6 @@ letta_client/voice/__init__.py,sha256=7hX85553PiRMtIMM12a0DSoFzsglNiUziYR2ekS84Q
382
382
  letta_client/voice/client.py,sha256=STjswa5oOLoP59QwTJvQwi73kgn0UzKOaXc2CsTRI4k,6912
383
383
  letta_client/voice/types/__init__.py,sha256=FRc3iKRTONE4N8Lf1IqvnqWZ2kXdrFFvkL7PxVcR8Ew,212
384
384
  letta_client/voice/types/create_voice_chat_completions_request_body.py,sha256=ZLfKgNK1T6IAwLEvaBVFfy7jEAoPUXP28n-nfmHkklc,391
385
- letta_client-0.1.137.dist-info/METADATA,sha256=xcu44lmDDg22U1sQVfBfCWA7QpbLtA0iRouzNJflkmA,5042
386
- letta_client-0.1.137.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
387
- letta_client-0.1.137.dist-info/RECORD,,
385
+ letta_client-0.1.138.dist-info/METADATA,sha256=SV_D3z8fbOEDPuZ6bNS_H6ebhYK9cgsLSCzkkipDxJk,5042
386
+ letta_client-0.1.138.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
387
+ letta_client-0.1.138.dist-info/RECORD,,