letta-client 0.1.251__py3-none-any.whl → 0.1.253__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 +40 -8
- letta_client/agents/client.py +31 -8
- letta_client/agents/raw_client.py +31 -10
- letta_client/core/client_wrapper.py +2 -2
- letta_client/tools/client.py +2 -2
- letta_client/tools/raw_client.py +2 -2
- letta_client/types/__init__.py +48 -8
- letta_client/types/agent_file_schema.py +75 -0
- letta_client/types/block_schema.py +73 -0
- letta_client/types/body_export_agent_serialized.py +25 -0
- letta_client/types/file_agent_schema.py +73 -0
- letta_client/types/file_schema.py +93 -0
- letta_client/types/group_schema.py +53 -0
- letta_client/types/group_schema_manager_config.py +13 -0
- letta_client/types/imported_agents_response.py +27 -0
- letta_client/types/letta_schemas_agent_file_agent_schema.py +275 -0
- letta_client/types/letta_schemas_agent_file_agent_schema_response_format.py +11 -0
- letta_client/types/letta_schemas_agent_file_agent_schema_tool_rules_item.py +23 -0
- letta_client/types/letta_schemas_agent_file_message_schema.py +74 -0
- letta_client/types/letta_schemas_agent_file_message_schema_content.py +7 -0
- letta_client/types/letta_schemas_agent_file_tool_schema.py +104 -0
- letta_client/types/{agent_schema.py → letta_serialize_schemas_pydantic_agent_schema_agent_schema.py} +13 -7
- letta_client/types/{agent_schema_tool_rules_item.py → letta_serialize_schemas_pydantic_agent_schema_agent_schema_tool_rules_item.py} +1 -1
- letta_client/types/{message_schema.py → letta_serialize_schemas_pydantic_agent_schema_message_schema.py} +1 -1
- letta_client/types/{tool_schema.py → letta_serialize_schemas_pydantic_agent_schema_tool_schema.py} +1 -1
- letta_client/types/mcp_server_schema.py +37 -0
- letta_client/types/source_schema.py +63 -0
- {letta_client-0.1.251.dist-info → letta_client-0.1.253.dist-info}/METADATA +1 -1
- {letta_client-0.1.251.dist-info → letta_client-0.1.253.dist-info}/RECORD +30 -14
- {letta_client-0.1.251.dist-info → letta_client-0.1.253.dist-info}/WHEEL +0 -0
letta_client/__init__.py
CHANGED
|
@@ -7,8 +7,7 @@ from .types import (
|
|
|
7
7
|
ActionParametersModel,
|
|
8
8
|
ActionResponseModel,
|
|
9
9
|
AgentEnvironmentVariable,
|
|
10
|
-
|
|
11
|
-
AgentSchemaToolRulesItem,
|
|
10
|
+
AgentFileSchema,
|
|
12
11
|
AgentState,
|
|
13
12
|
AgentStateResponseFormat,
|
|
14
13
|
AgentStateToolRulesItem,
|
|
@@ -27,7 +26,9 @@ from .types import (
|
|
|
27
26
|
BaseToolRuleSchema,
|
|
28
27
|
BatchJob,
|
|
29
28
|
Block,
|
|
29
|
+
BlockSchema,
|
|
30
30
|
BlockUpdate,
|
|
31
|
+
BodyExportAgentSerialized,
|
|
31
32
|
ChatCompletionAssistantMessageParam,
|
|
32
33
|
ChatCompletionAssistantMessageParamContent,
|
|
33
34
|
ChatCompletionAssistantMessageParamContentItem,
|
|
@@ -95,10 +96,12 @@ from .types import (
|
|
|
95
96
|
EmbeddingConfigEmbeddingEndpointType,
|
|
96
97
|
FeedbackType,
|
|
97
98
|
File,
|
|
99
|
+
FileAgentSchema,
|
|
98
100
|
FileBlock,
|
|
99
101
|
FileFile,
|
|
100
102
|
FileMetadata,
|
|
101
103
|
FileProcessingStatus,
|
|
104
|
+
FileSchema,
|
|
102
105
|
FileStats,
|
|
103
106
|
Folder,
|
|
104
107
|
FunctionCall,
|
|
@@ -109,6 +112,8 @@ from .types import (
|
|
|
109
112
|
GenerateToolInput,
|
|
110
113
|
GenerateToolOutput,
|
|
111
114
|
Group,
|
|
115
|
+
GroupSchema,
|
|
116
|
+
GroupSchemaManagerConfig,
|
|
112
117
|
Health,
|
|
113
118
|
HiddenReasoningMessage,
|
|
114
119
|
HiddenReasoningMessageState,
|
|
@@ -122,6 +127,7 @@ from .types import (
|
|
|
122
127
|
ImageContentSource,
|
|
123
128
|
ImageUrl,
|
|
124
129
|
ImageUrlDetail,
|
|
130
|
+
ImportedAgentsResponse,
|
|
125
131
|
InitToolRule,
|
|
126
132
|
InputAudio,
|
|
127
133
|
InputAudioFormat,
|
|
@@ -141,6 +147,16 @@ from .types import (
|
|
|
141
147
|
LettaRequest,
|
|
142
148
|
LettaRequestConfig,
|
|
143
149
|
LettaResponse,
|
|
150
|
+
LettaSchemasAgentFileAgentSchema,
|
|
151
|
+
LettaSchemasAgentFileAgentSchemaResponseFormat,
|
|
152
|
+
LettaSchemasAgentFileAgentSchemaToolRulesItem,
|
|
153
|
+
LettaSchemasAgentFileMessageSchema,
|
|
154
|
+
LettaSchemasAgentFileMessageSchemaContent,
|
|
155
|
+
LettaSchemasAgentFileToolSchema,
|
|
156
|
+
LettaSerializeSchemasPydanticAgentSchemaAgentSchema,
|
|
157
|
+
LettaSerializeSchemasPydanticAgentSchemaAgentSchemaToolRulesItem,
|
|
158
|
+
LettaSerializeSchemasPydanticAgentSchemaMessageSchema,
|
|
159
|
+
LettaSerializeSchemasPydanticAgentSchemaToolSchema,
|
|
144
160
|
LettaStopReason,
|
|
145
161
|
LettaStreamingRequest,
|
|
146
162
|
LettaUsageStatistics,
|
|
@@ -153,6 +169,7 @@ from .types import (
|
|
|
153
169
|
ManagerType,
|
|
154
170
|
MaxCountPerStepToolRule,
|
|
155
171
|
MaxCountPerStepToolRuleSchema,
|
|
172
|
+
McpServerSchema,
|
|
156
173
|
McpServerType,
|
|
157
174
|
McpTool,
|
|
158
175
|
Memory,
|
|
@@ -162,7 +179,6 @@ from .types import (
|
|
|
162
179
|
MessageCreateContent,
|
|
163
180
|
MessageCreateRole,
|
|
164
181
|
MessageRole,
|
|
165
|
-
MessageSchema,
|
|
166
182
|
MessageType,
|
|
167
183
|
ModalSandboxConfig,
|
|
168
184
|
ModalSandboxConfigLanguage,
|
|
@@ -212,6 +228,7 @@ from .types import (
|
|
|
212
228
|
SleeptimeManagerUpdate,
|
|
213
229
|
Source,
|
|
214
230
|
SourceCreate,
|
|
231
|
+
SourceSchema,
|
|
215
232
|
SourceStats,
|
|
216
233
|
SourceUpdate,
|
|
217
234
|
SseServerConfig,
|
|
@@ -243,7 +260,6 @@ from .types import (
|
|
|
243
260
|
ToolReturnMessage,
|
|
244
261
|
ToolReturnMessageStatus,
|
|
245
262
|
ToolReturnStatus,
|
|
246
|
-
ToolSchema,
|
|
247
263
|
ToolType,
|
|
248
264
|
UpdateAssistantMessage,
|
|
249
265
|
UpdateAssistantMessageContent,
|
|
@@ -360,8 +376,7 @@ __all__ = [
|
|
|
360
376
|
"AddMcpServerRequest",
|
|
361
377
|
"AddMcpServerResponseItem",
|
|
362
378
|
"AgentEnvironmentVariable",
|
|
363
|
-
"
|
|
364
|
-
"AgentSchemaToolRulesItem",
|
|
379
|
+
"AgentFileSchema",
|
|
365
380
|
"AgentState",
|
|
366
381
|
"AgentStateResponseFormat",
|
|
367
382
|
"AgentStateToolRulesItem",
|
|
@@ -392,7 +407,9 @@ __all__ = [
|
|
|
392
407
|
"BaseToolRuleSchema",
|
|
393
408
|
"BatchJob",
|
|
394
409
|
"Block",
|
|
410
|
+
"BlockSchema",
|
|
395
411
|
"BlockUpdate",
|
|
412
|
+
"BodyExportAgentSerialized",
|
|
396
413
|
"ChatCompletionAssistantMessageParam",
|
|
397
414
|
"ChatCompletionAssistantMessageParamContent",
|
|
398
415
|
"ChatCompletionAssistantMessageParamContentItem",
|
|
@@ -477,10 +494,12 @@ __all__ = [
|
|
|
477
494
|
"EmbeddingConfigEmbeddingEndpointType",
|
|
478
495
|
"FeedbackType",
|
|
479
496
|
"File",
|
|
497
|
+
"FileAgentSchema",
|
|
480
498
|
"FileBlock",
|
|
481
499
|
"FileFile",
|
|
482
500
|
"FileMetadata",
|
|
483
501
|
"FileProcessingStatus",
|
|
502
|
+
"FileSchema",
|
|
484
503
|
"FileStats",
|
|
485
504
|
"Folder",
|
|
486
505
|
"FunctionCall",
|
|
@@ -492,6 +511,8 @@ __all__ = [
|
|
|
492
511
|
"GenerateToolOutput",
|
|
493
512
|
"Group",
|
|
494
513
|
"GroupCreateManagerConfig",
|
|
514
|
+
"GroupSchema",
|
|
515
|
+
"GroupSchemaManagerConfig",
|
|
495
516
|
"GroupUpdateManagerConfig",
|
|
496
517
|
"Health",
|
|
497
518
|
"HiddenReasoningMessage",
|
|
@@ -506,6 +527,7 @@ __all__ = [
|
|
|
506
527
|
"ImageContentSource",
|
|
507
528
|
"ImageUrl",
|
|
508
529
|
"ImageUrlDetail",
|
|
530
|
+
"ImportedAgentsResponse",
|
|
509
531
|
"InitToolRule",
|
|
510
532
|
"InputAudio",
|
|
511
533
|
"InputAudioFormat",
|
|
@@ -528,6 +550,16 @@ __all__ = [
|
|
|
528
550
|
"LettaRequest",
|
|
529
551
|
"LettaRequestConfig",
|
|
530
552
|
"LettaResponse",
|
|
553
|
+
"LettaSchemasAgentFileAgentSchema",
|
|
554
|
+
"LettaSchemasAgentFileAgentSchemaResponseFormat",
|
|
555
|
+
"LettaSchemasAgentFileAgentSchemaToolRulesItem",
|
|
556
|
+
"LettaSchemasAgentFileMessageSchema",
|
|
557
|
+
"LettaSchemasAgentFileMessageSchemaContent",
|
|
558
|
+
"LettaSchemasAgentFileToolSchema",
|
|
559
|
+
"LettaSerializeSchemasPydanticAgentSchemaAgentSchema",
|
|
560
|
+
"LettaSerializeSchemasPydanticAgentSchemaAgentSchemaToolRulesItem",
|
|
561
|
+
"LettaSerializeSchemasPydanticAgentSchemaMessageSchema",
|
|
562
|
+
"LettaSerializeSchemasPydanticAgentSchemaToolSchema",
|
|
531
563
|
"LettaStopReason",
|
|
532
564
|
"LettaStreamingRequest",
|
|
533
565
|
"LettaUsageStatistics",
|
|
@@ -541,6 +573,7 @@ __all__ = [
|
|
|
541
573
|
"ManagerType",
|
|
542
574
|
"MaxCountPerStepToolRule",
|
|
543
575
|
"MaxCountPerStepToolRuleSchema",
|
|
576
|
+
"McpServerSchema",
|
|
544
577
|
"McpServerType",
|
|
545
578
|
"McpTool",
|
|
546
579
|
"Memory",
|
|
@@ -550,7 +583,6 @@ __all__ = [
|
|
|
550
583
|
"MessageCreateContent",
|
|
551
584
|
"MessageCreateRole",
|
|
552
585
|
"MessageRole",
|
|
553
|
-
"MessageSchema",
|
|
554
586
|
"MessageType",
|
|
555
587
|
"ModalSandboxConfig",
|
|
556
588
|
"ModalSandboxConfigLanguage",
|
|
@@ -604,6 +636,7 @@ __all__ = [
|
|
|
604
636
|
"SleeptimeManagerUpdate",
|
|
605
637
|
"Source",
|
|
606
638
|
"SourceCreate",
|
|
639
|
+
"SourceSchema",
|
|
607
640
|
"SourceStats",
|
|
608
641
|
"SourceUpdate",
|
|
609
642
|
"SseServerConfig",
|
|
@@ -640,7 +673,6 @@ __all__ = [
|
|
|
640
673
|
"ToolReturnMessage",
|
|
641
674
|
"ToolReturnMessageStatus",
|
|
642
675
|
"ToolReturnStatus",
|
|
643
|
-
"ToolSchema",
|
|
644
676
|
"ToolType",
|
|
645
677
|
"UnprocessableEntityError",
|
|
646
678
|
"UpdateAgentResponseFormat",
|
letta_client/agents/client.py
CHANGED
|
@@ -10,6 +10,7 @@ from ..types.agent_state import AgentState
|
|
|
10
10
|
from ..types.agent_type import AgentType
|
|
11
11
|
from ..types.create_block import CreateBlock
|
|
12
12
|
from ..types.embedding_config import EmbeddingConfig
|
|
13
|
+
from ..types.imported_agents_response import ImportedAgentsResponse
|
|
13
14
|
from ..types.llm_config import LlmConfig
|
|
14
15
|
from ..types.message_create import MessageCreate
|
|
15
16
|
from .blocks.client import AsyncBlocksClient, BlocksClient
|
|
@@ -466,17 +467,25 @@ class AgentsClient:
|
|
|
466
467
|
agent_id: str,
|
|
467
468
|
*,
|
|
468
469
|
max_steps: typing.Optional[int] = None,
|
|
470
|
+
use_legacy_format: typing.Optional[bool] = None,
|
|
469
471
|
request_options: typing.Optional[RequestOptions] = None,
|
|
470
472
|
) -> str:
|
|
471
473
|
"""
|
|
472
474
|
Export the serialized JSON representation of an agent, formatted with indentation.
|
|
473
475
|
|
|
476
|
+
Supports two export formats:
|
|
477
|
+
- Legacy format (use_legacy_format=true): Single agent with inline tools/blocks
|
|
478
|
+
- New format (default): Multi-entity format with separate agents, tools, blocks, files, etc.
|
|
479
|
+
|
|
474
480
|
Parameters
|
|
475
481
|
----------
|
|
476
482
|
agent_id : str
|
|
477
483
|
|
|
478
484
|
max_steps : typing.Optional[int]
|
|
479
485
|
|
|
486
|
+
use_legacy_format : typing.Optional[bool]
|
|
487
|
+
If true, exports using the legacy single-agent format. If false, exports using the new multi-entity format.
|
|
488
|
+
|
|
480
489
|
request_options : typing.Optional[RequestOptions]
|
|
481
490
|
Request-specific configuration.
|
|
482
491
|
|
|
@@ -497,7 +506,9 @@ class AgentsClient:
|
|
|
497
506
|
agent_id="agent_id",
|
|
498
507
|
)
|
|
499
508
|
"""
|
|
500
|
-
_response = self._raw_client.export_file(
|
|
509
|
+
_response = self._raw_client.export_file(
|
|
510
|
+
agent_id, max_steps=max_steps, use_legacy_format=use_legacy_format, request_options=request_options
|
|
511
|
+
)
|
|
501
512
|
return _response.data
|
|
502
513
|
|
|
503
514
|
def import_file(
|
|
@@ -510,9 +521,10 @@ class AgentsClient:
|
|
|
510
521
|
strip_messages: typing.Optional[bool] = OMIT,
|
|
511
522
|
env_vars: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
512
523
|
request_options: typing.Optional[RequestOptions] = None,
|
|
513
|
-
) ->
|
|
524
|
+
) -> ImportedAgentsResponse:
|
|
514
525
|
"""
|
|
515
|
-
Import a serialized agent file and recreate the agent in the system.
|
|
526
|
+
Import a serialized agent file and recreate the agent(s) in the system.
|
|
527
|
+
Returns the IDs of all imported agents.
|
|
516
528
|
|
|
517
529
|
Parameters
|
|
518
530
|
----------
|
|
@@ -539,7 +551,7 @@ class AgentsClient:
|
|
|
539
551
|
|
|
540
552
|
Returns
|
|
541
553
|
-------
|
|
542
|
-
|
|
554
|
+
ImportedAgentsResponse
|
|
543
555
|
Successful Response
|
|
544
556
|
|
|
545
557
|
Examples
|
|
@@ -1380,17 +1392,25 @@ class AsyncAgentsClient:
|
|
|
1380
1392
|
agent_id: str,
|
|
1381
1393
|
*,
|
|
1382
1394
|
max_steps: typing.Optional[int] = None,
|
|
1395
|
+
use_legacy_format: typing.Optional[bool] = None,
|
|
1383
1396
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1384
1397
|
) -> str:
|
|
1385
1398
|
"""
|
|
1386
1399
|
Export the serialized JSON representation of an agent, formatted with indentation.
|
|
1387
1400
|
|
|
1401
|
+
Supports two export formats:
|
|
1402
|
+
- Legacy format (use_legacy_format=true): Single agent with inline tools/blocks
|
|
1403
|
+
- New format (default): Multi-entity format with separate agents, tools, blocks, files, etc.
|
|
1404
|
+
|
|
1388
1405
|
Parameters
|
|
1389
1406
|
----------
|
|
1390
1407
|
agent_id : str
|
|
1391
1408
|
|
|
1392
1409
|
max_steps : typing.Optional[int]
|
|
1393
1410
|
|
|
1411
|
+
use_legacy_format : typing.Optional[bool]
|
|
1412
|
+
If true, exports using the legacy single-agent format. If false, exports using the new multi-entity format.
|
|
1413
|
+
|
|
1394
1414
|
request_options : typing.Optional[RequestOptions]
|
|
1395
1415
|
Request-specific configuration.
|
|
1396
1416
|
|
|
@@ -1419,7 +1439,9 @@ class AsyncAgentsClient:
|
|
|
1419
1439
|
|
|
1420
1440
|
asyncio.run(main())
|
|
1421
1441
|
"""
|
|
1422
|
-
_response = await self._raw_client.export_file(
|
|
1442
|
+
_response = await self._raw_client.export_file(
|
|
1443
|
+
agent_id, max_steps=max_steps, use_legacy_format=use_legacy_format, request_options=request_options
|
|
1444
|
+
)
|
|
1423
1445
|
return _response.data
|
|
1424
1446
|
|
|
1425
1447
|
async def import_file(
|
|
@@ -1432,9 +1454,10 @@ class AsyncAgentsClient:
|
|
|
1432
1454
|
strip_messages: typing.Optional[bool] = OMIT,
|
|
1433
1455
|
env_vars: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
1434
1456
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1435
|
-
) ->
|
|
1457
|
+
) -> ImportedAgentsResponse:
|
|
1436
1458
|
"""
|
|
1437
|
-
Import a serialized agent file and recreate the agent in the system.
|
|
1459
|
+
Import a serialized agent file and recreate the agent(s) in the system.
|
|
1460
|
+
Returns the IDs of all imported agents.
|
|
1438
1461
|
|
|
1439
1462
|
Parameters
|
|
1440
1463
|
----------
|
|
@@ -1461,7 +1484,7 @@ class AsyncAgentsClient:
|
|
|
1461
1484
|
|
|
1462
1485
|
Returns
|
|
1463
1486
|
-------
|
|
1464
|
-
|
|
1487
|
+
ImportedAgentsResponse
|
|
1465
1488
|
Successful Response
|
|
1466
1489
|
|
|
1467
1490
|
Examples
|
|
@@ -18,6 +18,7 @@ from ..types.agent_type import AgentType
|
|
|
18
18
|
from ..types.create_block import CreateBlock
|
|
19
19
|
from ..types.embedding_config import EmbeddingConfig
|
|
20
20
|
from ..types.http_validation_error import HttpValidationError
|
|
21
|
+
from ..types.imported_agents_response import ImportedAgentsResponse
|
|
21
22
|
from ..types.llm_config import LlmConfig
|
|
22
23
|
from ..types.message_create import MessageCreate
|
|
23
24
|
from .types.agents_search_request_search_item import AgentsSearchRequestSearchItem
|
|
@@ -497,17 +498,25 @@ class RawAgentsClient:
|
|
|
497
498
|
agent_id: str,
|
|
498
499
|
*,
|
|
499
500
|
max_steps: typing.Optional[int] = None,
|
|
501
|
+
use_legacy_format: typing.Optional[bool] = None,
|
|
500
502
|
request_options: typing.Optional[RequestOptions] = None,
|
|
501
503
|
) -> HttpResponse[str]:
|
|
502
504
|
"""
|
|
503
505
|
Export the serialized JSON representation of an agent, formatted with indentation.
|
|
504
506
|
|
|
507
|
+
Supports two export formats:
|
|
508
|
+
- Legacy format (use_legacy_format=true): Single agent with inline tools/blocks
|
|
509
|
+
- New format (default): Multi-entity format with separate agents, tools, blocks, files, etc.
|
|
510
|
+
|
|
505
511
|
Parameters
|
|
506
512
|
----------
|
|
507
513
|
agent_id : str
|
|
508
514
|
|
|
509
515
|
max_steps : typing.Optional[int]
|
|
510
516
|
|
|
517
|
+
use_legacy_format : typing.Optional[bool]
|
|
518
|
+
If true, exports using the legacy single-agent format. If false, exports using the new multi-entity format.
|
|
519
|
+
|
|
511
520
|
request_options : typing.Optional[RequestOptions]
|
|
512
521
|
Request-specific configuration.
|
|
513
522
|
|
|
@@ -521,6 +530,7 @@ class RawAgentsClient:
|
|
|
521
530
|
method="GET",
|
|
522
531
|
params={
|
|
523
532
|
"max_steps": max_steps,
|
|
533
|
+
"use_legacy_format": use_legacy_format,
|
|
524
534
|
},
|
|
525
535
|
request_options=request_options,
|
|
526
536
|
)
|
|
@@ -560,9 +570,10 @@ class RawAgentsClient:
|
|
|
560
570
|
strip_messages: typing.Optional[bool] = OMIT,
|
|
561
571
|
env_vars: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
562
572
|
request_options: typing.Optional[RequestOptions] = None,
|
|
563
|
-
) -> HttpResponse[
|
|
573
|
+
) -> HttpResponse[ImportedAgentsResponse]:
|
|
564
574
|
"""
|
|
565
|
-
Import a serialized agent file and recreate the agent in the system.
|
|
575
|
+
Import a serialized agent file and recreate the agent(s) in the system.
|
|
576
|
+
Returns the IDs of all imported agents.
|
|
566
577
|
|
|
567
578
|
Parameters
|
|
568
579
|
----------
|
|
@@ -589,7 +600,7 @@ class RawAgentsClient:
|
|
|
589
600
|
|
|
590
601
|
Returns
|
|
591
602
|
-------
|
|
592
|
-
HttpResponse[
|
|
603
|
+
HttpResponse[ImportedAgentsResponse]
|
|
593
604
|
Successful Response
|
|
594
605
|
"""
|
|
595
606
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -612,9 +623,9 @@ class RawAgentsClient:
|
|
|
612
623
|
try:
|
|
613
624
|
if 200 <= _response.status_code < 300:
|
|
614
625
|
_data = typing.cast(
|
|
615
|
-
|
|
626
|
+
ImportedAgentsResponse,
|
|
616
627
|
construct_type(
|
|
617
|
-
type_=
|
|
628
|
+
type_=ImportedAgentsResponse, # type: ignore
|
|
618
629
|
object_=_response.json(),
|
|
619
630
|
),
|
|
620
631
|
)
|
|
@@ -1548,17 +1559,25 @@ class AsyncRawAgentsClient:
|
|
|
1548
1559
|
agent_id: str,
|
|
1549
1560
|
*,
|
|
1550
1561
|
max_steps: typing.Optional[int] = None,
|
|
1562
|
+
use_legacy_format: typing.Optional[bool] = None,
|
|
1551
1563
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1552
1564
|
) -> AsyncHttpResponse[str]:
|
|
1553
1565
|
"""
|
|
1554
1566
|
Export the serialized JSON representation of an agent, formatted with indentation.
|
|
1555
1567
|
|
|
1568
|
+
Supports two export formats:
|
|
1569
|
+
- Legacy format (use_legacy_format=true): Single agent with inline tools/blocks
|
|
1570
|
+
- New format (default): Multi-entity format with separate agents, tools, blocks, files, etc.
|
|
1571
|
+
|
|
1556
1572
|
Parameters
|
|
1557
1573
|
----------
|
|
1558
1574
|
agent_id : str
|
|
1559
1575
|
|
|
1560
1576
|
max_steps : typing.Optional[int]
|
|
1561
1577
|
|
|
1578
|
+
use_legacy_format : typing.Optional[bool]
|
|
1579
|
+
If true, exports using the legacy single-agent format. If false, exports using the new multi-entity format.
|
|
1580
|
+
|
|
1562
1581
|
request_options : typing.Optional[RequestOptions]
|
|
1563
1582
|
Request-specific configuration.
|
|
1564
1583
|
|
|
@@ -1572,6 +1591,7 @@ class AsyncRawAgentsClient:
|
|
|
1572
1591
|
method="GET",
|
|
1573
1592
|
params={
|
|
1574
1593
|
"max_steps": max_steps,
|
|
1594
|
+
"use_legacy_format": use_legacy_format,
|
|
1575
1595
|
},
|
|
1576
1596
|
request_options=request_options,
|
|
1577
1597
|
)
|
|
@@ -1611,9 +1631,10 @@ class AsyncRawAgentsClient:
|
|
|
1611
1631
|
strip_messages: typing.Optional[bool] = OMIT,
|
|
1612
1632
|
env_vars: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
|
1613
1633
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1614
|
-
) -> AsyncHttpResponse[
|
|
1634
|
+
) -> AsyncHttpResponse[ImportedAgentsResponse]:
|
|
1615
1635
|
"""
|
|
1616
|
-
Import a serialized agent file and recreate the agent in the system.
|
|
1636
|
+
Import a serialized agent file and recreate the agent(s) in the system.
|
|
1637
|
+
Returns the IDs of all imported agents.
|
|
1617
1638
|
|
|
1618
1639
|
Parameters
|
|
1619
1640
|
----------
|
|
@@ -1640,7 +1661,7 @@ class AsyncRawAgentsClient:
|
|
|
1640
1661
|
|
|
1641
1662
|
Returns
|
|
1642
1663
|
-------
|
|
1643
|
-
AsyncHttpResponse[
|
|
1664
|
+
AsyncHttpResponse[ImportedAgentsResponse]
|
|
1644
1665
|
Successful Response
|
|
1645
1666
|
"""
|
|
1646
1667
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -1663,9 +1684,9 @@ class AsyncRawAgentsClient:
|
|
|
1663
1684
|
try:
|
|
1664
1685
|
if 200 <= _response.status_code < 300:
|
|
1665
1686
|
_data = typing.cast(
|
|
1666
|
-
|
|
1687
|
+
ImportedAgentsResponse,
|
|
1667
1688
|
construct_type(
|
|
1668
|
-
type_=
|
|
1689
|
+
type_=ImportedAgentsResponse, # type: ignore
|
|
1669
1690
|
object_=_response.json(),
|
|
1670
1691
|
),
|
|
1671
1692
|
)
|
|
@@ -24,10 +24,10 @@ class BaseClientWrapper:
|
|
|
24
24
|
|
|
25
25
|
def get_headers(self) -> typing.Dict[str, str]:
|
|
26
26
|
headers: typing.Dict[str, str] = {
|
|
27
|
-
"User-Agent": "letta-client/0.1.
|
|
27
|
+
"User-Agent": "letta-client/0.1.253",
|
|
28
28
|
"X-Fern-Language": "Python",
|
|
29
29
|
"X-Fern-SDK-Name": "letta-client",
|
|
30
|
-
"X-Fern-SDK-Version": "0.1.
|
|
30
|
+
"X-Fern-SDK-Version": "0.1.253",
|
|
31
31
|
**(self.get_custom_headers() or {}),
|
|
32
32
|
}
|
|
33
33
|
if self._project is not None:
|
letta_client/tools/client.py
CHANGED
|
@@ -770,7 +770,7 @@ class ToolsClient:
|
|
|
770
770
|
self, mcp_server_name: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
771
771
|
) -> typing.List[DeleteMcpServerResponseItem]:
|
|
772
772
|
"""
|
|
773
|
-
|
|
773
|
+
Delete a MCP server configuration
|
|
774
774
|
|
|
775
775
|
Parameters
|
|
776
776
|
----------
|
|
@@ -1794,7 +1794,7 @@ class AsyncToolsClient:
|
|
|
1794
1794
|
self, mcp_server_name: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
1795
1795
|
) -> typing.List[DeleteMcpServerResponseItem]:
|
|
1796
1796
|
"""
|
|
1797
|
-
|
|
1797
|
+
Delete a MCP server configuration
|
|
1798
1798
|
|
|
1799
1799
|
Parameters
|
|
1800
1800
|
----------
|
letta_client/tools/raw_client.py
CHANGED
|
@@ -1085,7 +1085,7 @@ class RawToolsClient:
|
|
|
1085
1085
|
self, mcp_server_name: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
1086
1086
|
) -> HttpResponse[typing.List[DeleteMcpServerResponseItem]]:
|
|
1087
1087
|
"""
|
|
1088
|
-
|
|
1088
|
+
Delete a MCP server configuration
|
|
1089
1089
|
|
|
1090
1090
|
Parameters
|
|
1091
1091
|
----------
|
|
@@ -2379,7 +2379,7 @@ class AsyncRawToolsClient:
|
|
|
2379
2379
|
self, mcp_server_name: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
2380
2380
|
) -> AsyncHttpResponse[typing.List[DeleteMcpServerResponseItem]]:
|
|
2381
2381
|
"""
|
|
2382
|
-
|
|
2382
|
+
Delete a MCP server configuration
|
|
2383
2383
|
|
|
2384
2384
|
Parameters
|
|
2385
2385
|
----------
|