letta-client 0.1.127__py3-none-any.whl → 0.1.128__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.127",
19
+ "X-Fern-SDK-Version": "0.1.128",
20
20
  }
21
21
  if self.token is not None:
22
22
  headers["Authorization"] = f"Bearer {self.token}"
@@ -5,13 +5,13 @@ from ..core.client_wrapper import SyncClientWrapper
5
5
  from .files.client import FilesClient
6
6
  from .passages.client import PassagesClient
7
7
  from ..core.request_options import RequestOptions
8
- from ..types.source import Source
9
- from ..core.jsonable_encoder import jsonable_encoder
10
8
  from ..core.unchecked_base_model import construct_type
11
9
  from ..errors.unprocessable_entity_error import UnprocessableEntityError
12
10
  from ..types.http_validation_error import HttpValidationError
13
11
  from json.decoder import JSONDecodeError
14
12
  from ..core.api_error import ApiError
13
+ from ..types.source import Source
14
+ from ..core.jsonable_encoder import jsonable_encoder
15
15
  from ..types.embedding_config import EmbeddingConfig
16
16
  from ..core.serialization import convert_and_respect_annotation_metadata
17
17
  from ..core.client_wrapper import AsyncClientWrapper
@@ -28,6 +28,58 @@ class SourcesClient:
28
28
  self.files = FilesClient(client_wrapper=self._client_wrapper)
29
29
  self.passages = PassagesClient(client_wrapper=self._client_wrapper)
30
30
 
31
+ def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
32
+ """
33
+ Count all data sources created by a user.
34
+
35
+ Parameters
36
+ ----------
37
+ request_options : typing.Optional[RequestOptions]
38
+ Request-specific configuration.
39
+
40
+ Returns
41
+ -------
42
+ int
43
+ Successful Response
44
+
45
+ Examples
46
+ --------
47
+ from letta_client import Letta
48
+
49
+ client = Letta(
50
+ token="YOUR_TOKEN",
51
+ )
52
+ client.sources.count()
53
+ """
54
+ _response = self._client_wrapper.httpx_client.request(
55
+ "v1/sources/count",
56
+ method="GET",
57
+ request_options=request_options,
58
+ )
59
+ try:
60
+ if 200 <= _response.status_code < 300:
61
+ return typing.cast(
62
+ int,
63
+ construct_type(
64
+ type_=int, # type: ignore
65
+ object_=_response.json(),
66
+ ),
67
+ )
68
+ if _response.status_code == 422:
69
+ raise UnprocessableEntityError(
70
+ typing.cast(
71
+ HttpValidationError,
72
+ construct_type(
73
+ type_=HttpValidationError, # type: ignore
74
+ object_=_response.json(),
75
+ ),
76
+ )
77
+ )
78
+ _response_json = _response.json()
79
+ except JSONDecodeError:
80
+ raise ApiError(status_code=_response.status_code, body=_response.text)
81
+ raise ApiError(status_code=_response.status_code, body=_response_json)
82
+
31
83
  def retrieve(self, source_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Source:
32
84
  """
33
85
  Get all sources
@@ -435,7 +487,14 @@ class SourcesClient:
435
487
  raise ApiError(status_code=_response.status_code, body=_response.text)
436
488
  raise ApiError(status_code=_response.status_code, body=_response_json)
437
489
 
438
- def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
490
+
491
+ class AsyncSourcesClient:
492
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
493
+ self._client_wrapper = client_wrapper
494
+ self.files = AsyncFilesClient(client_wrapper=self._client_wrapper)
495
+ self.passages = AsyncPassagesClient(client_wrapper=self._client_wrapper)
496
+
497
+ async def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
439
498
  """
440
499
  Count all data sources created by a user.
441
500
 
@@ -451,14 +510,22 @@ class SourcesClient:
451
510
 
452
511
  Examples
453
512
  --------
454
- from letta_client import Letta
513
+ import asyncio
455
514
 
456
- client = Letta(
515
+ from letta_client import AsyncLetta
516
+
517
+ client = AsyncLetta(
457
518
  token="YOUR_TOKEN",
458
519
  )
459
- client.sources.count()
520
+
521
+
522
+ async def main() -> None:
523
+ await client.sources.count()
524
+
525
+
526
+ asyncio.run(main())
460
527
  """
461
- _response = self._client_wrapper.httpx_client.request(
528
+ _response = await self._client_wrapper.httpx_client.request(
462
529
  "v1/sources/count",
463
530
  method="GET",
464
531
  request_options=request_options,
@@ -487,13 +554,6 @@ class SourcesClient:
487
554
  raise ApiError(status_code=_response.status_code, body=_response.text)
488
555
  raise ApiError(status_code=_response.status_code, body=_response_json)
489
556
 
490
-
491
- class AsyncSourcesClient:
492
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
493
- self._client_wrapper = client_wrapper
494
- self.files = AsyncFilesClient(client_wrapper=self._client_wrapper)
495
- self.passages = AsyncPassagesClient(client_wrapper=self._client_wrapper)
496
-
497
557
  async def retrieve(self, source_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Source:
498
558
  """
499
559
  Get all sources
@@ -950,63 +1010,3 @@ class AsyncSourcesClient:
950
1010
  except JSONDecodeError:
951
1011
  raise ApiError(status_code=_response.status_code, body=_response.text)
952
1012
  raise ApiError(status_code=_response.status_code, body=_response_json)
953
-
954
- async def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
955
- """
956
- Count all data sources created by a user.
957
-
958
- Parameters
959
- ----------
960
- request_options : typing.Optional[RequestOptions]
961
- Request-specific configuration.
962
-
963
- Returns
964
- -------
965
- int
966
- Successful Response
967
-
968
- Examples
969
- --------
970
- import asyncio
971
-
972
- from letta_client import AsyncLetta
973
-
974
- client = AsyncLetta(
975
- token="YOUR_TOKEN",
976
- )
977
-
978
-
979
- async def main() -> None:
980
- await client.sources.count()
981
-
982
-
983
- asyncio.run(main())
984
- """
985
- _response = await self._client_wrapper.httpx_client.request(
986
- "v1/sources/count",
987
- method="GET",
988
- request_options=request_options,
989
- )
990
- try:
991
- if 200 <= _response.status_code < 300:
992
- return typing.cast(
993
- int,
994
- construct_type(
995
- type_=int, # type: ignore
996
- object_=_response.json(),
997
- ),
998
- )
999
- if _response.status_code == 422:
1000
- raise UnprocessableEntityError(
1001
- typing.cast(
1002
- HttpValidationError,
1003
- construct_type(
1004
- type_=HttpValidationError, # type: ignore
1005
- object_=_response.json(),
1006
- ),
1007
- )
1008
- )
1009
- _response_json = _response.json()
1010
- except JSONDecodeError:
1011
- raise ApiError(status_code=_response.status_code, body=_response.text)
1012
- raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -245,6 +245,69 @@ class ToolsClient:
245
245
  raise ApiError(status_code=_response.status_code, body=_response.text)
246
246
  raise ApiError(status_code=_response.status_code, body=_response_json)
247
247
 
248
+ def count(
249
+ self,
250
+ *,
251
+ include_base_tools: typing.Optional[bool] = None,
252
+ request_options: typing.Optional[RequestOptions] = None,
253
+ ) -> int:
254
+ """
255
+ Get a count of all tools available to agents belonging to the org of the user.
256
+
257
+ Parameters
258
+ ----------
259
+ include_base_tools : typing.Optional[bool]
260
+ Include built-in Letta tools in the count
261
+
262
+ request_options : typing.Optional[RequestOptions]
263
+ Request-specific configuration.
264
+
265
+ Returns
266
+ -------
267
+ int
268
+ Successful Response
269
+
270
+ Examples
271
+ --------
272
+ from letta_client import Letta
273
+
274
+ client = Letta(
275
+ token="YOUR_TOKEN",
276
+ )
277
+ client.tools.count()
278
+ """
279
+ _response = self._client_wrapper.httpx_client.request(
280
+ "v1/tools/count",
281
+ method="GET",
282
+ params={
283
+ "include_base_tools": include_base_tools,
284
+ },
285
+ request_options=request_options,
286
+ )
287
+ try:
288
+ if 200 <= _response.status_code < 300:
289
+ return typing.cast(
290
+ int,
291
+ construct_type(
292
+ type_=int, # type: ignore
293
+ object_=_response.json(),
294
+ ),
295
+ )
296
+ if _response.status_code == 422:
297
+ raise UnprocessableEntityError(
298
+ typing.cast(
299
+ HttpValidationError,
300
+ construct_type(
301
+ type_=HttpValidationError, # type: ignore
302
+ object_=_response.json(),
303
+ ),
304
+ )
305
+ )
306
+ _response_json = _response.json()
307
+ except JSONDecodeError:
308
+ raise ApiError(status_code=_response.status_code, body=_response.text)
309
+ raise ApiError(status_code=_response.status_code, body=_response_json)
310
+
248
311
  def list(
249
312
  self,
250
313
  *,
@@ -507,58 +570,6 @@ class ToolsClient:
507
570
  raise ApiError(status_code=_response.status_code, body=_response.text)
508
571
  raise ApiError(status_code=_response.status_code, body=_response_json)
509
572
 
510
- def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
511
- """
512
- Get a count of all tools available to agents belonging to the org of the user
513
-
514
- Parameters
515
- ----------
516
- request_options : typing.Optional[RequestOptions]
517
- Request-specific configuration.
518
-
519
- Returns
520
- -------
521
- int
522
- Successful Response
523
-
524
- Examples
525
- --------
526
- from letta_client import Letta
527
-
528
- client = Letta(
529
- token="YOUR_TOKEN",
530
- )
531
- client.tools.count()
532
- """
533
- _response = self._client_wrapper.httpx_client.request(
534
- "v1/tools/count",
535
- method="GET",
536
- request_options=request_options,
537
- )
538
- try:
539
- if 200 <= _response.status_code < 300:
540
- return typing.cast(
541
- int,
542
- construct_type(
543
- type_=int, # type: ignore
544
- object_=_response.json(),
545
- ),
546
- )
547
- if _response.status_code == 422:
548
- raise UnprocessableEntityError(
549
- typing.cast(
550
- HttpValidationError,
551
- construct_type(
552
- type_=HttpValidationError, # type: ignore
553
- object_=_response.json(),
554
- ),
555
- )
556
- )
557
- _response_json = _response.json()
558
- except JSONDecodeError:
559
- raise ApiError(status_code=_response.status_code, body=_response.text)
560
- raise ApiError(status_code=_response.status_code, body=_response_json)
561
-
562
573
  def upsert_base_tools(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Tool]:
563
574
  """
564
575
  Upsert base tools
@@ -1433,6 +1444,77 @@ class AsyncToolsClient:
1433
1444
  raise ApiError(status_code=_response.status_code, body=_response.text)
1434
1445
  raise ApiError(status_code=_response.status_code, body=_response_json)
1435
1446
 
1447
+ async def count(
1448
+ self,
1449
+ *,
1450
+ include_base_tools: typing.Optional[bool] = None,
1451
+ request_options: typing.Optional[RequestOptions] = None,
1452
+ ) -> int:
1453
+ """
1454
+ Get a count of all tools available to agents belonging to the org of the user.
1455
+
1456
+ Parameters
1457
+ ----------
1458
+ include_base_tools : typing.Optional[bool]
1459
+ Include built-in Letta tools in the count
1460
+
1461
+ request_options : typing.Optional[RequestOptions]
1462
+ Request-specific configuration.
1463
+
1464
+ Returns
1465
+ -------
1466
+ int
1467
+ Successful Response
1468
+
1469
+ Examples
1470
+ --------
1471
+ import asyncio
1472
+
1473
+ from letta_client import AsyncLetta
1474
+
1475
+ client = AsyncLetta(
1476
+ token="YOUR_TOKEN",
1477
+ )
1478
+
1479
+
1480
+ async def main() -> None:
1481
+ await client.tools.count()
1482
+
1483
+
1484
+ asyncio.run(main())
1485
+ """
1486
+ _response = await self._client_wrapper.httpx_client.request(
1487
+ "v1/tools/count",
1488
+ method="GET",
1489
+ params={
1490
+ "include_base_tools": include_base_tools,
1491
+ },
1492
+ request_options=request_options,
1493
+ )
1494
+ try:
1495
+ if 200 <= _response.status_code < 300:
1496
+ return typing.cast(
1497
+ int,
1498
+ construct_type(
1499
+ type_=int, # type: ignore
1500
+ object_=_response.json(),
1501
+ ),
1502
+ )
1503
+ if _response.status_code == 422:
1504
+ raise UnprocessableEntityError(
1505
+ typing.cast(
1506
+ HttpValidationError,
1507
+ construct_type(
1508
+ type_=HttpValidationError, # type: ignore
1509
+ object_=_response.json(),
1510
+ ),
1511
+ )
1512
+ )
1513
+ _response_json = _response.json()
1514
+ except JSONDecodeError:
1515
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1516
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1517
+
1436
1518
  async def list(
1437
1519
  self,
1438
1520
  *,
@@ -1719,66 +1801,6 @@ class AsyncToolsClient:
1719
1801
  raise ApiError(status_code=_response.status_code, body=_response.text)
1720
1802
  raise ApiError(status_code=_response.status_code, body=_response_json)
1721
1803
 
1722
- async def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
1723
- """
1724
- Get a count of all tools available to agents belonging to the org of the user
1725
-
1726
- Parameters
1727
- ----------
1728
- request_options : typing.Optional[RequestOptions]
1729
- Request-specific configuration.
1730
-
1731
- Returns
1732
- -------
1733
- int
1734
- Successful Response
1735
-
1736
- Examples
1737
- --------
1738
- import asyncio
1739
-
1740
- from letta_client import AsyncLetta
1741
-
1742
- client = AsyncLetta(
1743
- token="YOUR_TOKEN",
1744
- )
1745
-
1746
-
1747
- async def main() -> None:
1748
- await client.tools.count()
1749
-
1750
-
1751
- asyncio.run(main())
1752
- """
1753
- _response = await self._client_wrapper.httpx_client.request(
1754
- "v1/tools/count",
1755
- method="GET",
1756
- request_options=request_options,
1757
- )
1758
- try:
1759
- if 200 <= _response.status_code < 300:
1760
- return typing.cast(
1761
- int,
1762
- construct_type(
1763
- type_=int, # type: ignore
1764
- object_=_response.json(),
1765
- ),
1766
- )
1767
- if _response.status_code == 422:
1768
- raise UnprocessableEntityError(
1769
- typing.cast(
1770
- HttpValidationError,
1771
- construct_type(
1772
- type_=HttpValidationError, # type: ignore
1773
- object_=_response.json(),
1774
- ),
1775
- )
1776
- )
1777
- _response_json = _response.json()
1778
- except JSONDecodeError:
1779
- raise ApiError(status_code=_response.status_code, body=_response.text)
1780
- raise ApiError(status_code=_response.status_code, body=_response_json)
1781
-
1782
1804
  async def upsert_base_tools(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Tool]:
1783
1805
  """
1784
1806
  Upsert base tools
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-client
3
- Version: 0.1.127
3
+ Version: 0.1.128
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -61,7 +61,7 @@ letta_client/client_side_access_tokens/types/client_side_access_tokens_create_re
61
61
  letta_client/client_side_access_tokens/types/client_side_access_tokens_create_response_policy_data_item_access_item.py,sha256=R-H25IpNp9feSrW8Yj3h9O3UTMVvFniQJElogKxLuoE,254
62
62
  letta_client/core/__init__.py,sha256=OKbX2aCZXgHCDUsCouqv-OiX32xA6eFFCKIUH9M5Vzk,1591
63
63
  letta_client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
64
- letta_client/core/client_wrapper.py,sha256=M5e7QgBpycY6Cljkh-azqIReqTxjthSkqBHbltTJaQ4,1998
64
+ letta_client/core/client_wrapper.py,sha256=6wsq4X_Mel_R-vaQWqGdJC0vyIfhQG_2OvLGl0xgqJE,1998
65
65
  letta_client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
66
66
  letta_client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
67
67
  letta_client/core/http_client.py,sha256=Z77OIxIbL4OAB2IDqjRq_sYa5yNYAWfmdhdCSSvh6Y4,19552
@@ -119,7 +119,7 @@ letta_client/runs/steps/client.py,sha256=f916x0x6FH7_WzBSl6uw03l-j-QMzr7HzOMNsvC
119
119
  letta_client/runs/usage/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
120
120
  letta_client/runs/usage/client.py,sha256=ea7e0R-Lv3VtbkJ-JC4RgYSr4TI2OjD31XeNLiDmUUg,4666
121
121
  letta_client/sources/__init__.py,sha256=kswgCv4UdkSVk1Y4tsMM1HadOwvhh_Fr96VTSMV4Umc,128
122
- letta_client/sources/client.py,sha256=gr1v_xYz0M9VqqVecy2jJU8SH1Br6hWIADhrxC7ZXYI,32579
122
+ letta_client/sources/client.py,sha256=ozZYAKtO44VZoKIvex26b8nmkMzsvDMD5266Sw_gOyU,32579
123
123
  letta_client/sources/files/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
124
124
  letta_client/sources/files/client.py,sha256=R-9zHK_wWtvW-2K7erQVVh9rR7a5JC4zxmTK3rrWJoU,13289
125
125
  letta_client/sources/passages/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
@@ -138,7 +138,7 @@ letta_client/templates/types/__init__.py,sha256=dAr_dEh0BdwUxAcV1sJ9RM07Z8nCv4dC
138
138
  letta_client/templates/types/templates_list_response.py,sha256=HYloMVzk086c6fFGRYZz-Ozc_Yylozp2aPpweHS5uXI,866
139
139
  letta_client/templates/types/templates_list_response_templates_item.py,sha256=yyJq8wEOb2XIg99uhRMKoy2qD2CbuvI_5FAspwYWnfI,593
140
140
  letta_client/tools/__init__.py,sha256=XsuAkxHDA-Z98gLNNW_fiEwFP3fP4XQipflrK2bHl8k,353
141
- letta_client/tools/client.py,sha256=IH_ZwvhOVYpz1zmjbDUN_k5PBWe8kfwxSONn1lhmX3A,81896
141
+ letta_client/tools/client.py,sha256=hB-Of9ejHugQ1VAVv6bbeH_jSy02TIFeIrXeyQJcsXA,82476
142
142
  letta_client/tools/types/__init__.py,sha256=R11LYBi6lxkud_DRyaHFUHtlnbfnEI93-SEo7FL4tzs,478
143
143
  letta_client/tools/types/add_mcp_server_request.py,sha256=EieZjfOT95sjkpxXdqy7glpxF4J4J3fm6tlaHFnYk84,265
144
144
  letta_client/tools/types/add_mcp_server_response_item.py,sha256=TWdsKqGb1INhYtpGnAckz0Pw4nZShumSp4pfocRfxCA,270
@@ -375,6 +375,6 @@ letta_client/voice/__init__.py,sha256=7hX85553PiRMtIMM12a0DSoFzsglNiUziYR2ekS84Q
375
375
  letta_client/voice/client.py,sha256=STjswa5oOLoP59QwTJvQwi73kgn0UzKOaXc2CsTRI4k,6912
376
376
  letta_client/voice/types/__init__.py,sha256=FRc3iKRTONE4N8Lf1IqvnqWZ2kXdrFFvkL7PxVcR8Ew,212
377
377
  letta_client/voice/types/create_voice_chat_completions_request_body.py,sha256=ZLfKgNK1T6IAwLEvaBVFfy7jEAoPUXP28n-nfmHkklc,391
378
- letta_client-0.1.127.dist-info/METADATA,sha256=ryuq9nPT-sCPi0IhVzMK3t74CuP4-rIDWukUsIchi20,5042
379
- letta_client-0.1.127.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
380
- letta_client-0.1.127.dist-info/RECORD,,
378
+ letta_client-0.1.128.dist-info/METADATA,sha256=gem7WiurovD2HiKMti5yq4PuqOtB253miz9FYdR0tVc,5042
379
+ letta_client-0.1.128.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
380
+ letta_client-0.1.128.dist-info/RECORD,,