letta-client 0.1.319__py3-none-any.whl → 0.1.320__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 +51 -9
- letta_client/agents/__init__.py +6 -2
- letta_client/agents/client.py +50 -213
- letta_client/agents/files/client.py +51 -6
- letta_client/agents/files/raw_client.py +94 -9
- letta_client/agents/messages/__init__.py +2 -2
- letta_client/agents/messages/client.py +104 -24
- letta_client/agents/messages/raw_client.py +109 -17
- letta_client/agents/messages/types/__init__.py +2 -2
- letta_client/agents/messages/types/{messages_preview_raw_payload_request.py → messages_preview_request.py} +1 -1
- letta_client/agents/raw_client.py +50 -253
- letta_client/agents/types/__init__.py +4 -0
- letta_client/agents/types/agents_list_request_order.py +5 -0
- letta_client/agents/types/agents_list_request_order_by.py +5 -0
- letta_client/archives/__init__.py +7 -0
- letta_client/archives/client.py +362 -0
- letta_client/archives/raw_client.py +448 -0
- letta_client/archives/types/__init__.py +7 -0
- letta_client/archives/types/list_archives_request_order.py +5 -0
- letta_client/base_client.py +3 -6
- letta_client/batches/__init__.py +5 -0
- letta_client/batches/client.py +68 -8
- letta_client/batches/messages/__init__.py +7 -0
- letta_client/{messages → batches/messages}/client.py +50 -43
- letta_client/{messages → batches/messages}/raw_client.py +52 -45
- letta_client/batches/messages/types/__init__.py +7 -0
- letta_client/batches/messages/types/messages_list_request_order.py +5 -0
- letta_client/batches/raw_client.py +71 -6
- letta_client/batches/types/__init__.py +7 -0
- letta_client/batches/types/batches_list_request_order.py +5 -0
- letta_client/blocks/__init__.py +3 -1
- letta_client/blocks/agents/__init__.py +3 -0
- letta_client/blocks/agents/client.py +57 -2
- letta_client/blocks/agents/raw_client.py +51 -0
- letta_client/blocks/agents/types/__init__.py +7 -0
- letta_client/blocks/agents/types/agents_list_request_order.py +5 -0
- letta_client/blocks/client.py +25 -4
- letta_client/blocks/raw_client.py +25 -4
- letta_client/blocks/types/__init__.py +7 -0
- letta_client/blocks/types/blocks_list_request_order.py +5 -0
- letta_client/core/client_wrapper.py +2 -2
- letta_client/errors/__init__.py +9 -1
- letta_client/errors/internal_server_error.py +10 -0
- letta_client/folders/__init__.py +14 -2
- letta_client/folders/agents/__init__.py +7 -0
- letta_client/folders/agents/client.py +176 -0
- letta_client/folders/agents/raw_client.py +182 -0
- letta_client/folders/agents/types/__init__.py +7 -0
- letta_client/folders/agents/types/agents_list_request_order.py +5 -0
- letta_client/folders/client.py +96 -86
- letta_client/folders/files/__init__.py +3 -0
- letta_client/folders/files/client.py +49 -10
- letta_client/folders/files/raw_client.py +41 -10
- letta_client/folders/files/types/__init__.py +7 -0
- letta_client/folders/files/types/files_list_request_order.py +5 -0
- letta_client/folders/passages/__init__.py +3 -0
- letta_client/folders/passages/client.py +43 -14
- letta_client/folders/passages/raw_client.py +35 -14
- letta_client/folders/passages/types/__init__.py +7 -0
- letta_client/folders/passages/types/passages_list_request_order.py +5 -0
- letta_client/folders/raw_client.py +83 -104
- letta_client/folders/types/__init__.py +7 -0
- letta_client/folders/types/folders_list_request_order.py +5 -0
- letta_client/groups/__init__.py +4 -2
- letta_client/groups/client.py +27 -6
- letta_client/groups/messages/__init__.py +2 -2
- letta_client/groups/messages/client.py +39 -18
- letta_client/groups/messages/raw_client.py +35 -14
- letta_client/groups/messages/types/__init__.py +2 -1
- letta_client/groups/messages/types/messages_list_request_order.py +5 -0
- letta_client/groups/raw_client.py +27 -6
- letta_client/groups/types/__init__.py +2 -1
- letta_client/groups/types/groups_list_request_order.py +5 -0
- letta_client/identities/__init__.py +12 -2
- letta_client/identities/agents/__init__.py +7 -0
- letta_client/identities/agents/client.py +177 -0
- letta_client/identities/agents/raw_client.py +183 -0
- letta_client/identities/agents/types/__init__.py +7 -0
- letta_client/identities/agents/types/agents_list_request_order.py +5 -0
- letta_client/identities/blocks/__init__.py +7 -0
- letta_client/identities/blocks/client.py +177 -0
- letta_client/identities/blocks/raw_client.py +183 -0
- letta_client/identities/blocks/types/__init__.py +7 -0
- letta_client/identities/blocks/types/blocks_list_request_order.py +5 -0
- letta_client/identities/client.py +37 -0
- letta_client/identities/raw_client.py +27 -0
- letta_client/identities/types/__init__.py +7 -0
- letta_client/identities/types/identities_list_request_order.py +5 -0
- letta_client/jobs/client.py +10 -2
- letta_client/jobs/raw_client.py +10 -2
- letta_client/models/__init__.py +3 -0
- letta_client/models/client.py +3 -0
- letta_client/{embedding_models → models/embeddings}/client.py +14 -14
- letta_client/{embedding_models → models/embeddings}/raw_client.py +10 -10
- letta_client/providers/__init__.py +3 -0
- letta_client/providers/client.py +151 -82
- letta_client/providers/raw_client.py +165 -72
- letta_client/providers/types/__init__.py +7 -0
- letta_client/providers/types/providers_list_request_order.py +5 -0
- letta_client/runs/__init__.py +2 -1
- letta_client/runs/client.py +21 -0
- letta_client/runs/messages/__init__.py +3 -0
- letta_client/runs/messages/client.py +15 -49
- letta_client/runs/messages/raw_client.py +13 -49
- letta_client/runs/messages/types/__init__.py +7 -0
- letta_client/runs/messages/types/messages_list_request_order.py +5 -0
- letta_client/runs/raw_client.py +21 -0
- letta_client/steps/__init__.py +13 -3
- letta_client/steps/client.py +32 -83
- letta_client/steps/feedback/client.py +21 -6
- letta_client/steps/feedback/raw_client.py +29 -6
- letta_client/steps/messages/__init__.py +7 -0
- letta_client/steps/messages/client.py +177 -0
- letta_client/steps/messages/raw_client.py +183 -0
- letta_client/steps/messages/types/__init__.py +8 -0
- letta_client/steps/messages/types/messages_list_request_order.py +5 -0
- letta_client/steps/messages/types/messages_list_response_item.py +25 -0
- letta_client/steps/metrics/client.py +110 -0
- letta_client/steps/metrics/raw_client.py +122 -0
- letta_client/steps/raw_client.py +17 -107
- letta_client/steps/trace/__init__.py +4 -0
- letta_client/steps/trace/client.py +110 -0
- letta_client/steps/trace/raw_client.py +122 -0
- letta_client/steps/types/__init__.py +2 -1
- letta_client/steps/types/steps_list_request_order.py +5 -0
- letta_client/tags/__init__.py +3 -0
- letta_client/tags/client.py +57 -4
- letta_client/tags/raw_client.py +49 -2
- letta_client/tags/types/__init__.py +7 -0
- letta_client/tags/types/tags_list_request_order.py +5 -0
- letta_client/telemetry/client.py +8 -0
- letta_client/telemetry/raw_client.py +8 -0
- letta_client/templates/__init__.py +64 -0
- letta_client/templates/agents/__init__.py +58 -0
- letta_client/templates/agents/types/__init__.py +66 -0
- letta_client/templates/agents/types/agents_create_response.py +6 -0
- letta_client/templates/agents/types/agents_create_response_group.py +52 -0
- letta_client/templates/agents/types/agents_create_response_group_base_template_id.py +12 -0
- letta_client/templates/agents/types/agents_create_response_group_base_template_id_item.py +5 -0
- letta_client/templates/agents/types/agents_create_response_group_deployment_id.py +12 -0
- letta_client/templates/agents/types/agents_create_response_group_deployment_id_item.py +5 -0
- letta_client/templates/agents/types/agents_create_response_group_hidden.py +12 -0
- letta_client/templates/agents/types/agents_create_response_group_hidden_item.py +5 -0
- letta_client/templates/agents/types/agents_create_response_group_last_processed_message_id.py +14 -0
- letta_client/templates/agents/types/agents_create_response_group_last_processed_message_id_item.py +5 -0
- letta_client/templates/agents/types/agents_create_response_group_manager_agent_id.py +12 -0
- letta_client/templates/agents/types/agents_create_response_group_manager_agent_id_item.py +5 -0
- letta_client/templates/agents/types/agents_create_response_group_manager_type.py +7 -0
- letta_client/templates/agents/types/agents_create_response_group_max_message_buffer_length.py +14 -0
- letta_client/templates/agents/types/agents_create_response_group_max_message_buffer_length_item.py +5 -0
- letta_client/templates/agents/types/agents_create_response_group_max_turns.py +12 -0
- letta_client/templates/agents/types/agents_create_response_group_max_turns_item.py +5 -0
- letta_client/templates/agents/types/agents_create_response_group_min_message_buffer_length.py +14 -0
- letta_client/templates/agents/types/agents_create_response_group_min_message_buffer_length_item.py +5 -0
- letta_client/templates/agents/types/agents_create_response_group_project_id.py +12 -0
- letta_client/templates/agents/types/agents_create_response_group_project_id_item.py +5 -0
- letta_client/templates/agents/types/agents_create_response_group_shared_block_ids.py +5 -0
- letta_client/templates/agents/types/agents_create_response_group_sleeptime_agent_frequency.py +14 -0
- letta_client/templates/agents/types/agents_create_response_group_sleeptime_agent_frequency_item.py +5 -0
- letta_client/templates/agents/types/agents_create_response_group_template_id.py +12 -0
- letta_client/templates/agents/types/agents_create_response_group_template_id_item.py +5 -0
- letta_client/templates/agents/types/agents_create_response_group_termination_token.py +12 -0
- letta_client/templates/agents/types/agents_create_response_group_termination_token_item.py +5 -0
- letta_client/templates/agents/types/agents_create_response_group_turns_counter.py +12 -0
- letta_client/templates/agents/types/agents_create_response_group_turns_counter_item.py +5 -0
- letta_client/templates/client.py +260 -0
- letta_client/templates/raw_client.py +395 -0
- letta_client/templates/types/__init__.py +8 -0
- letta_client/templates/types/templates_get_template_snapshot_response.py +4 -0
- letta_client/templates/types/templates_get_template_snapshot_response_blocks_item.py +1 -0
- letta_client/templates/types/templates_get_template_snapshot_response_relationships_item.py +23 -0
- letta_client/templates/types/templates_migrate_deployment_response.py +21 -0
- letta_client/templates/types/templates_set_current_template_from_snapshot_response.py +21 -0
- letta_client/tools/__init__.py +2 -0
- letta_client/tools/client.py +47 -20
- letta_client/tools/raw_client.py +43 -26
- letta_client/tools/types/__init__.py +2 -0
- letta_client/tools/types/tools_list_request_order.py +5 -0
- letta_client/types/__init__.py +10 -2
- letta_client/types/agent_state.py +5 -0
- letta_client/types/archive.py +77 -0
- letta_client/types/batch_job.py +6 -0
- letta_client/types/{body_export_agent_serialized.py → body_export_agent.py} +1 -1
- letta_client/types/child_tool_rule.py +1 -1
- letta_client/types/conditional_tool_rule.py +1 -1
- letta_client/types/continue_tool_rule.py +1 -1
- letta_client/types/deployment_entity.py +2 -0
- letta_client/types/init_tool_rule.py +1 -1
- letta_client/types/internal_server_error_body.py +20 -0
- letta_client/types/internal_template_agent_create.py +5 -0
- letta_client/types/job.py +6 -0
- letta_client/types/letta_schemas_agent_file_agent_schema.py +5 -0
- letta_client/types/max_count_per_step_tool_rule.py +1 -1
- letta_client/types/memory.py +7 -1
- letta_client/types/memory_agent_type.py +7 -0
- letta_client/types/parent_tool_rule.py +1 -1
- letta_client/types/required_before_exit_tool_rule.py +1 -1
- letta_client/types/requires_approval_tool_rule.py +1 -1
- letta_client/types/run.py +6 -0
- letta_client/types/source.py +6 -0
- letta_client/types/step.py +1 -1
- letta_client/types/stop_reason_type.py +1 -0
- letta_client/types/terminal_tool_rule.py +1 -1
- letta_client/types/vector_db_provider.py +5 -0
- letta_client/voice/client.py +2 -8
- letta_client/voice/raw_client.py +0 -8
- {letta_client-0.1.319.dist-info → letta_client-0.1.320.dist-info}/METADATA +9 -9
- {letta_client-0.1.319.dist-info → letta_client-0.1.320.dist-info}/RECORD +211 -114
- /letta_client/{embedding_models → models/embeddings}/__init__.py +0 -0
- /letta_client/{messages → steps/metrics}/__init__.py +0 -0
- {letta_client-0.1.319.dist-info → letta_client-0.1.320.dist-info}/WHEEL +0 -0
|
@@ -16,6 +16,7 @@ from ..types.http_validation_error import HttpValidationError
|
|
|
16
16
|
from ..types.manager_type import ManagerType
|
|
17
17
|
from .types.group_create_manager_config import GroupCreateManagerConfig
|
|
18
18
|
from .types.group_update_manager_config import GroupUpdateManagerConfig
|
|
19
|
+
from .types.groups_list_request_order import GroupsListRequestOrder
|
|
19
20
|
|
|
20
21
|
# this is used as the default value for optional parameters
|
|
21
22
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -32,6 +33,8 @@ class RawGroupsClient:
|
|
|
32
33
|
before: typing.Optional[str] = None,
|
|
33
34
|
after: typing.Optional[str] = None,
|
|
34
35
|
limit: typing.Optional[int] = None,
|
|
36
|
+
order: typing.Optional[GroupsListRequestOrder] = None,
|
|
37
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
35
38
|
project_id: typing.Optional[str] = None,
|
|
36
39
|
request_options: typing.Optional[RequestOptions] = None,
|
|
37
40
|
) -> HttpResponse[typing.List[Group]]:
|
|
@@ -44,13 +47,19 @@ class RawGroupsClient:
|
|
|
44
47
|
Search groups by manager type
|
|
45
48
|
|
|
46
49
|
before : typing.Optional[str]
|
|
47
|
-
|
|
50
|
+
Group ID cursor for pagination. Returns groups that come before this group ID in the specified sort order
|
|
48
51
|
|
|
49
52
|
after : typing.Optional[str]
|
|
50
|
-
|
|
53
|
+
Group ID cursor for pagination. Returns groups that come after this group ID in the specified sort order
|
|
51
54
|
|
|
52
55
|
limit : typing.Optional[int]
|
|
53
|
-
|
|
56
|
+
Maximum number of groups to return
|
|
57
|
+
|
|
58
|
+
order : typing.Optional[GroupsListRequestOrder]
|
|
59
|
+
Sort order for groups by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
60
|
+
|
|
61
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
62
|
+
Field to sort by
|
|
54
63
|
|
|
55
64
|
project_id : typing.Optional[str]
|
|
56
65
|
Search groups by project id
|
|
@@ -71,6 +80,8 @@ class RawGroupsClient:
|
|
|
71
80
|
"before": before,
|
|
72
81
|
"after": after,
|
|
73
82
|
"limit": limit,
|
|
83
|
+
"order": order,
|
|
84
|
+
"order_by": order_by,
|
|
74
85
|
"project_id": project_id,
|
|
75
86
|
},
|
|
76
87
|
request_options=request_options,
|
|
@@ -430,6 +441,8 @@ class AsyncRawGroupsClient:
|
|
|
430
441
|
before: typing.Optional[str] = None,
|
|
431
442
|
after: typing.Optional[str] = None,
|
|
432
443
|
limit: typing.Optional[int] = None,
|
|
444
|
+
order: typing.Optional[GroupsListRequestOrder] = None,
|
|
445
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
433
446
|
project_id: typing.Optional[str] = None,
|
|
434
447
|
request_options: typing.Optional[RequestOptions] = None,
|
|
435
448
|
) -> AsyncHttpResponse[typing.List[Group]]:
|
|
@@ -442,13 +455,19 @@ class AsyncRawGroupsClient:
|
|
|
442
455
|
Search groups by manager type
|
|
443
456
|
|
|
444
457
|
before : typing.Optional[str]
|
|
445
|
-
|
|
458
|
+
Group ID cursor for pagination. Returns groups that come before this group ID in the specified sort order
|
|
446
459
|
|
|
447
460
|
after : typing.Optional[str]
|
|
448
|
-
|
|
461
|
+
Group ID cursor for pagination. Returns groups that come after this group ID in the specified sort order
|
|
449
462
|
|
|
450
463
|
limit : typing.Optional[int]
|
|
451
|
-
|
|
464
|
+
Maximum number of groups to return
|
|
465
|
+
|
|
466
|
+
order : typing.Optional[GroupsListRequestOrder]
|
|
467
|
+
Sort order for groups by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
468
|
+
|
|
469
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
470
|
+
Field to sort by
|
|
452
471
|
|
|
453
472
|
project_id : typing.Optional[str]
|
|
454
473
|
Search groups by project id
|
|
@@ -469,6 +488,8 @@ class AsyncRawGroupsClient:
|
|
|
469
488
|
"before": before,
|
|
470
489
|
"after": after,
|
|
471
490
|
"limit": limit,
|
|
491
|
+
"order": order,
|
|
492
|
+
"order_by": order_by,
|
|
472
493
|
"project_id": project_id,
|
|
473
494
|
},
|
|
474
495
|
request_options=request_options,
|
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
from .group_create_manager_config import GroupCreateManagerConfig
|
|
6
6
|
from .group_update_manager_config import GroupUpdateManagerConfig
|
|
7
|
+
from .groups_list_request_order import GroupsListRequestOrder
|
|
7
8
|
|
|
8
|
-
__all__ = ["GroupCreateManagerConfig", "GroupUpdateManagerConfig"]
|
|
9
|
+
__all__ = ["GroupCreateManagerConfig", "GroupUpdateManagerConfig", "GroupsListRequestOrder"]
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
|
-
from . import
|
|
5
|
+
from .types import IdentitiesListRequestOrder
|
|
6
|
+
from . import agents, blocks, properties
|
|
7
|
+
from .agents import AgentsListRequestOrder
|
|
8
|
+
from .blocks import BlocksListRequestOrder
|
|
6
9
|
|
|
7
|
-
__all__ = [
|
|
10
|
+
__all__ = [
|
|
11
|
+
"AgentsListRequestOrder",
|
|
12
|
+
"BlocksListRequestOrder",
|
|
13
|
+
"IdentitiesListRequestOrder",
|
|
14
|
+
"agents",
|
|
15
|
+
"blocks",
|
|
16
|
+
"properties",
|
|
17
|
+
]
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ...core.request_options import RequestOptions
|
|
7
|
+
from ...types.agent_state import AgentState
|
|
8
|
+
from .raw_client import AsyncRawAgentsClient, RawAgentsClient
|
|
9
|
+
from .types.agents_list_request_order import AgentsListRequestOrder
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AgentsClient:
|
|
13
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
14
|
+
self._raw_client = RawAgentsClient(client_wrapper=client_wrapper)
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def with_raw_response(self) -> RawAgentsClient:
|
|
18
|
+
"""
|
|
19
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
20
|
+
|
|
21
|
+
Returns
|
|
22
|
+
-------
|
|
23
|
+
RawAgentsClient
|
|
24
|
+
"""
|
|
25
|
+
return self._raw_client
|
|
26
|
+
|
|
27
|
+
def list(
|
|
28
|
+
self,
|
|
29
|
+
identity_id: str,
|
|
30
|
+
*,
|
|
31
|
+
before: typing.Optional[str] = None,
|
|
32
|
+
after: typing.Optional[str] = None,
|
|
33
|
+
limit: typing.Optional[int] = None,
|
|
34
|
+
order: typing.Optional[AgentsListRequestOrder] = None,
|
|
35
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
36
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
37
|
+
) -> typing.List[AgentState]:
|
|
38
|
+
"""
|
|
39
|
+
Get all agents associated with the specified identity.
|
|
40
|
+
|
|
41
|
+
Parameters
|
|
42
|
+
----------
|
|
43
|
+
identity_id : str
|
|
44
|
+
|
|
45
|
+
before : typing.Optional[str]
|
|
46
|
+
Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order
|
|
47
|
+
|
|
48
|
+
after : typing.Optional[str]
|
|
49
|
+
Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order
|
|
50
|
+
|
|
51
|
+
limit : typing.Optional[int]
|
|
52
|
+
Maximum number of agents to return
|
|
53
|
+
|
|
54
|
+
order : typing.Optional[AgentsListRequestOrder]
|
|
55
|
+
Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
56
|
+
|
|
57
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
58
|
+
Field to sort by
|
|
59
|
+
|
|
60
|
+
request_options : typing.Optional[RequestOptions]
|
|
61
|
+
Request-specific configuration.
|
|
62
|
+
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
typing.List[AgentState]
|
|
66
|
+
Successful Response
|
|
67
|
+
|
|
68
|
+
Examples
|
|
69
|
+
--------
|
|
70
|
+
from letta_client import Letta
|
|
71
|
+
|
|
72
|
+
client = Letta(
|
|
73
|
+
project="YOUR_PROJECT",
|
|
74
|
+
token="YOUR_TOKEN",
|
|
75
|
+
)
|
|
76
|
+
client.identities.agents.list(
|
|
77
|
+
identity_id="identity_id",
|
|
78
|
+
)
|
|
79
|
+
"""
|
|
80
|
+
_response = self._raw_client.list(
|
|
81
|
+
identity_id,
|
|
82
|
+
before=before,
|
|
83
|
+
after=after,
|
|
84
|
+
limit=limit,
|
|
85
|
+
order=order,
|
|
86
|
+
order_by=order_by,
|
|
87
|
+
request_options=request_options,
|
|
88
|
+
)
|
|
89
|
+
return _response.data
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class AsyncAgentsClient:
|
|
93
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
94
|
+
self._raw_client = AsyncRawAgentsClient(client_wrapper=client_wrapper)
|
|
95
|
+
|
|
96
|
+
@property
|
|
97
|
+
def with_raw_response(self) -> AsyncRawAgentsClient:
|
|
98
|
+
"""
|
|
99
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
100
|
+
|
|
101
|
+
Returns
|
|
102
|
+
-------
|
|
103
|
+
AsyncRawAgentsClient
|
|
104
|
+
"""
|
|
105
|
+
return self._raw_client
|
|
106
|
+
|
|
107
|
+
async def list(
|
|
108
|
+
self,
|
|
109
|
+
identity_id: str,
|
|
110
|
+
*,
|
|
111
|
+
before: typing.Optional[str] = None,
|
|
112
|
+
after: typing.Optional[str] = None,
|
|
113
|
+
limit: typing.Optional[int] = None,
|
|
114
|
+
order: typing.Optional[AgentsListRequestOrder] = None,
|
|
115
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
116
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
117
|
+
) -> typing.List[AgentState]:
|
|
118
|
+
"""
|
|
119
|
+
Get all agents associated with the specified identity.
|
|
120
|
+
|
|
121
|
+
Parameters
|
|
122
|
+
----------
|
|
123
|
+
identity_id : str
|
|
124
|
+
|
|
125
|
+
before : typing.Optional[str]
|
|
126
|
+
Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order
|
|
127
|
+
|
|
128
|
+
after : typing.Optional[str]
|
|
129
|
+
Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order
|
|
130
|
+
|
|
131
|
+
limit : typing.Optional[int]
|
|
132
|
+
Maximum number of agents to return
|
|
133
|
+
|
|
134
|
+
order : typing.Optional[AgentsListRequestOrder]
|
|
135
|
+
Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
136
|
+
|
|
137
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
138
|
+
Field to sort by
|
|
139
|
+
|
|
140
|
+
request_options : typing.Optional[RequestOptions]
|
|
141
|
+
Request-specific configuration.
|
|
142
|
+
|
|
143
|
+
Returns
|
|
144
|
+
-------
|
|
145
|
+
typing.List[AgentState]
|
|
146
|
+
Successful Response
|
|
147
|
+
|
|
148
|
+
Examples
|
|
149
|
+
--------
|
|
150
|
+
import asyncio
|
|
151
|
+
|
|
152
|
+
from letta_client import AsyncLetta
|
|
153
|
+
|
|
154
|
+
client = AsyncLetta(
|
|
155
|
+
project="YOUR_PROJECT",
|
|
156
|
+
token="YOUR_TOKEN",
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
async def main() -> None:
|
|
161
|
+
await client.identities.agents.list(
|
|
162
|
+
identity_id="identity_id",
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
asyncio.run(main())
|
|
167
|
+
"""
|
|
168
|
+
_response = await self._raw_client.list(
|
|
169
|
+
identity_id,
|
|
170
|
+
before=before,
|
|
171
|
+
after=after,
|
|
172
|
+
limit=limit,
|
|
173
|
+
order=order,
|
|
174
|
+
order_by=order_by,
|
|
175
|
+
request_options=request_options,
|
|
176
|
+
)
|
|
177
|
+
return _response.data
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ...core.api_error import ApiError
|
|
7
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ...core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ...core.jsonable_encoder import jsonable_encoder
|
|
10
|
+
from ...core.request_options import RequestOptions
|
|
11
|
+
from ...core.unchecked_base_model import construct_type
|
|
12
|
+
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
13
|
+
from ...types.agent_state import AgentState
|
|
14
|
+
from ...types.http_validation_error import HttpValidationError
|
|
15
|
+
from .types.agents_list_request_order import AgentsListRequestOrder
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class RawAgentsClient:
|
|
19
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
20
|
+
self._client_wrapper = client_wrapper
|
|
21
|
+
|
|
22
|
+
def list(
|
|
23
|
+
self,
|
|
24
|
+
identity_id: str,
|
|
25
|
+
*,
|
|
26
|
+
before: typing.Optional[str] = None,
|
|
27
|
+
after: typing.Optional[str] = None,
|
|
28
|
+
limit: typing.Optional[int] = None,
|
|
29
|
+
order: typing.Optional[AgentsListRequestOrder] = None,
|
|
30
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
31
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
32
|
+
) -> HttpResponse[typing.List[AgentState]]:
|
|
33
|
+
"""
|
|
34
|
+
Get all agents associated with the specified identity.
|
|
35
|
+
|
|
36
|
+
Parameters
|
|
37
|
+
----------
|
|
38
|
+
identity_id : str
|
|
39
|
+
|
|
40
|
+
before : typing.Optional[str]
|
|
41
|
+
Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order
|
|
42
|
+
|
|
43
|
+
after : typing.Optional[str]
|
|
44
|
+
Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order
|
|
45
|
+
|
|
46
|
+
limit : typing.Optional[int]
|
|
47
|
+
Maximum number of agents to return
|
|
48
|
+
|
|
49
|
+
order : typing.Optional[AgentsListRequestOrder]
|
|
50
|
+
Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
51
|
+
|
|
52
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
53
|
+
Field to sort by
|
|
54
|
+
|
|
55
|
+
request_options : typing.Optional[RequestOptions]
|
|
56
|
+
Request-specific configuration.
|
|
57
|
+
|
|
58
|
+
Returns
|
|
59
|
+
-------
|
|
60
|
+
HttpResponse[typing.List[AgentState]]
|
|
61
|
+
Successful Response
|
|
62
|
+
"""
|
|
63
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
64
|
+
f"v1/identities/{jsonable_encoder(identity_id)}/agents",
|
|
65
|
+
method="GET",
|
|
66
|
+
params={
|
|
67
|
+
"before": before,
|
|
68
|
+
"after": after,
|
|
69
|
+
"limit": limit,
|
|
70
|
+
"order": order,
|
|
71
|
+
"order_by": order_by,
|
|
72
|
+
},
|
|
73
|
+
request_options=request_options,
|
|
74
|
+
)
|
|
75
|
+
try:
|
|
76
|
+
if 200 <= _response.status_code < 300:
|
|
77
|
+
_data = typing.cast(
|
|
78
|
+
typing.List[AgentState],
|
|
79
|
+
construct_type(
|
|
80
|
+
type_=typing.List[AgentState], # type: ignore
|
|
81
|
+
object_=_response.json(),
|
|
82
|
+
),
|
|
83
|
+
)
|
|
84
|
+
return HttpResponse(response=_response, data=_data)
|
|
85
|
+
if _response.status_code == 422:
|
|
86
|
+
raise UnprocessableEntityError(
|
|
87
|
+
headers=dict(_response.headers),
|
|
88
|
+
body=typing.cast(
|
|
89
|
+
HttpValidationError,
|
|
90
|
+
construct_type(
|
|
91
|
+
type_=HttpValidationError, # type: ignore
|
|
92
|
+
object_=_response.json(),
|
|
93
|
+
),
|
|
94
|
+
),
|
|
95
|
+
)
|
|
96
|
+
_response_json = _response.json()
|
|
97
|
+
except JSONDecodeError:
|
|
98
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
99
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class AsyncRawAgentsClient:
|
|
103
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
104
|
+
self._client_wrapper = client_wrapper
|
|
105
|
+
|
|
106
|
+
async def list(
|
|
107
|
+
self,
|
|
108
|
+
identity_id: str,
|
|
109
|
+
*,
|
|
110
|
+
before: typing.Optional[str] = None,
|
|
111
|
+
after: typing.Optional[str] = None,
|
|
112
|
+
limit: typing.Optional[int] = None,
|
|
113
|
+
order: typing.Optional[AgentsListRequestOrder] = None,
|
|
114
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
115
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
116
|
+
) -> AsyncHttpResponse[typing.List[AgentState]]:
|
|
117
|
+
"""
|
|
118
|
+
Get all agents associated with the specified identity.
|
|
119
|
+
|
|
120
|
+
Parameters
|
|
121
|
+
----------
|
|
122
|
+
identity_id : str
|
|
123
|
+
|
|
124
|
+
before : typing.Optional[str]
|
|
125
|
+
Agent ID cursor for pagination. Returns agents that come before this agent ID in the specified sort order
|
|
126
|
+
|
|
127
|
+
after : typing.Optional[str]
|
|
128
|
+
Agent ID cursor for pagination. Returns agents that come after this agent ID in the specified sort order
|
|
129
|
+
|
|
130
|
+
limit : typing.Optional[int]
|
|
131
|
+
Maximum number of agents to return
|
|
132
|
+
|
|
133
|
+
order : typing.Optional[AgentsListRequestOrder]
|
|
134
|
+
Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
135
|
+
|
|
136
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
137
|
+
Field to sort by
|
|
138
|
+
|
|
139
|
+
request_options : typing.Optional[RequestOptions]
|
|
140
|
+
Request-specific configuration.
|
|
141
|
+
|
|
142
|
+
Returns
|
|
143
|
+
-------
|
|
144
|
+
AsyncHttpResponse[typing.List[AgentState]]
|
|
145
|
+
Successful Response
|
|
146
|
+
"""
|
|
147
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
148
|
+
f"v1/identities/{jsonable_encoder(identity_id)}/agents",
|
|
149
|
+
method="GET",
|
|
150
|
+
params={
|
|
151
|
+
"before": before,
|
|
152
|
+
"after": after,
|
|
153
|
+
"limit": limit,
|
|
154
|
+
"order": order,
|
|
155
|
+
"order_by": order_by,
|
|
156
|
+
},
|
|
157
|
+
request_options=request_options,
|
|
158
|
+
)
|
|
159
|
+
try:
|
|
160
|
+
if 200 <= _response.status_code < 300:
|
|
161
|
+
_data = typing.cast(
|
|
162
|
+
typing.List[AgentState],
|
|
163
|
+
construct_type(
|
|
164
|
+
type_=typing.List[AgentState], # type: ignore
|
|
165
|
+
object_=_response.json(),
|
|
166
|
+
),
|
|
167
|
+
)
|
|
168
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
169
|
+
if _response.status_code == 422:
|
|
170
|
+
raise UnprocessableEntityError(
|
|
171
|
+
headers=dict(_response.headers),
|
|
172
|
+
body=typing.cast(
|
|
173
|
+
HttpValidationError,
|
|
174
|
+
construct_type(
|
|
175
|
+
type_=HttpValidationError, # type: ignore
|
|
176
|
+
object_=_response.json(),
|
|
177
|
+
),
|
|
178
|
+
),
|
|
179
|
+
)
|
|
180
|
+
_response_json = _response.json()
|
|
181
|
+
except JSONDecodeError:
|
|
182
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
183
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ...core.request_options import RequestOptions
|
|
7
|
+
from ...types.block import Block
|
|
8
|
+
from .raw_client import AsyncRawBlocksClient, RawBlocksClient
|
|
9
|
+
from .types.blocks_list_request_order import BlocksListRequestOrder
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class BlocksClient:
|
|
13
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
14
|
+
self._raw_client = RawBlocksClient(client_wrapper=client_wrapper)
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def with_raw_response(self) -> RawBlocksClient:
|
|
18
|
+
"""
|
|
19
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
20
|
+
|
|
21
|
+
Returns
|
|
22
|
+
-------
|
|
23
|
+
RawBlocksClient
|
|
24
|
+
"""
|
|
25
|
+
return self._raw_client
|
|
26
|
+
|
|
27
|
+
def list(
|
|
28
|
+
self,
|
|
29
|
+
identity_id: str,
|
|
30
|
+
*,
|
|
31
|
+
before: typing.Optional[str] = None,
|
|
32
|
+
after: typing.Optional[str] = None,
|
|
33
|
+
limit: typing.Optional[int] = None,
|
|
34
|
+
order: typing.Optional[BlocksListRequestOrder] = None,
|
|
35
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
36
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
37
|
+
) -> typing.List[Block]:
|
|
38
|
+
"""
|
|
39
|
+
Get all blocks associated with the specified identity.
|
|
40
|
+
|
|
41
|
+
Parameters
|
|
42
|
+
----------
|
|
43
|
+
identity_id : str
|
|
44
|
+
|
|
45
|
+
before : typing.Optional[str]
|
|
46
|
+
Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order
|
|
47
|
+
|
|
48
|
+
after : typing.Optional[str]
|
|
49
|
+
Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order
|
|
50
|
+
|
|
51
|
+
limit : typing.Optional[int]
|
|
52
|
+
Maximum number of blocks to return
|
|
53
|
+
|
|
54
|
+
order : typing.Optional[BlocksListRequestOrder]
|
|
55
|
+
Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
56
|
+
|
|
57
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
58
|
+
Field to sort by
|
|
59
|
+
|
|
60
|
+
request_options : typing.Optional[RequestOptions]
|
|
61
|
+
Request-specific configuration.
|
|
62
|
+
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
typing.List[Block]
|
|
66
|
+
Successful Response
|
|
67
|
+
|
|
68
|
+
Examples
|
|
69
|
+
--------
|
|
70
|
+
from letta_client import Letta
|
|
71
|
+
|
|
72
|
+
client = Letta(
|
|
73
|
+
project="YOUR_PROJECT",
|
|
74
|
+
token="YOUR_TOKEN",
|
|
75
|
+
)
|
|
76
|
+
client.identities.blocks.list(
|
|
77
|
+
identity_id="identity_id",
|
|
78
|
+
)
|
|
79
|
+
"""
|
|
80
|
+
_response = self._raw_client.list(
|
|
81
|
+
identity_id,
|
|
82
|
+
before=before,
|
|
83
|
+
after=after,
|
|
84
|
+
limit=limit,
|
|
85
|
+
order=order,
|
|
86
|
+
order_by=order_by,
|
|
87
|
+
request_options=request_options,
|
|
88
|
+
)
|
|
89
|
+
return _response.data
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class AsyncBlocksClient:
|
|
93
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
94
|
+
self._raw_client = AsyncRawBlocksClient(client_wrapper=client_wrapper)
|
|
95
|
+
|
|
96
|
+
@property
|
|
97
|
+
def with_raw_response(self) -> AsyncRawBlocksClient:
|
|
98
|
+
"""
|
|
99
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
100
|
+
|
|
101
|
+
Returns
|
|
102
|
+
-------
|
|
103
|
+
AsyncRawBlocksClient
|
|
104
|
+
"""
|
|
105
|
+
return self._raw_client
|
|
106
|
+
|
|
107
|
+
async def list(
|
|
108
|
+
self,
|
|
109
|
+
identity_id: str,
|
|
110
|
+
*,
|
|
111
|
+
before: typing.Optional[str] = None,
|
|
112
|
+
after: typing.Optional[str] = None,
|
|
113
|
+
limit: typing.Optional[int] = None,
|
|
114
|
+
order: typing.Optional[BlocksListRequestOrder] = None,
|
|
115
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
116
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
117
|
+
) -> typing.List[Block]:
|
|
118
|
+
"""
|
|
119
|
+
Get all blocks associated with the specified identity.
|
|
120
|
+
|
|
121
|
+
Parameters
|
|
122
|
+
----------
|
|
123
|
+
identity_id : str
|
|
124
|
+
|
|
125
|
+
before : typing.Optional[str]
|
|
126
|
+
Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order
|
|
127
|
+
|
|
128
|
+
after : typing.Optional[str]
|
|
129
|
+
Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order
|
|
130
|
+
|
|
131
|
+
limit : typing.Optional[int]
|
|
132
|
+
Maximum number of blocks to return
|
|
133
|
+
|
|
134
|
+
order : typing.Optional[BlocksListRequestOrder]
|
|
135
|
+
Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
136
|
+
|
|
137
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
138
|
+
Field to sort by
|
|
139
|
+
|
|
140
|
+
request_options : typing.Optional[RequestOptions]
|
|
141
|
+
Request-specific configuration.
|
|
142
|
+
|
|
143
|
+
Returns
|
|
144
|
+
-------
|
|
145
|
+
typing.List[Block]
|
|
146
|
+
Successful Response
|
|
147
|
+
|
|
148
|
+
Examples
|
|
149
|
+
--------
|
|
150
|
+
import asyncio
|
|
151
|
+
|
|
152
|
+
from letta_client import AsyncLetta
|
|
153
|
+
|
|
154
|
+
client = AsyncLetta(
|
|
155
|
+
project="YOUR_PROJECT",
|
|
156
|
+
token="YOUR_TOKEN",
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
async def main() -> None:
|
|
161
|
+
await client.identities.blocks.list(
|
|
162
|
+
identity_id="identity_id",
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
asyncio.run(main())
|
|
167
|
+
"""
|
|
168
|
+
_response = await self._raw_client.list(
|
|
169
|
+
identity_id,
|
|
170
|
+
before=before,
|
|
171
|
+
after=after,
|
|
172
|
+
limit=limit,
|
|
173
|
+
order=order,
|
|
174
|
+
order_by=order_by,
|
|
175
|
+
request_options=request_options,
|
|
176
|
+
)
|
|
177
|
+
return _response.data
|