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

@@ -24,7 +24,7 @@ class BaseClientWrapper:
24
24
  headers: typing.Dict[str, str] = {
25
25
  "X-Fern-Language": "Python",
26
26
  "X-Fern-SDK-Name": "letta-client",
27
- "X-Fern-SDK-Version": "0.1.203",
27
+ "X-Fern-SDK-Version": "0.1.204",
28
28
  }
29
29
  if self._project is not None:
30
30
  headers["X-Project"] = self._project
@@ -575,6 +575,65 @@ class SourcesClient:
575
575
  raise ApiError(status_code=_response.status_code, body=_response.text)
576
576
  raise ApiError(status_code=_response.status_code, body=_response_json)
577
577
 
578
+ def get_agents_for_source(
579
+ self, source_id: str, *, request_options: typing.Optional[RequestOptions] = None
580
+ ) -> typing.List[str]:
581
+ """
582
+ Get all agent IDs that have the specified source attached.
583
+
584
+ Parameters
585
+ ----------
586
+ source_id : str
587
+
588
+ request_options : typing.Optional[RequestOptions]
589
+ Request-specific configuration.
590
+
591
+ Returns
592
+ -------
593
+ typing.List[str]
594
+ Successful Response
595
+
596
+ Examples
597
+ --------
598
+ from letta_client import Letta
599
+
600
+ client = Letta(
601
+ project="YOUR_PROJECT",
602
+ token="YOUR_TOKEN",
603
+ )
604
+ client.sources.get_agents_for_source(
605
+ source_id="source_id",
606
+ )
607
+ """
608
+ _response = self._client_wrapper.httpx_client.request(
609
+ f"v1/sources/{jsonable_encoder(source_id)}/agents",
610
+ method="GET",
611
+ request_options=request_options,
612
+ )
613
+ try:
614
+ if 200 <= _response.status_code < 300:
615
+ return typing.cast(
616
+ typing.List[str],
617
+ construct_type(
618
+ type_=typing.List[str], # type: ignore
619
+ object_=_response.json(),
620
+ ),
621
+ )
622
+ if _response.status_code == 422:
623
+ raise UnprocessableEntityError(
624
+ typing.cast(
625
+ HttpValidationError,
626
+ construct_type(
627
+ type_=HttpValidationError, # type: ignore
628
+ object_=_response.json(),
629
+ ),
630
+ )
631
+ )
632
+ _response_json = _response.json()
633
+ except JSONDecodeError:
634
+ raise ApiError(status_code=_response.status_code, body=_response.text)
635
+ raise ApiError(status_code=_response.status_code, body=_response_json)
636
+
578
637
  def get_file_metadata(
579
638
  self,
580
639
  source_id: str,
@@ -1266,6 +1325,73 @@ class AsyncSourcesClient:
1266
1325
  raise ApiError(status_code=_response.status_code, body=_response.text)
1267
1326
  raise ApiError(status_code=_response.status_code, body=_response_json)
1268
1327
 
1328
+ async def get_agents_for_source(
1329
+ self, source_id: str, *, request_options: typing.Optional[RequestOptions] = None
1330
+ ) -> typing.List[str]:
1331
+ """
1332
+ Get all agent IDs that have the specified source attached.
1333
+
1334
+ Parameters
1335
+ ----------
1336
+ source_id : str
1337
+
1338
+ request_options : typing.Optional[RequestOptions]
1339
+ Request-specific configuration.
1340
+
1341
+ Returns
1342
+ -------
1343
+ typing.List[str]
1344
+ Successful Response
1345
+
1346
+ Examples
1347
+ --------
1348
+ import asyncio
1349
+
1350
+ from letta_client import AsyncLetta
1351
+
1352
+ client = AsyncLetta(
1353
+ project="YOUR_PROJECT",
1354
+ token="YOUR_TOKEN",
1355
+ )
1356
+
1357
+
1358
+ async def main() -> None:
1359
+ await client.sources.get_agents_for_source(
1360
+ source_id="source_id",
1361
+ )
1362
+
1363
+
1364
+ asyncio.run(main())
1365
+ """
1366
+ _response = await self._client_wrapper.httpx_client.request(
1367
+ f"v1/sources/{jsonable_encoder(source_id)}/agents",
1368
+ method="GET",
1369
+ request_options=request_options,
1370
+ )
1371
+ try:
1372
+ if 200 <= _response.status_code < 300:
1373
+ return typing.cast(
1374
+ typing.List[str],
1375
+ construct_type(
1376
+ type_=typing.List[str], # type: ignore
1377
+ object_=_response.json(),
1378
+ ),
1379
+ )
1380
+ if _response.status_code == 422:
1381
+ raise UnprocessableEntityError(
1382
+ typing.cast(
1383
+ HttpValidationError,
1384
+ construct_type(
1385
+ type_=HttpValidationError, # type: ignore
1386
+ object_=_response.json(),
1387
+ ),
1388
+ )
1389
+ )
1390
+ _response_json = _response.json()
1391
+ except JSONDecodeError:
1392
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1393
+ raise ApiError(status_code=_response.status_code, body=_response_json)
1394
+
1269
1395
  async def get_file_metadata(
1270
1396
  self,
1271
1397
  source_id: str,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-client
3
- Version: 0.1.203
3
+ Version: 0.1.204
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -71,7 +71,7 @@ letta_client/client_side_access_tokens/types/client_side_access_tokens_list_clie
71
71
  letta_client/client_side_access_tokens/types/client_side_access_tokens_list_client_side_access_tokens_response_tokens_item_policy_data_item_access_item.py,sha256=kNHfEWFl7u71Pu8NPqutod0a2NXfvq8il05Hqm0iBB4,284
72
72
  letta_client/core/__init__.py,sha256=OKbX2aCZXgHCDUsCouqv-OiX32xA6eFFCKIUH9M5Vzk,1591
73
73
  letta_client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
74
- letta_client/core/client_wrapper.py,sha256=dZfgTqB2h8-vZllsMt2DE1BQ6Jz0Cvewhiz3ALIXveQ,2336
74
+ letta_client/core/client_wrapper.py,sha256=rXRB6xkX4_Tn_LtzxXIumVsopIheROCNvkNJ42yY1qE,2336
75
75
  letta_client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
76
76
  letta_client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
77
77
  letta_client/core/http_client.py,sha256=Z77OIxIbL4OAB2IDqjRq_sYa5yNYAWfmdhdCSSvh6Y4,19552
@@ -132,7 +132,7 @@ letta_client/runs/steps/client.py,sha256=KgpKM6tLn7CgnkUlUihLvxucw4PW4bb_8XPVaEb
132
132
  letta_client/runs/usage/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
133
133
  letta_client/runs/usage/client.py,sha256=LGJL8cPGaVfTG5OBi85KRbwvv3P_jQNehFq2Kg0xrC4,4738
134
134
  letta_client/sources/__init__.py,sha256=kswgCv4UdkSVk1Y4tsMM1HadOwvhh_Fr96VTSMV4Umc,128
135
- letta_client/sources/client.py,sha256=Y2QaeTMQu8K3wVDBq__3xx9IxIrJ5WIwCVILobpTSck,43690
135
+ letta_client/sources/client.py,sha256=Wzpoo1VfRGTygnnTVlT_9LPod5iU-BtX57hVggjZRdo,47706
136
136
  letta_client/sources/files/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
137
137
  letta_client/sources/files/client.py,sha256=6RgAo1778b1o_BLUZKDbdrSvhsLCvK_TnwFXBEUISpM,14659
138
138
  letta_client/sources/passages/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
@@ -428,6 +428,6 @@ letta_client/types/web_search_options_user_location_approximate.py,sha256=Ywk01J
428
428
  letta_client/version.py,sha256=bttKLbIhO3UonCYQlqs600zzbQgfhCCMjeXR9WRzid4,79
429
429
  letta_client/voice/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
430
430
  letta_client/voice/client.py,sha256=47iQYCuW_qpKI4hM3pYVxn3hw7kgQj3emU1_oRpkRMA,5811
431
- letta_client-0.1.203.dist-info/METADATA,sha256=ncTMzSU7Bdlk8yVJPe5kOoNIR0MYMVrlu2BjS1GzWTQ,5177
432
- letta_client-0.1.203.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
433
- letta_client-0.1.203.dist-info/RECORD,,
431
+ letta_client-0.1.204.dist-info/METADATA,sha256=Vr49Ut2kVW4bHQwpPxkNe8Atk28LeXsqoUFgVxjtzL0,5177
432
+ letta_client-0.1.204.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
433
+ letta_client-0.1.204.dist-info/RECORD,,