letta-client 0.1.225__py3-none-any.whl → 0.1.227__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/core/client_wrapper.py +1 -1
- letta_client/tools/__init__.py +4 -0
- letta_client/tools/client.py +81 -222
- letta_client/tools/types/__init__.py +4 -0
- letta_client/tools/types/connect_mcp_server_response_event.py +8 -0
- letta_client/tools/types/streaming_response.py +23 -0
- letta_client/types/file_metadata.py +0 -5
- {letta_client-0.1.225.dist-info → letta_client-0.1.227.dist-info}/METADATA +8 -14
- {letta_client-0.1.225.dist-info → letta_client-0.1.227.dist-info}/RECORD +11 -9
- {letta_client-0.1.225.dist-info → letta_client-0.1.227.dist-info}/WHEEL +0 -0
letta_client/__init__.py
CHANGED
|
@@ -335,8 +335,10 @@ from .tools import (
|
|
|
335
335
|
AddMcpServerRequest,
|
|
336
336
|
AddMcpServerResponseItem,
|
|
337
337
|
ConnectMcpServerRequest,
|
|
338
|
+
ConnectMcpServerResponseEvent,
|
|
338
339
|
DeleteMcpServerResponseItem,
|
|
339
340
|
ListMcpServersResponseValue,
|
|
341
|
+
StreamingResponse,
|
|
340
342
|
TestMcpServerRequest,
|
|
341
343
|
UpdateMcpServerRequest,
|
|
342
344
|
UpdateMcpServerResponse,
|
|
@@ -451,6 +453,7 @@ __all__ = [
|
|
|
451
453
|
"ConflictError",
|
|
452
454
|
"ConflictErrorBody",
|
|
453
455
|
"ConnectMcpServerRequest",
|
|
456
|
+
"ConnectMcpServerResponseEvent",
|
|
454
457
|
"ContextWindowOverview",
|
|
455
458
|
"ContinueToolRule",
|
|
456
459
|
"CoreMemoryBlockSchema",
|
|
@@ -597,6 +600,7 @@ __all__ = [
|
|
|
597
600
|
"StepsListRequestFeedback",
|
|
598
601
|
"StopReasonType",
|
|
599
602
|
"StreamableHttpServerConfig",
|
|
603
|
+
"StreamingResponse",
|
|
600
604
|
"SupervisorManager",
|
|
601
605
|
"SupervisorManagerUpdate",
|
|
602
606
|
"SystemMessage",
|
|
@@ -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.
|
|
27
|
+
"X-Fern-SDK-Version": "0.1.227",
|
|
28
28
|
}
|
|
29
29
|
if self._project is not None:
|
|
30
30
|
headers["X-Project"] = self._project
|
letta_client/tools/__init__.py
CHANGED
|
@@ -4,8 +4,10 @@ from .types import (
|
|
|
4
4
|
AddMcpServerRequest,
|
|
5
5
|
AddMcpServerResponseItem,
|
|
6
6
|
ConnectMcpServerRequest,
|
|
7
|
+
ConnectMcpServerResponseEvent,
|
|
7
8
|
DeleteMcpServerResponseItem,
|
|
8
9
|
ListMcpServersResponseValue,
|
|
10
|
+
StreamingResponse,
|
|
9
11
|
TestMcpServerRequest,
|
|
10
12
|
UpdateMcpServerRequest,
|
|
11
13
|
UpdateMcpServerResponse,
|
|
@@ -15,8 +17,10 @@ __all__ = [
|
|
|
15
17
|
"AddMcpServerRequest",
|
|
16
18
|
"AddMcpServerResponseItem",
|
|
17
19
|
"ConnectMcpServerRequest",
|
|
20
|
+
"ConnectMcpServerResponseEvent",
|
|
18
21
|
"DeleteMcpServerResponseItem",
|
|
19
22
|
"ListMcpServersResponseValue",
|
|
23
|
+
"StreamingResponse",
|
|
20
24
|
"TestMcpServerRequest",
|
|
21
25
|
"UpdateMcpServerRequest",
|
|
22
26
|
"UpdateMcpServerResponse",
|
letta_client/tools/client.py
CHANGED
|
@@ -24,6 +24,9 @@ from .types.update_mcp_server_request import UpdateMcpServerRequest
|
|
|
24
24
|
from .types.update_mcp_server_response import UpdateMcpServerResponse
|
|
25
25
|
from .types.test_mcp_server_request import TestMcpServerRequest
|
|
26
26
|
from .types.connect_mcp_server_request import ConnectMcpServerRequest
|
|
27
|
+
from .types.streaming_response import StreamingResponse
|
|
28
|
+
import httpx_sse
|
|
29
|
+
import json
|
|
27
30
|
from ..core.client_wrapper import AsyncClientWrapper
|
|
28
31
|
|
|
29
32
|
# this is used as the default value for optional parameters
|
|
@@ -1324,7 +1327,7 @@ class ToolsClient:
|
|
|
1324
1327
|
) -> typing.Optional[typing.Any]:
|
|
1325
1328
|
"""
|
|
1326
1329
|
Test connection to an MCP server without adding it.
|
|
1327
|
-
Returns the list of available tools if successful
|
|
1330
|
+
Returns the list of available tools if successful.
|
|
1328
1331
|
|
|
1329
1332
|
Parameters
|
|
1330
1333
|
----------
|
|
@@ -1389,7 +1392,7 @@ class ToolsClient:
|
|
|
1389
1392
|
|
|
1390
1393
|
def connect_mcp_server(
|
|
1391
1394
|
self, *, request: ConnectMcpServerRequest, request_options: typing.Optional[RequestOptions] = None
|
|
1392
|
-
) -> typing.
|
|
1395
|
+
) -> typing.Iterator[StreamingResponse]:
|
|
1393
1396
|
"""
|
|
1394
1397
|
Connect to an MCP server with support for OAuth via SSE.
|
|
1395
1398
|
Returns a stream of events handling authorization state and exchange if OAuth is required.
|
|
@@ -1401,9 +1404,9 @@ class ToolsClient:
|
|
|
1401
1404
|
request_options : typing.Optional[RequestOptions]
|
|
1402
1405
|
Request-specific configuration.
|
|
1403
1406
|
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
typing.
|
|
1407
|
+
Yields
|
|
1408
|
+
------
|
|
1409
|
+
typing.Iterator[StreamingResponse]
|
|
1407
1410
|
Successful response
|
|
1408
1411
|
|
|
1409
1412
|
Examples
|
|
@@ -1414,15 +1417,17 @@ class ToolsClient:
|
|
|
1414
1417
|
project="YOUR_PROJECT",
|
|
1415
1418
|
token="YOUR_TOKEN",
|
|
1416
1419
|
)
|
|
1417
|
-
client.tools.connect_mcp_server(
|
|
1420
|
+
response = client.tools.connect_mcp_server(
|
|
1418
1421
|
request=StdioServerConfig(
|
|
1419
1422
|
server_name="server_name",
|
|
1420
1423
|
command="command",
|
|
1421
1424
|
args=["args"],
|
|
1422
1425
|
),
|
|
1423
1426
|
)
|
|
1427
|
+
for chunk in response:
|
|
1428
|
+
yield chunk
|
|
1424
1429
|
"""
|
|
1425
|
-
|
|
1430
|
+
with self._client_wrapper.httpx_client.stream(
|
|
1426
1431
|
"v1/tools/mcp/servers/connect",
|
|
1427
1432
|
method="POST",
|
|
1428
1433
|
json=convert_and_respect_annotation_metadata(
|
|
@@ -1430,107 +1435,37 @@ class ToolsClient:
|
|
|
1430
1435
|
),
|
|
1431
1436
|
request_options=request_options,
|
|
1432
1437
|
omit=OMIT,
|
|
1433
|
-
)
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1438
|
+
) as _response:
|
|
1439
|
+
try:
|
|
1440
|
+
if 200 <= _response.status_code < 300:
|
|
1441
|
+
_event_source = httpx_sse.EventSource(_response)
|
|
1442
|
+
for _sse in _event_source.iter_sse():
|
|
1443
|
+
try:
|
|
1444
|
+
yield typing.cast(
|
|
1445
|
+
StreamingResponse,
|
|
1446
|
+
construct_type(
|
|
1447
|
+
type_=StreamingResponse, # type: ignore
|
|
1448
|
+
object_=json.loads(_sse.data),
|
|
1449
|
+
),
|
|
1450
|
+
)
|
|
1451
|
+
except:
|
|
1452
|
+
pass
|
|
1453
|
+
return
|
|
1454
|
+
_response.read()
|
|
1455
|
+
if _response.status_code == 422:
|
|
1456
|
+
raise UnprocessableEntityError(
|
|
1457
|
+
typing.cast(
|
|
1458
|
+
HttpValidationError,
|
|
1459
|
+
construct_type(
|
|
1460
|
+
type_=HttpValidationError, # type: ignore
|
|
1461
|
+
object_=_response.json(),
|
|
1462
|
+
),
|
|
1463
|
+
)
|
|
1451
1464
|
)
|
|
1452
|
-
)
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
raise ApiError(status_code=_response.status_code, body=
|
|
1456
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1457
|
-
|
|
1458
|
-
def mcp_oauth_callback(
|
|
1459
|
-
self,
|
|
1460
|
-
session_id: str,
|
|
1461
|
-
*,
|
|
1462
|
-
code: typing.Optional[str] = None,
|
|
1463
|
-
state: typing.Optional[str] = None,
|
|
1464
|
-
error: typing.Optional[str] = None,
|
|
1465
|
-
error_description: typing.Optional[str] = None,
|
|
1466
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
1467
|
-
) -> None:
|
|
1468
|
-
"""
|
|
1469
|
-
Handle OAuth callback for MCP server authentication.
|
|
1470
|
-
|
|
1471
|
-
Parameters
|
|
1472
|
-
----------
|
|
1473
|
-
session_id : str
|
|
1474
|
-
|
|
1475
|
-
code : typing.Optional[str]
|
|
1476
|
-
OAuth authorization code
|
|
1477
|
-
|
|
1478
|
-
state : typing.Optional[str]
|
|
1479
|
-
OAuth state parameter
|
|
1480
|
-
|
|
1481
|
-
error : typing.Optional[str]
|
|
1482
|
-
OAuth error
|
|
1483
|
-
|
|
1484
|
-
error_description : typing.Optional[str]
|
|
1485
|
-
OAuth error description
|
|
1486
|
-
|
|
1487
|
-
request_options : typing.Optional[RequestOptions]
|
|
1488
|
-
Request-specific configuration.
|
|
1489
|
-
|
|
1490
|
-
Returns
|
|
1491
|
-
-------
|
|
1492
|
-
None
|
|
1493
|
-
|
|
1494
|
-
Examples
|
|
1495
|
-
--------
|
|
1496
|
-
from letta_client import Letta
|
|
1497
|
-
|
|
1498
|
-
client = Letta(
|
|
1499
|
-
project="YOUR_PROJECT",
|
|
1500
|
-
token="YOUR_TOKEN",
|
|
1501
|
-
)
|
|
1502
|
-
client.tools.mcp_oauth_callback(
|
|
1503
|
-
session_id="session_id",
|
|
1504
|
-
)
|
|
1505
|
-
"""
|
|
1506
|
-
_response = self._client_wrapper.httpx_client.request(
|
|
1507
|
-
f"v1/tools/mcp/oauth/callback/{jsonable_encoder(session_id)}",
|
|
1508
|
-
method="GET",
|
|
1509
|
-
params={
|
|
1510
|
-
"code": code,
|
|
1511
|
-
"state": state,
|
|
1512
|
-
"error": error,
|
|
1513
|
-
"error_description": error_description,
|
|
1514
|
-
},
|
|
1515
|
-
request_options=request_options,
|
|
1516
|
-
)
|
|
1517
|
-
try:
|
|
1518
|
-
if 200 <= _response.status_code < 300:
|
|
1519
|
-
return
|
|
1520
|
-
if _response.status_code == 422:
|
|
1521
|
-
raise UnprocessableEntityError(
|
|
1522
|
-
typing.cast(
|
|
1523
|
-
HttpValidationError,
|
|
1524
|
-
construct_type(
|
|
1525
|
-
type_=HttpValidationError, # type: ignore
|
|
1526
|
-
object_=_response.json(),
|
|
1527
|
-
),
|
|
1528
|
-
)
|
|
1529
|
-
)
|
|
1530
|
-
_response_json = _response.json()
|
|
1531
|
-
except JSONDecodeError:
|
|
1532
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1533
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1465
|
+
_response_json = _response.json()
|
|
1466
|
+
except JSONDecodeError:
|
|
1467
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
1468
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
1534
1469
|
|
|
1535
1470
|
|
|
1536
1471
|
class AsyncToolsClient:
|
|
@@ -2971,7 +2906,7 @@ class AsyncToolsClient:
|
|
|
2971
2906
|
) -> typing.Optional[typing.Any]:
|
|
2972
2907
|
"""
|
|
2973
2908
|
Test connection to an MCP server without adding it.
|
|
2974
|
-
Returns the list of available tools if successful
|
|
2909
|
+
Returns the list of available tools if successful.
|
|
2975
2910
|
|
|
2976
2911
|
Parameters
|
|
2977
2912
|
----------
|
|
@@ -3044,7 +2979,7 @@ class AsyncToolsClient:
|
|
|
3044
2979
|
|
|
3045
2980
|
async def connect_mcp_server(
|
|
3046
2981
|
self, *, request: ConnectMcpServerRequest, request_options: typing.Optional[RequestOptions] = None
|
|
3047
|
-
) -> typing.
|
|
2982
|
+
) -> typing.AsyncIterator[StreamingResponse]:
|
|
3048
2983
|
"""
|
|
3049
2984
|
Connect to an MCP server with support for OAuth via SSE.
|
|
3050
2985
|
Returns a stream of events handling authorization state and exchange if OAuth is required.
|
|
@@ -3056,9 +2991,9 @@ class AsyncToolsClient:
|
|
|
3056
2991
|
request_options : typing.Optional[RequestOptions]
|
|
3057
2992
|
Request-specific configuration.
|
|
3058
2993
|
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
typing.
|
|
2994
|
+
Yields
|
|
2995
|
+
------
|
|
2996
|
+
typing.AsyncIterator[StreamingResponse]
|
|
3062
2997
|
Successful response
|
|
3063
2998
|
|
|
3064
2999
|
Examples
|
|
@@ -3074,18 +3009,20 @@ class AsyncToolsClient:
|
|
|
3074
3009
|
|
|
3075
3010
|
|
|
3076
3011
|
async def main() -> None:
|
|
3077
|
-
await client.tools.connect_mcp_server(
|
|
3012
|
+
response = await client.tools.connect_mcp_server(
|
|
3078
3013
|
request=StdioServerConfig(
|
|
3079
3014
|
server_name="server_name",
|
|
3080
3015
|
command="command",
|
|
3081
3016
|
args=["args"],
|
|
3082
3017
|
),
|
|
3083
3018
|
)
|
|
3019
|
+
async for chunk in response:
|
|
3020
|
+
yield chunk
|
|
3084
3021
|
|
|
3085
3022
|
|
|
3086
3023
|
asyncio.run(main())
|
|
3087
3024
|
"""
|
|
3088
|
-
|
|
3025
|
+
async with self._client_wrapper.httpx_client.stream(
|
|
3089
3026
|
"v1/tools/mcp/servers/connect",
|
|
3090
3027
|
method="POST",
|
|
3091
3028
|
json=convert_and_respect_annotation_metadata(
|
|
@@ -3093,112 +3030,34 @@ class AsyncToolsClient:
|
|
|
3093
3030
|
),
|
|
3094
3031
|
request_options=request_options,
|
|
3095
3032
|
omit=OMIT,
|
|
3096
|
-
)
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3033
|
+
) as _response:
|
|
3034
|
+
try:
|
|
3035
|
+
if 200 <= _response.status_code < 300:
|
|
3036
|
+
_event_source = httpx_sse.EventSource(_response)
|
|
3037
|
+
async for _sse in _event_source.aiter_sse():
|
|
3038
|
+
try:
|
|
3039
|
+
yield typing.cast(
|
|
3040
|
+
StreamingResponse,
|
|
3041
|
+
construct_type(
|
|
3042
|
+
type_=StreamingResponse, # type: ignore
|
|
3043
|
+
object_=json.loads(_sse.data),
|
|
3044
|
+
),
|
|
3045
|
+
)
|
|
3046
|
+
except:
|
|
3047
|
+
pass
|
|
3048
|
+
return
|
|
3049
|
+
await _response.aread()
|
|
3050
|
+
if _response.status_code == 422:
|
|
3051
|
+
raise UnprocessableEntityError(
|
|
3052
|
+
typing.cast(
|
|
3053
|
+
HttpValidationError,
|
|
3054
|
+
construct_type(
|
|
3055
|
+
type_=HttpValidationError, # type: ignore
|
|
3056
|
+
object_=_response.json(),
|
|
3057
|
+
),
|
|
3058
|
+
)
|
|
3114
3059
|
)
|
|
3115
|
-
)
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
raise ApiError(status_code=_response.status_code, body=
|
|
3119
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
3120
|
-
|
|
3121
|
-
async def mcp_oauth_callback(
|
|
3122
|
-
self,
|
|
3123
|
-
session_id: str,
|
|
3124
|
-
*,
|
|
3125
|
-
code: typing.Optional[str] = None,
|
|
3126
|
-
state: typing.Optional[str] = None,
|
|
3127
|
-
error: typing.Optional[str] = None,
|
|
3128
|
-
error_description: typing.Optional[str] = None,
|
|
3129
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
3130
|
-
) -> None:
|
|
3131
|
-
"""
|
|
3132
|
-
Handle OAuth callback for MCP server authentication.
|
|
3133
|
-
|
|
3134
|
-
Parameters
|
|
3135
|
-
----------
|
|
3136
|
-
session_id : str
|
|
3137
|
-
|
|
3138
|
-
code : typing.Optional[str]
|
|
3139
|
-
OAuth authorization code
|
|
3140
|
-
|
|
3141
|
-
state : typing.Optional[str]
|
|
3142
|
-
OAuth state parameter
|
|
3143
|
-
|
|
3144
|
-
error : typing.Optional[str]
|
|
3145
|
-
OAuth error
|
|
3146
|
-
|
|
3147
|
-
error_description : typing.Optional[str]
|
|
3148
|
-
OAuth error description
|
|
3149
|
-
|
|
3150
|
-
request_options : typing.Optional[RequestOptions]
|
|
3151
|
-
Request-specific configuration.
|
|
3152
|
-
|
|
3153
|
-
Returns
|
|
3154
|
-
-------
|
|
3155
|
-
None
|
|
3156
|
-
|
|
3157
|
-
Examples
|
|
3158
|
-
--------
|
|
3159
|
-
import asyncio
|
|
3160
|
-
|
|
3161
|
-
from letta_client import AsyncLetta
|
|
3162
|
-
|
|
3163
|
-
client = AsyncLetta(
|
|
3164
|
-
project="YOUR_PROJECT",
|
|
3165
|
-
token="YOUR_TOKEN",
|
|
3166
|
-
)
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
async def main() -> None:
|
|
3170
|
-
await client.tools.mcp_oauth_callback(
|
|
3171
|
-
session_id="session_id",
|
|
3172
|
-
)
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
asyncio.run(main())
|
|
3176
|
-
"""
|
|
3177
|
-
_response = await self._client_wrapper.httpx_client.request(
|
|
3178
|
-
f"v1/tools/mcp/oauth/callback/{jsonable_encoder(session_id)}",
|
|
3179
|
-
method="GET",
|
|
3180
|
-
params={
|
|
3181
|
-
"code": code,
|
|
3182
|
-
"state": state,
|
|
3183
|
-
"error": error,
|
|
3184
|
-
"error_description": error_description,
|
|
3185
|
-
},
|
|
3186
|
-
request_options=request_options,
|
|
3187
|
-
)
|
|
3188
|
-
try:
|
|
3189
|
-
if 200 <= _response.status_code < 300:
|
|
3190
|
-
return
|
|
3191
|
-
if _response.status_code == 422:
|
|
3192
|
-
raise UnprocessableEntityError(
|
|
3193
|
-
typing.cast(
|
|
3194
|
-
HttpValidationError,
|
|
3195
|
-
construct_type(
|
|
3196
|
-
type_=HttpValidationError, # type: ignore
|
|
3197
|
-
object_=_response.json(),
|
|
3198
|
-
),
|
|
3199
|
-
)
|
|
3200
|
-
)
|
|
3201
|
-
_response_json = _response.json()
|
|
3202
|
-
except JSONDecodeError:
|
|
3203
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
3204
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
3060
|
+
_response_json = _response.json()
|
|
3061
|
+
except JSONDecodeError:
|
|
3062
|
+
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
3063
|
+
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
from .add_mcp_server_request import AddMcpServerRequest
|
|
4
4
|
from .add_mcp_server_response_item import AddMcpServerResponseItem
|
|
5
5
|
from .connect_mcp_server_request import ConnectMcpServerRequest
|
|
6
|
+
from .connect_mcp_server_response_event import ConnectMcpServerResponseEvent
|
|
6
7
|
from .delete_mcp_server_response_item import DeleteMcpServerResponseItem
|
|
7
8
|
from .list_mcp_servers_response_value import ListMcpServersResponseValue
|
|
9
|
+
from .streaming_response import StreamingResponse
|
|
8
10
|
from .test_mcp_server_request import TestMcpServerRequest
|
|
9
11
|
from .update_mcp_server_request import UpdateMcpServerRequest
|
|
10
12
|
from .update_mcp_server_response import UpdateMcpServerResponse
|
|
@@ -13,8 +15,10 @@ __all__ = [
|
|
|
13
15
|
"AddMcpServerRequest",
|
|
14
16
|
"AddMcpServerResponseItem",
|
|
15
17
|
"ConnectMcpServerRequest",
|
|
18
|
+
"ConnectMcpServerResponseEvent",
|
|
16
19
|
"DeleteMcpServerResponseItem",
|
|
17
20
|
"ListMcpServersResponseValue",
|
|
21
|
+
"StreamingResponse",
|
|
18
22
|
"TestMcpServerRequest",
|
|
19
23
|
"UpdateMcpServerRequest",
|
|
20
24
|
"UpdateMcpServerResponse",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
ConnectMcpServerResponseEvent = typing.Union[
|
|
6
|
+
typing.Literal["connection_attempt", "success", "error", "oauth_required", "authorization_url", "waiting_for_auth"],
|
|
7
|
+
typing.Any,
|
|
8
|
+
]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ...core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
from .connect_mcp_server_response_event import ConnectMcpServerResponseEvent
|
|
5
|
+
import typing
|
|
6
|
+
from ...types.mcp_tool import McpTool
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
import pydantic
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class StreamingResponse(UncheckedBaseModel):
|
|
12
|
+
event: ConnectMcpServerResponseEvent
|
|
13
|
+
message: typing.Optional[str] = None
|
|
14
|
+
tools: typing.Optional[McpTool] = None
|
|
15
|
+
|
|
16
|
+
if IS_PYDANTIC_V2:
|
|
17
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
18
|
+
else:
|
|
19
|
+
|
|
20
|
+
class Config:
|
|
21
|
+
frozen = True
|
|
22
|
+
smart_union = True
|
|
23
|
+
extra = pydantic.Extra.allow
|
|
@@ -93,11 +93,6 @@ class FileMetadata(UncheckedBaseModel):
|
|
|
93
93
|
The update date of the file.
|
|
94
94
|
"""
|
|
95
95
|
|
|
96
|
-
is_deleted: typing.Optional[bool] = pydantic.Field(default=None)
|
|
97
|
-
"""
|
|
98
|
-
Whether this file is deleted or not.
|
|
99
|
-
"""
|
|
100
|
-
|
|
101
96
|
if IS_PYDANTIC_V2:
|
|
102
97
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
103
98
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: letta-client
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.227
|
|
4
4
|
Summary:
|
|
5
5
|
Requires-Python: >=3.8,<4.0
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -102,24 +102,18 @@ except ApiError as e:
|
|
|
102
102
|
The SDK supports streaming responses, as well, the response will be a generator that you can loop over.
|
|
103
103
|
|
|
104
104
|
```python
|
|
105
|
-
from letta_client import Letta,
|
|
105
|
+
from letta_client import Letta, StdioServerConfig
|
|
106
106
|
|
|
107
107
|
client = Letta(
|
|
108
108
|
project="YOUR_PROJECT",
|
|
109
109
|
token="YOUR_TOKEN",
|
|
110
110
|
)
|
|
111
|
-
response = client.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
TextContent(
|
|
118
|
-
text="text",
|
|
119
|
-
)
|
|
120
|
-
],
|
|
121
|
-
)
|
|
122
|
-
],
|
|
111
|
+
response = client.tools.connect_mcp_server(
|
|
112
|
+
request=StdioServerConfig(
|
|
113
|
+
server_name="server_name",
|
|
114
|
+
command="command",
|
|
115
|
+
args=["args"],
|
|
116
|
+
),
|
|
123
117
|
)
|
|
124
118
|
for chunk in response:
|
|
125
119
|
yield chunk
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
letta_client/__init__.py,sha256=
|
|
1
|
+
letta_client/__init__.py,sha256=kQxkWRS8b6iG1Tb3TvpqswqflQ_k9nexhmX_MxZXRiE,19604
|
|
2
2
|
letta_client/agents/__init__.py,sha256=9wEJMighDL1OFg_7Qh-D50bubPbV4BWo1ZKYxdDJGIQ,2146
|
|
3
3
|
letta_client/agents/blocks/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
4
4
|
letta_client/agents/blocks/client.py,sha256=kCAcU1ACOKRCrjEYPyCQslWBjtsq7m4QboQP0wwLQy8,25392
|
|
@@ -75,7 +75,7 @@ letta_client/client_side_access_tokens/types/client_side_access_tokens_list_clie
|
|
|
75
75
|
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
|
|
76
76
|
letta_client/core/__init__.py,sha256=OKbX2aCZXgHCDUsCouqv-OiX32xA6eFFCKIUH9M5Vzk,1591
|
|
77
77
|
letta_client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
|
78
|
-
letta_client/core/client_wrapper.py,sha256=
|
|
78
|
+
letta_client/core/client_wrapper.py,sha256=0OVGNq7fJACf2IFR_zF3LTVzL_3eRQsfHgV5uUw7nKg,2336
|
|
79
79
|
letta_client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
|
80
80
|
letta_client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
|
|
81
81
|
letta_client/core/http_client.py,sha256=Z77OIxIbL4OAB2IDqjRq_sYa5yNYAWfmdhdCSSvh6Y4,19552
|
|
@@ -168,14 +168,16 @@ letta_client/templates/client.py,sha256=wcidkaF0eRgKEYRrDTgKAS_A57MO7H2S_muzznEV
|
|
|
168
168
|
letta_client/templates/types/__init__.py,sha256=dAr_dEh0BdwUxAcV1sJ9RM07Z8nCv4dCK6fmTltqQ6c,286
|
|
169
169
|
letta_client/templates/types/templates_list_response.py,sha256=HYloMVzk086c6fFGRYZz-Ozc_Yylozp2aPpweHS5uXI,866
|
|
170
170
|
letta_client/templates/types/templates_list_response_templates_item.py,sha256=yyJq8wEOb2XIg99uhRMKoy2qD2CbuvI_5FAspwYWnfI,593
|
|
171
|
-
letta_client/tools/__init__.py,sha256=
|
|
172
|
-
letta_client/tools/client.py,sha256=
|
|
173
|
-
letta_client/tools/types/__init__.py,sha256=
|
|
171
|
+
letta_client/tools/__init__.py,sha256=S7wUWB3P-uxAsKEFnzvVBpsDloETL1gks3l6ecdPpBY,705
|
|
172
|
+
letta_client/tools/client.py,sha256=26C9XDrSucsPXxgUYzIYdmKloZPGRevXwFLhoZxyVO8,103238
|
|
173
|
+
letta_client/tools/types/__init__.py,sha256=IodcTbnUxVsTQrNyZnuSfre7Cl2XESyiDkdHmFYfbHY,1035
|
|
174
174
|
letta_client/tools/types/add_mcp_server_request.py,sha256=m3QdTmY2ZHQUWbxMTNsOhPnseWHVipsOTdSXuC7KHQI,371
|
|
175
175
|
letta_client/tools/types/add_mcp_server_response_item.py,sha256=DNrB3LwstJzKrw_GRJ8tb3XCEJWfD16WzBoGrGY_ZQI,376
|
|
176
176
|
letta_client/tools/types/connect_mcp_server_request.py,sha256=KDHYKXnRRf9g8bHUUWvWdyIiJk-enBZ5EO7N80r-i80,375
|
|
177
|
+
letta_client/tools/types/connect_mcp_server_response_event.py,sha256=P_IXBx-DeJ2FdsIzIbRhekUKnU8ugiTgBqOzpRwEK6U,265
|
|
177
178
|
letta_client/tools/types/delete_mcp_server_response_item.py,sha256=YLIBE7OD535NJAncGpzMDGaQRe1831DNKcj2UzS9e0c,379
|
|
178
179
|
letta_client/tools/types/list_mcp_servers_response_value.py,sha256=Eyji5qB7FhowiogsAbpcU_aMyH9zClv9lUMmHOmNPYk,379
|
|
180
|
+
letta_client/tools/types/streaming_response.py,sha256=E7W0OqxHFmhU2slJdzVZBxQA508AF5Im3pAM4UmuLs4,790
|
|
179
181
|
letta_client/tools/types/test_mcp_server_request.py,sha256=sLlOEZdmLfkHqHCkUjntGbr8_MkBhsqpMQ-HwdNOnq0,372
|
|
180
182
|
letta_client/tools/types/update_mcp_server_request.py,sha256=nCpx9-OvpH0l5iJxEi8kgSok1F1r7liEAZm-kaqBtEo,402
|
|
181
183
|
letta_client/tools/types/update_mcp_server_response.py,sha256=muwHagaQBMwQI0of9EBCBtG9lD-jELFAevgTB2MjpFQ,375
|
|
@@ -274,7 +276,7 @@ letta_client/types/feedback_type.py,sha256=sDfsniSnnpSwzZqfIkRL7vYPxYqdwURpI6LMI
|
|
|
274
276
|
letta_client/types/file.py,sha256=ZLCEYJqIJ1pzAJn4Pke6gVdKivKU9FrIg98P4GmFY8M,628
|
|
275
277
|
letta_client/types/file_block.py,sha256=HSfMx6SpCpQv2vdIiqqZ0oxfZoHPquxuU-AG0QtrW-k,2776
|
|
276
278
|
letta_client/types/file_file.py,sha256=jbWcPKn-fSUlq9kl8n2us9fPU6x-Z20IKScHD_pJruw,665
|
|
277
|
-
letta_client/types/file_metadata.py,sha256=
|
|
279
|
+
letta_client/types/file_metadata.py,sha256=iUu4VIA4O805U7HaO9avKrUulIDtYTyBCGRpGLpNH_8,2830
|
|
278
280
|
letta_client/types/file_processing_status.py,sha256=8W8VAx9-jCaUx6q6mvyCMyLoa2peLTE_sgIaGloOWo4,201
|
|
279
281
|
letta_client/types/file_stats.py,sha256=gEaG0m4vulK21EoIuYlOcdy0IK4qWkjBTDoMzXw3GEQ,875
|
|
280
282
|
letta_client/types/folder.py,sha256=R2xGuF_TQ27XmQVq7K8-_LgDsNwEpXj8qsue7eQzhVE,2370
|
|
@@ -445,6 +447,6 @@ letta_client/types/web_search_options_user_location_approximate.py,sha256=Ywk01J
|
|
|
445
447
|
letta_client/version.py,sha256=bttKLbIhO3UonCYQlqs600zzbQgfhCCMjeXR9WRzid4,79
|
|
446
448
|
letta_client/voice/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
|
447
449
|
letta_client/voice/client.py,sha256=47iQYCuW_qpKI4hM3pYVxn3hw7kgQj3emU1_oRpkRMA,5811
|
|
448
|
-
letta_client-0.1.
|
|
449
|
-
letta_client-0.1.
|
|
450
|
-
letta_client-0.1.
|
|
450
|
+
letta_client-0.1.227.dist-info/METADATA,sha256=GtRHclWU1g78NUy1aC1zS6Y2fDhmQY8rjd3l8R0GMLg,5064
|
|
451
|
+
letta_client-0.1.227.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
|
452
|
+
letta_client-0.1.227.dist-info/RECORD,,
|
|
File without changes
|