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
|
@@ -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.block import Block
|
|
14
|
+
from ...types.http_validation_error import HttpValidationError
|
|
15
|
+
from .types.blocks_list_request_order import BlocksListRequestOrder
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class RawBlocksClient:
|
|
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[BlocksListRequestOrder] = None,
|
|
30
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
31
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
32
|
+
) -> HttpResponse[typing.List[Block]]:
|
|
33
|
+
"""
|
|
34
|
+
Get all blocks associated with the specified identity.
|
|
35
|
+
|
|
36
|
+
Parameters
|
|
37
|
+
----------
|
|
38
|
+
identity_id : str
|
|
39
|
+
|
|
40
|
+
before : typing.Optional[str]
|
|
41
|
+
Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order
|
|
42
|
+
|
|
43
|
+
after : typing.Optional[str]
|
|
44
|
+
Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order
|
|
45
|
+
|
|
46
|
+
limit : typing.Optional[int]
|
|
47
|
+
Maximum number of blocks to return
|
|
48
|
+
|
|
49
|
+
order : typing.Optional[BlocksListRequestOrder]
|
|
50
|
+
Sort order for blocks 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[Block]]
|
|
61
|
+
Successful Response
|
|
62
|
+
"""
|
|
63
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
64
|
+
f"v1/identities/{jsonable_encoder(identity_id)}/blocks",
|
|
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[Block],
|
|
79
|
+
construct_type(
|
|
80
|
+
type_=typing.List[Block], # 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 AsyncRawBlocksClient:
|
|
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[BlocksListRequestOrder] = None,
|
|
114
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
115
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
116
|
+
) -> AsyncHttpResponse[typing.List[Block]]:
|
|
117
|
+
"""
|
|
118
|
+
Get all blocks associated with the specified identity.
|
|
119
|
+
|
|
120
|
+
Parameters
|
|
121
|
+
----------
|
|
122
|
+
identity_id : str
|
|
123
|
+
|
|
124
|
+
before : typing.Optional[str]
|
|
125
|
+
Block ID cursor for pagination. Returns blocks that come before this block ID in the specified sort order
|
|
126
|
+
|
|
127
|
+
after : typing.Optional[str]
|
|
128
|
+
Block ID cursor for pagination. Returns blocks that come after this block ID in the specified sort order
|
|
129
|
+
|
|
130
|
+
limit : typing.Optional[int]
|
|
131
|
+
Maximum number of blocks to return
|
|
132
|
+
|
|
133
|
+
order : typing.Optional[BlocksListRequestOrder]
|
|
134
|
+
Sort order for blocks 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[Block]]
|
|
145
|
+
Successful Response
|
|
146
|
+
"""
|
|
147
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
148
|
+
f"v1/identities/{jsonable_encoder(identity_id)}/blocks",
|
|
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[Block],
|
|
163
|
+
construct_type(
|
|
164
|
+
type_=typing.List[Block], # 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)
|
|
@@ -7,8 +7,11 @@ from ..core.request_options import RequestOptions
|
|
|
7
7
|
from ..types.identity import Identity
|
|
8
8
|
from ..types.identity_property import IdentityProperty
|
|
9
9
|
from ..types.identity_type import IdentityType
|
|
10
|
+
from .agents.client import AgentsClient, AsyncAgentsClient
|
|
11
|
+
from .blocks.client import AsyncBlocksClient, BlocksClient
|
|
10
12
|
from .properties.client import AsyncPropertiesClient, PropertiesClient
|
|
11
13
|
from .raw_client import AsyncRawIdentitiesClient, RawIdentitiesClient
|
|
14
|
+
from .types.identities_list_request_order import IdentitiesListRequestOrder
|
|
12
15
|
|
|
13
16
|
# this is used as the default value for optional parameters
|
|
14
17
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -19,6 +22,10 @@ class IdentitiesClient:
|
|
|
19
22
|
self._raw_client = RawIdentitiesClient(client_wrapper=client_wrapper)
|
|
20
23
|
self.properties = PropertiesClient(client_wrapper=client_wrapper)
|
|
21
24
|
|
|
25
|
+
self.agents = AgentsClient(client_wrapper=client_wrapper)
|
|
26
|
+
|
|
27
|
+
self.blocks = BlocksClient(client_wrapper=client_wrapper)
|
|
28
|
+
|
|
22
29
|
@property
|
|
23
30
|
def with_raw_response(self) -> RawIdentitiesClient:
|
|
24
31
|
"""
|
|
@@ -40,6 +47,8 @@ class IdentitiesClient:
|
|
|
40
47
|
before: typing.Optional[str] = None,
|
|
41
48
|
after: typing.Optional[str] = None,
|
|
42
49
|
limit: typing.Optional[int] = None,
|
|
50
|
+
order: typing.Optional[IdentitiesListRequestOrder] = None,
|
|
51
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
43
52
|
request_options: typing.Optional[RequestOptions] = None,
|
|
44
53
|
) -> typing.List[Identity]:
|
|
45
54
|
"""
|
|
@@ -56,10 +65,19 @@ class IdentitiesClient:
|
|
|
56
65
|
identity_type : typing.Optional[IdentityType]
|
|
57
66
|
|
|
58
67
|
before : typing.Optional[str]
|
|
68
|
+
Identity ID cursor for pagination. Returns identities that come before this identity ID in the specified sort order
|
|
59
69
|
|
|
60
70
|
after : typing.Optional[str]
|
|
71
|
+
Identity ID cursor for pagination. Returns identities that come after this identity ID in the specified sort order
|
|
61
72
|
|
|
62
73
|
limit : typing.Optional[int]
|
|
74
|
+
Maximum number of identities to return
|
|
75
|
+
|
|
76
|
+
order : typing.Optional[IdentitiesListRequestOrder]
|
|
77
|
+
Sort order for identities by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
78
|
+
|
|
79
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
80
|
+
Field to sort by
|
|
63
81
|
|
|
64
82
|
request_options : typing.Optional[RequestOptions]
|
|
65
83
|
Request-specific configuration.
|
|
@@ -87,6 +105,8 @@ class IdentitiesClient:
|
|
|
87
105
|
before=before,
|
|
88
106
|
after=after,
|
|
89
107
|
limit=limit,
|
|
108
|
+
order=order,
|
|
109
|
+
order_by=order_by,
|
|
90
110
|
request_options=request_options,
|
|
91
111
|
)
|
|
92
112
|
return _response.data
|
|
@@ -393,6 +413,10 @@ class AsyncIdentitiesClient:
|
|
|
393
413
|
self._raw_client = AsyncRawIdentitiesClient(client_wrapper=client_wrapper)
|
|
394
414
|
self.properties = AsyncPropertiesClient(client_wrapper=client_wrapper)
|
|
395
415
|
|
|
416
|
+
self.agents = AsyncAgentsClient(client_wrapper=client_wrapper)
|
|
417
|
+
|
|
418
|
+
self.blocks = AsyncBlocksClient(client_wrapper=client_wrapper)
|
|
419
|
+
|
|
396
420
|
@property
|
|
397
421
|
def with_raw_response(self) -> AsyncRawIdentitiesClient:
|
|
398
422
|
"""
|
|
@@ -414,6 +438,8 @@ class AsyncIdentitiesClient:
|
|
|
414
438
|
before: typing.Optional[str] = None,
|
|
415
439
|
after: typing.Optional[str] = None,
|
|
416
440
|
limit: typing.Optional[int] = None,
|
|
441
|
+
order: typing.Optional[IdentitiesListRequestOrder] = None,
|
|
442
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
417
443
|
request_options: typing.Optional[RequestOptions] = None,
|
|
418
444
|
) -> typing.List[Identity]:
|
|
419
445
|
"""
|
|
@@ -430,10 +456,19 @@ class AsyncIdentitiesClient:
|
|
|
430
456
|
identity_type : typing.Optional[IdentityType]
|
|
431
457
|
|
|
432
458
|
before : typing.Optional[str]
|
|
459
|
+
Identity ID cursor for pagination. Returns identities that come before this identity ID in the specified sort order
|
|
433
460
|
|
|
434
461
|
after : typing.Optional[str]
|
|
462
|
+
Identity ID cursor for pagination. Returns identities that come after this identity ID in the specified sort order
|
|
435
463
|
|
|
436
464
|
limit : typing.Optional[int]
|
|
465
|
+
Maximum number of identities to return
|
|
466
|
+
|
|
467
|
+
order : typing.Optional[IdentitiesListRequestOrder]
|
|
468
|
+
Sort order for identities by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
469
|
+
|
|
470
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
471
|
+
Field to sort by
|
|
437
472
|
|
|
438
473
|
request_options : typing.Optional[RequestOptions]
|
|
439
474
|
Request-specific configuration.
|
|
@@ -469,6 +504,8 @@ class AsyncIdentitiesClient:
|
|
|
469
504
|
before=before,
|
|
470
505
|
after=after,
|
|
471
506
|
limit=limit,
|
|
507
|
+
order=order,
|
|
508
|
+
order_by=order_by,
|
|
472
509
|
request_options=request_options,
|
|
473
510
|
)
|
|
474
511
|
return _response.data
|
|
@@ -15,6 +15,7 @@ from ..types.http_validation_error import HttpValidationError
|
|
|
15
15
|
from ..types.identity import Identity
|
|
16
16
|
from ..types.identity_property import IdentityProperty
|
|
17
17
|
from ..types.identity_type import IdentityType
|
|
18
|
+
from .types.identities_list_request_order import IdentitiesListRequestOrder
|
|
18
19
|
|
|
19
20
|
# this is used as the default value for optional parameters
|
|
20
21
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -34,6 +35,8 @@ class RawIdentitiesClient:
|
|
|
34
35
|
before: typing.Optional[str] = None,
|
|
35
36
|
after: typing.Optional[str] = None,
|
|
36
37
|
limit: typing.Optional[int] = None,
|
|
38
|
+
order: typing.Optional[IdentitiesListRequestOrder] = None,
|
|
39
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
37
40
|
request_options: typing.Optional[RequestOptions] = None,
|
|
38
41
|
) -> HttpResponse[typing.List[Identity]]:
|
|
39
42
|
"""
|
|
@@ -50,10 +53,19 @@ class RawIdentitiesClient:
|
|
|
50
53
|
identity_type : typing.Optional[IdentityType]
|
|
51
54
|
|
|
52
55
|
before : typing.Optional[str]
|
|
56
|
+
Identity ID cursor for pagination. Returns identities that come before this identity ID in the specified sort order
|
|
53
57
|
|
|
54
58
|
after : typing.Optional[str]
|
|
59
|
+
Identity ID cursor for pagination. Returns identities that come after this identity ID in the specified sort order
|
|
55
60
|
|
|
56
61
|
limit : typing.Optional[int]
|
|
62
|
+
Maximum number of identities to return
|
|
63
|
+
|
|
64
|
+
order : typing.Optional[IdentitiesListRequestOrder]
|
|
65
|
+
Sort order for identities by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
66
|
+
|
|
67
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
68
|
+
Field to sort by
|
|
57
69
|
|
|
58
70
|
request_options : typing.Optional[RequestOptions]
|
|
59
71
|
Request-specific configuration.
|
|
@@ -74,6 +86,8 @@ class RawIdentitiesClient:
|
|
|
74
86
|
"before": before,
|
|
75
87
|
"after": after,
|
|
76
88
|
"limit": limit,
|
|
89
|
+
"order": order,
|
|
90
|
+
"order_by": order_by,
|
|
77
91
|
},
|
|
78
92
|
request_options=request_options,
|
|
79
93
|
)
|
|
@@ -529,6 +543,8 @@ class AsyncRawIdentitiesClient:
|
|
|
529
543
|
before: typing.Optional[str] = None,
|
|
530
544
|
after: typing.Optional[str] = None,
|
|
531
545
|
limit: typing.Optional[int] = None,
|
|
546
|
+
order: typing.Optional[IdentitiesListRequestOrder] = None,
|
|
547
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
532
548
|
request_options: typing.Optional[RequestOptions] = None,
|
|
533
549
|
) -> AsyncHttpResponse[typing.List[Identity]]:
|
|
534
550
|
"""
|
|
@@ -545,10 +561,19 @@ class AsyncRawIdentitiesClient:
|
|
|
545
561
|
identity_type : typing.Optional[IdentityType]
|
|
546
562
|
|
|
547
563
|
before : typing.Optional[str]
|
|
564
|
+
Identity ID cursor for pagination. Returns identities that come before this identity ID in the specified sort order
|
|
548
565
|
|
|
549
566
|
after : typing.Optional[str]
|
|
567
|
+
Identity ID cursor for pagination. Returns identities that come after this identity ID in the specified sort order
|
|
550
568
|
|
|
551
569
|
limit : typing.Optional[int]
|
|
570
|
+
Maximum number of identities to return
|
|
571
|
+
|
|
572
|
+
order : typing.Optional[IdentitiesListRequestOrder]
|
|
573
|
+
Sort order for identities by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
574
|
+
|
|
575
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
576
|
+
Field to sort by
|
|
552
577
|
|
|
553
578
|
request_options : typing.Optional[RequestOptions]
|
|
554
579
|
Request-specific configuration.
|
|
@@ -569,6 +594,8 @@ class AsyncRawIdentitiesClient:
|
|
|
569
594
|
"before": before,
|
|
570
595
|
"after": after,
|
|
571
596
|
"limit": limit,
|
|
597
|
+
"order": order,
|
|
598
|
+
"order_by": order_by,
|
|
572
599
|
},
|
|
573
600
|
request_options=request_options,
|
|
574
601
|
)
|
letta_client/jobs/client.py
CHANGED
|
@@ -30,12 +30,12 @@ class JobsClient:
|
|
|
30
30
|
before: typing.Optional[str] = None,
|
|
31
31
|
after: typing.Optional[str] = None,
|
|
32
32
|
limit: typing.Optional[int] = None,
|
|
33
|
+
active: typing.Optional[bool] = None,
|
|
33
34
|
ascending: typing.Optional[bool] = None,
|
|
34
35
|
request_options: typing.Optional[RequestOptions] = None,
|
|
35
36
|
) -> typing.List[Job]:
|
|
36
37
|
"""
|
|
37
38
|
List all jobs.
|
|
38
|
-
TODO (cliandy): implementation for pagination
|
|
39
39
|
|
|
40
40
|
Parameters
|
|
41
41
|
----------
|
|
@@ -51,6 +51,9 @@ class JobsClient:
|
|
|
51
51
|
limit : typing.Optional[int]
|
|
52
52
|
Limit for pagination
|
|
53
53
|
|
|
54
|
+
active : typing.Optional[bool]
|
|
55
|
+
Filter for active jobs.
|
|
56
|
+
|
|
54
57
|
ascending : typing.Optional[bool]
|
|
55
58
|
Whether to sort jobs oldest to newest (True, default) or newest to oldest (False)
|
|
56
59
|
|
|
@@ -77,6 +80,7 @@ class JobsClient:
|
|
|
77
80
|
before=before,
|
|
78
81
|
after=after,
|
|
79
82
|
limit=limit,
|
|
83
|
+
active=active,
|
|
80
84
|
ascending=ascending,
|
|
81
85
|
request_options=request_options,
|
|
82
86
|
)
|
|
@@ -259,12 +263,12 @@ class AsyncJobsClient:
|
|
|
259
263
|
before: typing.Optional[str] = None,
|
|
260
264
|
after: typing.Optional[str] = None,
|
|
261
265
|
limit: typing.Optional[int] = None,
|
|
266
|
+
active: typing.Optional[bool] = None,
|
|
262
267
|
ascending: typing.Optional[bool] = None,
|
|
263
268
|
request_options: typing.Optional[RequestOptions] = None,
|
|
264
269
|
) -> typing.List[Job]:
|
|
265
270
|
"""
|
|
266
271
|
List all jobs.
|
|
267
|
-
TODO (cliandy): implementation for pagination
|
|
268
272
|
|
|
269
273
|
Parameters
|
|
270
274
|
----------
|
|
@@ -280,6 +284,9 @@ class AsyncJobsClient:
|
|
|
280
284
|
limit : typing.Optional[int]
|
|
281
285
|
Limit for pagination
|
|
282
286
|
|
|
287
|
+
active : typing.Optional[bool]
|
|
288
|
+
Filter for active jobs.
|
|
289
|
+
|
|
283
290
|
ascending : typing.Optional[bool]
|
|
284
291
|
Whether to sort jobs oldest to newest (True, default) or newest to oldest (False)
|
|
285
292
|
|
|
@@ -314,6 +321,7 @@ class AsyncJobsClient:
|
|
|
314
321
|
before=before,
|
|
315
322
|
after=after,
|
|
316
323
|
limit=limit,
|
|
324
|
+
active=active,
|
|
317
325
|
ascending=ascending,
|
|
318
326
|
request_options=request_options,
|
|
319
327
|
)
|
letta_client/jobs/raw_client.py
CHANGED
|
@@ -25,12 +25,12 @@ class RawJobsClient:
|
|
|
25
25
|
before: typing.Optional[str] = None,
|
|
26
26
|
after: typing.Optional[str] = None,
|
|
27
27
|
limit: typing.Optional[int] = None,
|
|
28
|
+
active: typing.Optional[bool] = None,
|
|
28
29
|
ascending: typing.Optional[bool] = None,
|
|
29
30
|
request_options: typing.Optional[RequestOptions] = None,
|
|
30
31
|
) -> HttpResponse[typing.List[Job]]:
|
|
31
32
|
"""
|
|
32
33
|
List all jobs.
|
|
33
|
-
TODO (cliandy): implementation for pagination
|
|
34
34
|
|
|
35
35
|
Parameters
|
|
36
36
|
----------
|
|
@@ -46,6 +46,9 @@ class RawJobsClient:
|
|
|
46
46
|
limit : typing.Optional[int]
|
|
47
47
|
Limit for pagination
|
|
48
48
|
|
|
49
|
+
active : typing.Optional[bool]
|
|
50
|
+
Filter for active jobs.
|
|
51
|
+
|
|
49
52
|
ascending : typing.Optional[bool]
|
|
50
53
|
Whether to sort jobs oldest to newest (True, default) or newest to oldest (False)
|
|
51
54
|
|
|
@@ -65,6 +68,7 @@ class RawJobsClient:
|
|
|
65
68
|
"before": before,
|
|
66
69
|
"after": after,
|
|
67
70
|
"limit": limit,
|
|
71
|
+
"active": active,
|
|
68
72
|
"ascending": ascending,
|
|
69
73
|
},
|
|
70
74
|
request_options=request_options,
|
|
@@ -327,12 +331,12 @@ class AsyncRawJobsClient:
|
|
|
327
331
|
before: typing.Optional[str] = None,
|
|
328
332
|
after: typing.Optional[str] = None,
|
|
329
333
|
limit: typing.Optional[int] = None,
|
|
334
|
+
active: typing.Optional[bool] = None,
|
|
330
335
|
ascending: typing.Optional[bool] = None,
|
|
331
336
|
request_options: typing.Optional[RequestOptions] = None,
|
|
332
337
|
) -> AsyncHttpResponse[typing.List[Job]]:
|
|
333
338
|
"""
|
|
334
339
|
List all jobs.
|
|
335
|
-
TODO (cliandy): implementation for pagination
|
|
336
340
|
|
|
337
341
|
Parameters
|
|
338
342
|
----------
|
|
@@ -348,6 +352,9 @@ class AsyncRawJobsClient:
|
|
|
348
352
|
limit : typing.Optional[int]
|
|
349
353
|
Limit for pagination
|
|
350
354
|
|
|
355
|
+
active : typing.Optional[bool]
|
|
356
|
+
Filter for active jobs.
|
|
357
|
+
|
|
351
358
|
ascending : typing.Optional[bool]
|
|
352
359
|
Whether to sort jobs oldest to newest (True, default) or newest to oldest (False)
|
|
353
360
|
|
|
@@ -367,6 +374,7 @@ class AsyncRawJobsClient:
|
|
|
367
374
|
"before": before,
|
|
368
375
|
"after": after,
|
|
369
376
|
"limit": limit,
|
|
377
|
+
"active": active,
|
|
370
378
|
"ascending": ascending,
|
|
371
379
|
},
|
|
372
380
|
request_options=request_options,
|
letta_client/models/__init__.py
CHANGED
letta_client/models/client.py
CHANGED
|
@@ -7,12 +7,14 @@ from ..core.request_options import RequestOptions
|
|
|
7
7
|
from ..types.llm_config import LlmConfig
|
|
8
8
|
from ..types.provider_category import ProviderCategory
|
|
9
9
|
from ..types.provider_type import ProviderType
|
|
10
|
+
from .embeddings.client import AsyncEmbeddingsClient, EmbeddingsClient
|
|
10
11
|
from .raw_client import AsyncRawModelsClient, RawModelsClient
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class ModelsClient:
|
|
14
15
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
15
16
|
self._raw_client = RawModelsClient(client_wrapper=client_wrapper)
|
|
17
|
+
self.embeddings = EmbeddingsClient(client_wrapper=client_wrapper)
|
|
16
18
|
|
|
17
19
|
@property
|
|
18
20
|
def with_raw_response(self) -> RawModelsClient:
|
|
@@ -98,6 +100,7 @@ class ModelsClient:
|
|
|
98
100
|
class AsyncModelsClient:
|
|
99
101
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
100
102
|
self._raw_client = AsyncRawModelsClient(client_wrapper=client_wrapper)
|
|
103
|
+
self.embeddings = AsyncEmbeddingsClient(client_wrapper=client_wrapper)
|
|
101
104
|
|
|
102
105
|
@property
|
|
103
106
|
def with_raw_response(self) -> AsyncRawModelsClient:
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from .raw_client import
|
|
5
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ...core.request_options import RequestOptions
|
|
7
|
+
from ...types.embedding_config import EmbeddingConfig
|
|
8
|
+
from .raw_client import AsyncRawEmbeddingsClient, RawEmbeddingsClient
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
11
|
+
class EmbeddingsClient:
|
|
12
12
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
13
|
-
self._raw_client =
|
|
13
|
+
self._raw_client = RawEmbeddingsClient(client_wrapper=client_wrapper)
|
|
14
14
|
|
|
15
15
|
@property
|
|
16
|
-
def with_raw_response(self) ->
|
|
16
|
+
def with_raw_response(self) -> RawEmbeddingsClient:
|
|
17
17
|
"""
|
|
18
18
|
Retrieves a raw implementation of this client that returns raw responses.
|
|
19
19
|
|
|
20
20
|
Returns
|
|
21
21
|
-------
|
|
22
|
-
|
|
22
|
+
RawEmbeddingsClient
|
|
23
23
|
"""
|
|
24
24
|
return self._raw_client
|
|
25
25
|
|
|
@@ -45,24 +45,24 @@ class EmbeddingModelsClient:
|
|
|
45
45
|
project="YOUR_PROJECT",
|
|
46
46
|
token="YOUR_TOKEN",
|
|
47
47
|
)
|
|
48
|
-
client.
|
|
48
|
+
client.models.embeddings.list()
|
|
49
49
|
"""
|
|
50
50
|
_response = self._raw_client.list(request_options=request_options)
|
|
51
51
|
return _response.data
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
class
|
|
54
|
+
class AsyncEmbeddingsClient:
|
|
55
55
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
56
|
-
self._raw_client =
|
|
56
|
+
self._raw_client = AsyncRawEmbeddingsClient(client_wrapper=client_wrapper)
|
|
57
57
|
|
|
58
58
|
@property
|
|
59
|
-
def with_raw_response(self) ->
|
|
59
|
+
def with_raw_response(self) -> AsyncRawEmbeddingsClient:
|
|
60
60
|
"""
|
|
61
61
|
Retrieves a raw implementation of this client that returns raw responses.
|
|
62
62
|
|
|
63
63
|
Returns
|
|
64
64
|
-------
|
|
65
|
-
|
|
65
|
+
AsyncRawEmbeddingsClient
|
|
66
66
|
"""
|
|
67
67
|
return self._raw_client
|
|
68
68
|
|
|
@@ -93,7 +93,7 @@ class AsyncEmbeddingModelsClient:
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
async def main() -> None:
|
|
96
|
-
await client.
|
|
96
|
+
await client.models.embeddings.list()
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
asyncio.run(main())
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
from json.decoder import JSONDecodeError
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
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.request_options import RequestOptions
|
|
10
|
+
from ...core.unchecked_base_model import construct_type
|
|
11
|
+
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
12
|
+
from ...types.embedding_config import EmbeddingConfig
|
|
13
|
+
from ...types.http_validation_error import HttpValidationError
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
class
|
|
16
|
+
class RawEmbeddingsClient:
|
|
17
17
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
18
18
|
self._client_wrapper = client_wrapper
|
|
19
19
|
|
|
@@ -65,7 +65,7 @@ class RawEmbeddingModelsClient:
|
|
|
65
65
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
class
|
|
68
|
+
class AsyncRawEmbeddingsClient:
|
|
69
69
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
70
70
|
self._client_wrapper = client_wrapper
|
|
71
71
|
|