letta-client 0.1.126__py3-none-any.whl → 0.1.127__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 +4 -0
- letta_client/agents/client.py +112 -0
- letta_client/core/client_wrapper.py +1 -1
- letta_client/identities/client.py +112 -0
- letta_client/sources/client.py +112 -0
- letta_client/tools/client.py +112 -0
- letta_client/types/__init__.py +4 -0
- letta_client/types/message_create.py +5 -0
- letta_client/types/omitted_reasoning_content.py +1 -5
- letta_client/types/usage_statistics.py +4 -0
- letta_client/types/usage_statistics_completion_token_details.py +19 -0
- letta_client/types/usage_statistics_prompt_token_details.py +19 -0
- {letta_client-0.1.126.dist-info → letta_client-0.1.127.dist-info}/METADATA +1 -1
- {letta_client-0.1.126.dist-info → letta_client-0.1.127.dist-info}/RECORD +15 -13
- {letta_client-0.1.126.dist-info → letta_client-0.1.127.dist-info}/WHEEL +0 -0
letta_client/__init__.py
CHANGED
|
@@ -213,6 +213,8 @@ from .types import (
|
|
|
213
213
|
UpdateUserMessage,
|
|
214
214
|
UpdateUserMessageContent,
|
|
215
215
|
UsageStatistics,
|
|
216
|
+
UsageStatisticsCompletionTokenDetails,
|
|
217
|
+
UsageStatisticsPromptTokenDetails,
|
|
216
218
|
User,
|
|
217
219
|
UserCreate,
|
|
218
220
|
UserMessage,
|
|
@@ -531,6 +533,8 @@ __all__ = [
|
|
|
531
533
|
"UpdateUserMessage",
|
|
532
534
|
"UpdateUserMessageContent",
|
|
533
535
|
"UsageStatistics",
|
|
536
|
+
"UsageStatisticsCompletionTokenDetails",
|
|
537
|
+
"UsageStatisticsPromptTokenDetails",
|
|
534
538
|
"User",
|
|
535
539
|
"UserCreate",
|
|
536
540
|
"UserMessage",
|
letta_client/agents/client.py
CHANGED
|
@@ -457,6 +457,58 @@ class AgentsClient:
|
|
|
457
457
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
458
458
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
459
459
|
|
|
460
|
+
def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
|
|
461
|
+
"""
|
|
462
|
+
Get the count of all agents associated with a given user.
|
|
463
|
+
|
|
464
|
+
Parameters
|
|
465
|
+
----------
|
|
466
|
+
request_options : typing.Optional[RequestOptions]
|
|
467
|
+
Request-specific configuration.
|
|
468
|
+
|
|
469
|
+
Returns
|
|
470
|
+
-------
|
|
471
|
+
int
|
|
472
|
+
Successful Response
|
|
473
|
+
|
|
474
|
+
Examples
|
|
475
|
+
--------
|
|
476
|
+
from letta_client import Letta
|
|
477
|
+
|
|
478
|
+
client = Letta(
|
|
479
|
+
token="YOUR_TOKEN",
|
|
480
|
+
)
|
|
481
|
+
client.agents.count()
|
|
482
|
+
"""
|
|
483
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
484
|
+
"v1/agents/count",
|
|
485
|
+
method="GET",
|
|
486
|
+
request_options=request_options,
|
|
487
|
+
)
|
|
488
|
+
try:
|
|
489
|
+
if 200 <= _response.status_code < 300:
|
|
490
|
+
return typing.cast(
|
|
491
|
+
int,
|
|
492
|
+
construct_type(
|
|
493
|
+
type_=int, # type: ignore
|
|
494
|
+
object_=_response.json(),
|
|
495
|
+
),
|
|
496
|
+
)
|
|
497
|
+
if _response.status_code == 422:
|
|
498
|
+
raise UnprocessableEntityError(
|
|
499
|
+
typing.cast(
|
|
500
|
+
HttpValidationError,
|
|
501
|
+
construct_type(
|
|
502
|
+
type_=HttpValidationError, # type: ignore
|
|
503
|
+
object_=_response.json(),
|
|
504
|
+
),
|
|
505
|
+
)
|
|
506
|
+
)
|
|
507
|
+
_response_json = _response.json()
|
|
508
|
+
except JSONDecodeError:
|
|
509
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
510
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
511
|
+
|
|
460
512
|
def export_file(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> str:
|
|
461
513
|
"""
|
|
462
514
|
Export the serialized JSON representation of an agent, formatted with indentation.
|
|
@@ -1400,6 +1452,66 @@ class AsyncAgentsClient:
|
|
|
1400
1452
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1401
1453
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1402
1454
|
|
|
1455
|
+
async def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
|
|
1456
|
+
"""
|
|
1457
|
+
Get the count of all agents associated with a given user.
|
|
1458
|
+
|
|
1459
|
+
Parameters
|
|
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.agents.count()
|
|
1482
|
+
|
|
1483
|
+
|
|
1484
|
+
asyncio.run(main())
|
|
1485
|
+
"""
|
|
1486
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
1487
|
+
"v1/agents/count",
|
|
1488
|
+
method="GET",
|
|
1489
|
+
request_options=request_options,
|
|
1490
|
+
)
|
|
1491
|
+
try:
|
|
1492
|
+
if 200 <= _response.status_code < 300:
|
|
1493
|
+
return typing.cast(
|
|
1494
|
+
int,
|
|
1495
|
+
construct_type(
|
|
1496
|
+
type_=int, # type: ignore
|
|
1497
|
+
object_=_response.json(),
|
|
1498
|
+
),
|
|
1499
|
+
)
|
|
1500
|
+
if _response.status_code == 422:
|
|
1501
|
+
raise UnprocessableEntityError(
|
|
1502
|
+
typing.cast(
|
|
1503
|
+
HttpValidationError,
|
|
1504
|
+
construct_type(
|
|
1505
|
+
type_=HttpValidationError, # type: ignore
|
|
1506
|
+
object_=_response.json(),
|
|
1507
|
+
),
|
|
1508
|
+
)
|
|
1509
|
+
)
|
|
1510
|
+
_response_json = _response.json()
|
|
1511
|
+
except JSONDecodeError:
|
|
1512
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1513
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1514
|
+
|
|
1403
1515
|
async def export_file(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> str:
|
|
1404
1516
|
"""
|
|
1405
1517
|
Export the serialized JSON representation of an agent, formatted with indentation.
|
|
@@ -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.
|
|
19
|
+
"X-Fern-SDK-Version": "0.1.127",
|
|
20
20
|
}
|
|
21
21
|
if self.token is not None:
|
|
22
22
|
headers["Authorization"] = f"Bearer {self.token}"
|
|
@@ -322,6 +322,58 @@ class IdentitiesClient:
|
|
|
322
322
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
323
323
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
324
324
|
|
|
325
|
+
def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
|
|
326
|
+
"""
|
|
327
|
+
Get count of all identities for a user
|
|
328
|
+
|
|
329
|
+
Parameters
|
|
330
|
+
----------
|
|
331
|
+
request_options : typing.Optional[RequestOptions]
|
|
332
|
+
Request-specific configuration.
|
|
333
|
+
|
|
334
|
+
Returns
|
|
335
|
+
-------
|
|
336
|
+
int
|
|
337
|
+
Successful Response
|
|
338
|
+
|
|
339
|
+
Examples
|
|
340
|
+
--------
|
|
341
|
+
from letta_client import Letta
|
|
342
|
+
|
|
343
|
+
client = Letta(
|
|
344
|
+
token="YOUR_TOKEN",
|
|
345
|
+
)
|
|
346
|
+
client.identities.count()
|
|
347
|
+
"""
|
|
348
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
349
|
+
"v1/identities/count",
|
|
350
|
+
method="GET",
|
|
351
|
+
request_options=request_options,
|
|
352
|
+
)
|
|
353
|
+
try:
|
|
354
|
+
if 200 <= _response.status_code < 300:
|
|
355
|
+
return typing.cast(
|
|
356
|
+
int,
|
|
357
|
+
construct_type(
|
|
358
|
+
type_=int, # type: ignore
|
|
359
|
+
object_=_response.json(),
|
|
360
|
+
),
|
|
361
|
+
)
|
|
362
|
+
if _response.status_code == 422:
|
|
363
|
+
raise UnprocessableEntityError(
|
|
364
|
+
typing.cast(
|
|
365
|
+
HttpValidationError,
|
|
366
|
+
construct_type(
|
|
367
|
+
type_=HttpValidationError, # type: ignore
|
|
368
|
+
object_=_response.json(),
|
|
369
|
+
),
|
|
370
|
+
)
|
|
371
|
+
)
|
|
372
|
+
_response_json = _response.json()
|
|
373
|
+
except JSONDecodeError:
|
|
374
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
375
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
376
|
+
|
|
325
377
|
def retrieve(self, identity_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Identity:
|
|
326
378
|
"""
|
|
327
379
|
Parameters
|
|
@@ -857,6 +909,66 @@ class AsyncIdentitiesClient:
|
|
|
857
909
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
858
910
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
859
911
|
|
|
912
|
+
async def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
|
|
913
|
+
"""
|
|
914
|
+
Get count of all identities for a user
|
|
915
|
+
|
|
916
|
+
Parameters
|
|
917
|
+
----------
|
|
918
|
+
request_options : typing.Optional[RequestOptions]
|
|
919
|
+
Request-specific configuration.
|
|
920
|
+
|
|
921
|
+
Returns
|
|
922
|
+
-------
|
|
923
|
+
int
|
|
924
|
+
Successful Response
|
|
925
|
+
|
|
926
|
+
Examples
|
|
927
|
+
--------
|
|
928
|
+
import asyncio
|
|
929
|
+
|
|
930
|
+
from letta_client import AsyncLetta
|
|
931
|
+
|
|
932
|
+
client = AsyncLetta(
|
|
933
|
+
token="YOUR_TOKEN",
|
|
934
|
+
)
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
async def main() -> None:
|
|
938
|
+
await client.identities.count()
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
asyncio.run(main())
|
|
942
|
+
"""
|
|
943
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
944
|
+
"v1/identities/count",
|
|
945
|
+
method="GET",
|
|
946
|
+
request_options=request_options,
|
|
947
|
+
)
|
|
948
|
+
try:
|
|
949
|
+
if 200 <= _response.status_code < 300:
|
|
950
|
+
return typing.cast(
|
|
951
|
+
int,
|
|
952
|
+
construct_type(
|
|
953
|
+
type_=int, # type: ignore
|
|
954
|
+
object_=_response.json(),
|
|
955
|
+
),
|
|
956
|
+
)
|
|
957
|
+
if _response.status_code == 422:
|
|
958
|
+
raise UnprocessableEntityError(
|
|
959
|
+
typing.cast(
|
|
960
|
+
HttpValidationError,
|
|
961
|
+
construct_type(
|
|
962
|
+
type_=HttpValidationError, # type: ignore
|
|
963
|
+
object_=_response.json(),
|
|
964
|
+
),
|
|
965
|
+
)
|
|
966
|
+
)
|
|
967
|
+
_response_json = _response.json()
|
|
968
|
+
except JSONDecodeError:
|
|
969
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
970
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
971
|
+
|
|
860
972
|
async def retrieve(self, identity_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Identity:
|
|
861
973
|
"""
|
|
862
974
|
Parameters
|
letta_client/sources/client.py
CHANGED
|
@@ -435,6 +435,58 @@ class SourcesClient:
|
|
|
435
435
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
436
436
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
437
437
|
|
|
438
|
+
def count(self, *, request_options: typing.Optional[RequestOptions] = None) -> int:
|
|
439
|
+
"""
|
|
440
|
+
Count all data sources created by a user.
|
|
441
|
+
|
|
442
|
+
Parameters
|
|
443
|
+
----------
|
|
444
|
+
request_options : typing.Optional[RequestOptions]
|
|
445
|
+
Request-specific configuration.
|
|
446
|
+
|
|
447
|
+
Returns
|
|
448
|
+
-------
|
|
449
|
+
int
|
|
450
|
+
Successful Response
|
|
451
|
+
|
|
452
|
+
Examples
|
|
453
|
+
--------
|
|
454
|
+
from letta_client import Letta
|
|
455
|
+
|
|
456
|
+
client = Letta(
|
|
457
|
+
token="YOUR_TOKEN",
|
|
458
|
+
)
|
|
459
|
+
client.sources.count()
|
|
460
|
+
"""
|
|
461
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
462
|
+
"v1/sources/count",
|
|
463
|
+
method="GET",
|
|
464
|
+
request_options=request_options,
|
|
465
|
+
)
|
|
466
|
+
try:
|
|
467
|
+
if 200 <= _response.status_code < 300:
|
|
468
|
+
return typing.cast(
|
|
469
|
+
int,
|
|
470
|
+
construct_type(
|
|
471
|
+
type_=int, # type: ignore
|
|
472
|
+
object_=_response.json(),
|
|
473
|
+
),
|
|
474
|
+
)
|
|
475
|
+
if _response.status_code == 422:
|
|
476
|
+
raise UnprocessableEntityError(
|
|
477
|
+
typing.cast(
|
|
478
|
+
HttpValidationError,
|
|
479
|
+
construct_type(
|
|
480
|
+
type_=HttpValidationError, # type: ignore
|
|
481
|
+
object_=_response.json(),
|
|
482
|
+
),
|
|
483
|
+
)
|
|
484
|
+
)
|
|
485
|
+
_response_json = _response.json()
|
|
486
|
+
except JSONDecodeError:
|
|
487
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
488
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
489
|
+
|
|
438
490
|
|
|
439
491
|
class AsyncSourcesClient:
|
|
440
492
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -898,3 +950,63 @@ class AsyncSourcesClient:
|
|
|
898
950
|
except JSONDecodeError:
|
|
899
951
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
900
952
|
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)
|
letta_client/tools/client.py
CHANGED
|
@@ -507,6 +507,58 @@ class ToolsClient:
|
|
|
507
507
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
508
508
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
509
509
|
|
|
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
|
+
|
|
510
562
|
def upsert_base_tools(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Tool]:
|
|
511
563
|
"""
|
|
512
564
|
Upsert base tools
|
|
@@ -1667,6 +1719,66 @@ class AsyncToolsClient:
|
|
|
1667
1719
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1668
1720
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1669
1721
|
|
|
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
|
+
|
|
1670
1782
|
async def upsert_base_tools(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Tool]:
|
|
1671
1783
|
"""
|
|
1672
1784
|
Upsert base tools
|
letta_client/types/__init__.py
CHANGED
|
@@ -216,6 +216,8 @@ from .update_system_message import UpdateSystemMessage
|
|
|
216
216
|
from .update_user_message import UpdateUserMessage
|
|
217
217
|
from .update_user_message_content import UpdateUserMessageContent
|
|
218
218
|
from .usage_statistics import UsageStatistics
|
|
219
|
+
from .usage_statistics_completion_token_details import UsageStatisticsCompletionTokenDetails
|
|
220
|
+
from .usage_statistics_prompt_token_details import UsageStatisticsPromptTokenDetails
|
|
219
221
|
from .user import User
|
|
220
222
|
from .user_create import UserCreate
|
|
221
223
|
from .user_message import UserMessage
|
|
@@ -441,6 +443,8 @@ __all__ = [
|
|
|
441
443
|
"UpdateUserMessage",
|
|
442
444
|
"UpdateUserMessageContent",
|
|
443
445
|
"UsageStatistics",
|
|
446
|
+
"UsageStatisticsCompletionTokenDetails",
|
|
447
|
+
"UsageStatisticsPromptTokenDetails",
|
|
444
448
|
"User",
|
|
445
449
|
"UserCreate",
|
|
446
450
|
"UserMessage",
|
|
@@ -38,6 +38,11 @@ class MessageCreate(UncheckedBaseModel):
|
|
|
38
38
|
The id of the sender of the message, can be an identity id or agent id
|
|
39
39
|
"""
|
|
40
40
|
|
|
41
|
+
group_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
42
|
+
"""
|
|
43
|
+
The multi-agent group that the message was sent in
|
|
44
|
+
"""
|
|
45
|
+
|
|
41
46
|
if IS_PYDANTIC_V2:
|
|
42
47
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
43
48
|
else:
|
|
@@ -2,16 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
|
-
import pydantic
|
|
6
5
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
+
import pydantic
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class OmittedReasoningContent(UncheckedBaseModel):
|
|
10
10
|
type: typing.Literal["omitted_reasoning"] = "omitted_reasoning"
|
|
11
|
-
tokens: int = pydantic.Field()
|
|
12
|
-
"""
|
|
13
|
-
The reasoning token count for intermediate reasoning content.
|
|
14
|
-
"""
|
|
15
11
|
|
|
16
12
|
if IS_PYDANTIC_V2:
|
|
17
13
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
|
+
from .usage_statistics_prompt_token_details import UsageStatisticsPromptTokenDetails
|
|
6
|
+
from .usage_statistics_completion_token_details import UsageStatisticsCompletionTokenDetails
|
|
5
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
8
|
import pydantic
|
|
7
9
|
|
|
@@ -10,6 +12,8 @@ class UsageStatistics(UncheckedBaseModel):
|
|
|
10
12
|
completion_tokens: typing.Optional[int] = None
|
|
11
13
|
prompt_tokens: typing.Optional[int] = None
|
|
12
14
|
total_tokens: typing.Optional[int] = None
|
|
15
|
+
prompt_tokens_details: typing.Optional[UsageStatisticsPromptTokenDetails] = None
|
|
16
|
+
completion_tokens_details: typing.Optional[UsageStatisticsCompletionTokenDetails] = None
|
|
13
17
|
|
|
14
18
|
if IS_PYDANTIC_V2:
|
|
15
19
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UsageStatisticsCompletionTokenDetails(UncheckedBaseModel):
|
|
10
|
+
reasoning_tokens: typing.Optional[int] = None
|
|
11
|
+
|
|
12
|
+
if IS_PYDANTIC_V2:
|
|
13
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
14
|
+
else:
|
|
15
|
+
|
|
16
|
+
class Config:
|
|
17
|
+
frozen = True
|
|
18
|
+
smart_union = True
|
|
19
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UsageStatisticsPromptTokenDetails(UncheckedBaseModel):
|
|
10
|
+
cached_tokens: typing.Optional[int] = None
|
|
11
|
+
|
|
12
|
+
if IS_PYDANTIC_V2:
|
|
13
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
14
|
+
else:
|
|
15
|
+
|
|
16
|
+
class Config:
|
|
17
|
+
frozen = True
|
|
18
|
+
smart_union = True
|
|
19
|
+
extra = pydantic.Extra.allow
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
letta_client/__init__.py,sha256=
|
|
1
|
+
letta_client/__init__.py,sha256=f_0v4oYXbsq-6Y56HWxtvUlCjeKPm5jeS_2TjyONXwI,16349
|
|
2
2
|
letta_client/agents/__init__.py,sha256=C46uidjw-_nowv5mqI7lsXUKvoW49utJHL_k-F7HIyY,1616
|
|
3
3
|
letta_client/agents/blocks/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
4
4
|
letta_client/agents/blocks/client.py,sha256=u5zvutxoH_DqfSLWhRtNSRBC9_ezQDx682cxkxDz3JA,23822
|
|
5
|
-
letta_client/agents/client.py,sha256=
|
|
5
|
+
letta_client/agents/client.py,sha256=P-uXumCID_I0VVA9ydc_cI5-V2xDkgXe7AhxplgewuI,79926
|
|
6
6
|
letta_client/agents/context/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
7
7
|
letta_client/agents/context/client.py,sha256=GKKvoG4N_K8Biz9yDjeIHpFG0C8Cwc7tHmEX3pTL_9U,4815
|
|
8
8
|
letta_client/agents/core_memory/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
@@ -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=
|
|
64
|
+
letta_client/core/client_wrapper.py,sha256=M5e7QgBpycY6Cljkh-azqIReqTxjthSkqBHbltTJaQ4,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
|
|
@@ -95,7 +95,7 @@ letta_client/groups/types/group_update_manager_config.py,sha256=ZmSsb5UMolq-py0N
|
|
|
95
95
|
letta_client/health/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
96
96
|
letta_client/health/client.py,sha256=6BjXH83ZhsLt_MD4QA2hiTsvgfeIgxMT1KSN0Oj6e1I,3242
|
|
97
97
|
letta_client/identities/__init__.py,sha256=bnFuyXLGO2qat5VgmZkdN7FVl74I_G7bPYDdKjyMM-Y,116
|
|
98
|
-
letta_client/identities/client.py,sha256=
|
|
98
|
+
letta_client/identities/client.py,sha256=vhmsa-ZKt0wKY9_1nfu_ORjXjJkVdSA24Ux-QKwGOGI,39684
|
|
99
99
|
letta_client/identities/properties/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
100
100
|
letta_client/identities/properties/client.py,sha256=Nv7jOi5O8TmeZ1g0-TqnqiJ0hLcHMe2ZIfqAkEDB2Bk,6053
|
|
101
101
|
letta_client/jobs/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
@@ -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=
|
|
122
|
+
letta_client/sources/client.py,sha256=gr1v_xYz0M9VqqVecy2jJU8SH1Br6hWIADhrxC7ZXYI,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,13 +138,13 @@ 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=
|
|
141
|
+
letta_client/tools/client.py,sha256=IH_ZwvhOVYpz1zmjbDUN_k5PBWe8kfwxSONn1lhmX3A,81896
|
|
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
|
|
145
145
|
letta_client/tools/types/delete_mcp_server_response_item.py,sha256=MeZObU-7tMSCd-S5yuUjNDse6A1hUz1LLjbko0pXaro,273
|
|
146
146
|
letta_client/tools/types/list_mcp_servers_response_value.py,sha256=AIoXu4bO8QNSU7zjL1jj0Rg4313wVtPaTt13W0aevLQ,273
|
|
147
|
-
letta_client/types/__init__.py,sha256=
|
|
147
|
+
letta_client/types/__init__.py,sha256=vYAcLWMP_PDOojlIEUvXodGYiopLIdUGtBBNbNV3n14,20464
|
|
148
148
|
letta_client/types/action_model.py,sha256=y1e2XMv3skFaNJIBdYoBKgiORzGh05aOVvu-qVR9uHg,1240
|
|
149
149
|
letta_client/types/action_parameters_model.py,sha256=LgKf5aPZG3-OHGxFdXiSokIDgce8c02xPYIAY05VgW8,828
|
|
150
150
|
letta_client/types/action_response_model.py,sha256=yq2Fd9UU8j7vvtE3VqXUoRRvDzWcfJPj_95ynGdeHCs,824
|
|
@@ -282,14 +282,14 @@ letta_client/types/mcp_tool.py,sha256=_GSTb0k8l-IUEflRkQ6-v45UnbTcA4Nv1N8sgmExJQ
|
|
|
282
282
|
letta_client/types/memory.py,sha256=KD5MkDQB-vbRPT9f_-yFBWY1WUW_NWxYEI0IiflG6P8,1035
|
|
283
283
|
letta_client/types/message.py,sha256=npZKMX6fryL2F1ODDoWT3XWeh-pHeEJ1IIgbnSzgGcQ,3936
|
|
284
284
|
letta_client/types/message_content_item.py,sha256=mg2npSBRXsH7-fAwhx9YhkVbeCF3cM8pE6fPYtUDIyc,550
|
|
285
|
-
letta_client/types/message_create.py,sha256=
|
|
285
|
+
letta_client/types/message_create.py,sha256=FkABWA09E1Ra47o0g53zf7b6DqgMfT_9XXQUv30tCdw,1445
|
|
286
286
|
letta_client/types/message_create_content.py,sha256=KL3XAVKVrdsh4DZwdxKofUyehS-vnOT_VJNVzZDpE20,226
|
|
287
287
|
letta_client/types/message_create_role.py,sha256=atjQEZ8iT4gTAmrFTFnRaM66f0MGsgfGq6hpx1Q-i44,159
|
|
288
288
|
letta_client/types/message_role.py,sha256=HKatrA1jt02oTObExloTY3rW8Urzn37kBTg0Z6MbwkQ,186
|
|
289
289
|
letta_client/types/message_schema.py,sha256=i7PLWd92bEltq3bSJam3c74p5zw-WdcoUqazLNmNYAw,955
|
|
290
290
|
letta_client/types/not_found_error_body.py,sha256=_1esSlUdkBx6CRs6aAIJrxzh3VZKEG0xzeLbxebBuy0,615
|
|
291
291
|
letta_client/types/not_found_error_body_message.py,sha256=Kc9xrVghgDATdPAGpTPnzyKe6ds5q8Vr6zcBU5lLcH4,309
|
|
292
|
-
letta_client/types/omitted_reasoning_content.py,sha256=
|
|
292
|
+
letta_client/types/omitted_reasoning_content.py,sha256=gIhWRyVtfB-Jo0Ua3QpyJNag2m_yRpusoPTcZZxjKh0,622
|
|
293
293
|
letta_client/types/openai_types_chat_chat_completion_message_tool_call_param_function.py,sha256=glG5tG6g2uxP4R5jwsChkf3F0sb208uEbR-25dnrTiM,621
|
|
294
294
|
letta_client/types/openai_types_chat_chat_completion_named_tool_choice_param_function.py,sha256=20aPdyj3_-cD_p33yZ0ca3IbU9Apq1UrnxCSaU6OgYg,602
|
|
295
295
|
letta_client/types/openai_types_chat_completion_create_params_function.py,sha256=oTjYqRv8z6SMSdFgTl4W9oI-QUQxz8Unf4yn90sByss,721
|
|
@@ -356,7 +356,9 @@ letta_client/types/update_reasoning_message.py,sha256=2ejxLRNfVDWBfGQG2-A1JNq-Du
|
|
|
356
356
|
letta_client/types/update_system_message.py,sha256=wm2yZUdhRQD5sQhqPiedWZAPECwYvWOvRy1lbALTfCI,779
|
|
357
357
|
letta_client/types/update_user_message.py,sha256=7K0eNqN-ab2v3rR1FW3LLq7IHk6_0C0lv3zhTtthzzs,860
|
|
358
358
|
letta_client/types/update_user_message_content.py,sha256=dtDUkSRbdYlLBkwU-vqx_pqZHXZ4v5zIDsQupg7jkQk,242
|
|
359
|
-
letta_client/types/usage_statistics.py,sha256=
|
|
359
|
+
letta_client/types/usage_statistics.py,sha256=pks9_EidwQD9gD_bIVxN9JedAbzNCCO6atW7FuvnYsU,1046
|
|
360
|
+
letta_client/types/usage_statistics_completion_token_details.py,sha256=2PypCq-UkJqc3wPVNdenWEBFjD_r5_GbcGxnLH774L4,618
|
|
361
|
+
letta_client/types/usage_statistics_prompt_token_details.py,sha256=c4r4UUIbDI-UO3coX141C9_qCw698E18Zh3emVV3sUA,611
|
|
360
362
|
letta_client/types/user.py,sha256=z_v1uqQ6HYwV_Pp7wDDqS6QWhslHgdUH-AldV-jnmKQ,1349
|
|
361
363
|
letta_client/types/user_create.py,sha256=prQea3xb2-Cm64wv6Y84OfhWNWrA2P8SH5yhUxejzOI,616
|
|
362
364
|
letta_client/types/user_message.py,sha256=vCZK21KYwzpb3QAlN--ViKirmQ5AO5VqSk_FUYmcaX4,1473
|
|
@@ -373,6 +375,6 @@ letta_client/voice/__init__.py,sha256=7hX85553PiRMtIMM12a0DSoFzsglNiUziYR2ekS84Q
|
|
|
373
375
|
letta_client/voice/client.py,sha256=STjswa5oOLoP59QwTJvQwi73kgn0UzKOaXc2CsTRI4k,6912
|
|
374
376
|
letta_client/voice/types/__init__.py,sha256=FRc3iKRTONE4N8Lf1IqvnqWZ2kXdrFFvkL7PxVcR8Ew,212
|
|
375
377
|
letta_client/voice/types/create_voice_chat_completions_request_body.py,sha256=ZLfKgNK1T6IAwLEvaBVFfy7jEAoPUXP28n-nfmHkklc,391
|
|
376
|
-
letta_client-0.1.
|
|
377
|
-
letta_client-0.1.
|
|
378
|
-
letta_client-0.1.
|
|
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,,
|
|
File without changes
|