letta-client 1.0.0a1__py3-none-any.whl → 1.0.0a3__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 +149 -23
- letta_client/agents/__init__.py +15 -17
- letta_client/agents/blocks/__init__.py +3 -0
- letta_client/agents/blocks/client.py +77 -4
- letta_client/agents/blocks/raw_client.py +63 -2
- letta_client/agents/blocks/types/__init__.py +7 -0
- letta_client/agents/blocks/types/blocks_list_request_order.py +5 -0
- letta_client/agents/client.py +46 -13
- letta_client/agents/files/__init__.py +3 -0
- letta_client/agents/files/client.py +71 -10
- letta_client/agents/files/raw_client.py +51 -10
- letta_client/agents/files/types/__init__.py +7 -0
- letta_client/{types/tool_return_status.py → agents/files/types/files_list_request_order.py} +1 -1
- letta_client/agents/folders/__init__.py +3 -0
- letta_client/agents/folders/client.py +77 -4
- letta_client/agents/folders/raw_client.py +63 -2
- letta_client/agents/folders/types/__init__.py +7 -0
- letta_client/agents/folders/types/folders_list_request_order.py +5 -0
- letta_client/agents/groups/__init__.py +3 -0
- letta_client/agents/groups/client.py +71 -2
- letta_client/agents/groups/raw_client.py +51 -0
- letta_client/agents/groups/types/__init__.py +7 -0
- letta_client/agents/groups/types/groups_list_request_order.py +5 -0
- letta_client/agents/messages/__init__.py +2 -0
- letta_client/agents/messages/client.py +55 -14
- letta_client/agents/messages/raw_client.py +35 -14
- letta_client/agents/messages/types/__init__.py +2 -0
- letta_client/agents/messages/types/messages_list_request_order.py +5 -0
- letta_client/agents/passages/client.py +29 -0
- letta_client/agents/raw_client.py +4 -4
- letta_client/agents/sources/__init__.py +3 -0
- letta_client/agents/sources/client.py +77 -4
- letta_client/agents/sources/raw_client.py +63 -2
- letta_client/agents/sources/types/__init__.py +7 -0
- letta_client/agents/sources/types/sources_list_request_order.py +5 -0
- letta_client/agents/tools/__init__.py +3 -0
- letta_client/agents/tools/client.py +77 -4
- letta_client/agents/tools/raw_client.py +63 -2
- letta_client/agents/tools/types/__init__.py +7 -0
- letta_client/agents/tools/types/tools_list_request_order.py +5 -0
- letta_client/archives/client.py +16 -2
- letta_client/base_client.py +3 -0
- letta_client/batches/client.py +12 -2
- letta_client/batches/messages/client.py +10 -0
- letta_client/blocks/agents/client.py +8 -0
- letta_client/blocks/client.py +32 -2
- letta_client/chat/__init__.py +7 -0
- letta_client/chat/client.py +255 -0
- letta_client/chat/raw_client.py +269 -0
- letta_client/chat/types/__init__.py +8 -0
- letta_client/chat/types/chat_completion_request_messages_item.py +19 -0
- letta_client/chat/types/chat_completion_request_stop.py +5 -0
- letta_client/client_side_access_tokens/client.py +10 -2
- letta_client/core/client_wrapper.py +2 -2
- letta_client/errors/__init__.py +2 -0
- letta_client/errors/gone_error.py +10 -0
- letta_client/folders/agents/client.py +8 -0
- letta_client/folders/client.py +20 -4
- letta_client/folders/files/client.py +14 -0
- letta_client/folders/passages/client.py +8 -0
- letta_client/groups/client.py +16 -2
- letta_client/groups/messages/client.py +14 -0
- letta_client/identities/agents/client.py +8 -0
- letta_client/identities/blocks/client.py +8 -0
- letta_client/identities/client.py +20 -2
- letta_client/jobs/__init__.py +3 -0
- letta_client/jobs/client.py +61 -12
- letta_client/jobs/raw_client.py +29 -8
- letta_client/jobs/types/__init__.py +7 -0
- letta_client/jobs/types/jobs_list_request_order.py +5 -0
- letta_client/models/client.py +8 -2
- letta_client/projects/client.py +10 -2
- letta_client/providers/client.py +90 -2
- letta_client/providers/raw_client.py +102 -0
- letta_client/runs/__init__.py +11 -2
- letta_client/runs/client.py +150 -18
- letta_client/runs/messages/client.py +30 -2
- letta_client/runs/messages/raw_client.py +10 -0
- letta_client/runs/raw_client.py +144 -14
- letta_client/runs/steps/__init__.py +3 -0
- letta_client/runs/steps/client.py +39 -30
- letta_client/runs/steps/raw_client.py +19 -28
- letta_client/runs/steps/types/__init__.py +7 -0
- letta_client/runs/steps/types/steps_list_request_order.py +5 -0
- letta_client/runs/types/__init__.py +2 -1
- letta_client/runs/types/runs_list_request_order.py +5 -0
- letta_client/sources/client.py +8 -2
- letta_client/sources/files/client.py +12 -0
- letta_client/sources/passages/client.py +6 -0
- letta_client/steps/client.py +26 -2
- letta_client/steps/messages/client.py +8 -0
- letta_client/tags/client.py +16 -2
- letta_client/templates/__init__.py +12 -0
- letta_client/templates/client.py +30 -4
- letta_client/templates/raw_client.py +2 -2
- letta_client/templates/types/__init__.py +24 -0
- letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config.py +4 -0
- letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_display_name.py +14 -0
- letta_client/templates/types/templates_create_agents_from_template_response_agents_item_llm_config_display_name_item.py +5 -0
- letta_client/templates/types/templates_create_agents_from_template_response_agents_item_secrets_item.py +4 -0
- letta_client/templates/types/templates_create_agents_from_template_response_agents_item_secrets_item_value_enc.py +14 -0
- letta_client/templates/types/templates_create_agents_from_template_response_agents_item_secrets_item_value_enc_item.py +5 -0
- letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item.py +6 -0
- letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_value_enc.py +16 -0
- letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tool_exec_environment_variables_item_value_enc_item.py +7 -0
- letta_client/templates/types/templates_create_agents_from_template_response_agents_item_tools_item_tool_type.py +1 -1
- letta_client/tools/client.py +30 -220
- letta_client/tools/raw_client.py +0 -292
- letta_client/types/__init__.py +130 -22
- letta_client/types/agent_environment_variable.py +5 -0
- letta_client/types/{action_parameters_model.py → annotation.py} +4 -10
- letta_client/types/{action_response_model.py → annotation_url_citation.py} +4 -9
- letta_client/types/approval_create.py +8 -2
- letta_client/types/approval_create_approvals_item.py +8 -0
- letta_client/types/approval_response_message.py +8 -2
- letta_client/types/approval_response_message_approvals_item.py +8 -0
- letta_client/types/approval_return.py +34 -0
- letta_client/{agents/templates/types/templates_migrate_response.py → types/audio.py} +4 -4
- letta_client/types/chat_completion.py +30 -0
- letta_client/types/chat_completion_assistant_message_param.py +30 -0
- letta_client/types/chat_completion_assistant_message_param_content.py +9 -0
- letta_client/types/chat_completion_assistant_message_param_content_item.py +10 -0
- letta_client/types/chat_completion_assistant_message_param_tool_calls_item.py +10 -0
- letta_client/types/chat_completion_audio.py +23 -0
- letta_client/types/chat_completion_content_part_image_param.py +22 -0
- letta_client/types/chat_completion_content_part_input_audio_param.py +22 -0
- letta_client/types/chat_completion_content_part_refusal_param.py +21 -0
- letta_client/types/chat_completion_content_part_text_param.py +21 -0
- letta_client/types/chat_completion_developer_message_param.py +23 -0
- letta_client/types/chat_completion_developer_message_param_content.py +7 -0
- letta_client/types/chat_completion_function_message_param.py +22 -0
- letta_client/types/chat_completion_message.py +30 -0
- letta_client/types/chat_completion_message_custom_tool_call.py +23 -0
- letta_client/types/chat_completion_message_custom_tool_call_param.py +23 -0
- letta_client/types/chat_completion_message_function_tool_call_input.py +25 -0
- letta_client/types/{chat_completion_message_function_tool_call.py → chat_completion_message_function_tool_call_output.py} +3 -3
- letta_client/types/chat_completion_message_function_tool_call_param.py +25 -0
- letta_client/types/chat_completion_message_tool_calls_item.py +10 -0
- letta_client/types/chat_completion_service_tier.py +5 -0
- letta_client/types/chat_completion_system_message_param.py +23 -0
- letta_client/types/chat_completion_system_message_param_content.py +7 -0
- letta_client/types/chat_completion_token_logprob.py +24 -0
- letta_client/types/chat_completion_tool_message_param.py +23 -0
- letta_client/types/chat_completion_tool_message_param_content.py +7 -0
- letta_client/types/chat_completion_user_message_param.py +23 -0
- letta_client/types/chat_completion_user_message_param_content.py +7 -0
- letta_client/types/chat_completion_user_message_param_content_item.py +15 -0
- letta_client/types/choice.py +26 -0
- letta_client/types/choice_finish_reason.py +7 -0
- letta_client/types/choice_logprobs.py +22 -0
- letta_client/types/completion_tokens_details.py +23 -0
- letta_client/types/{auth_scheme_field.py → completion_usage.py} +8 -13
- letta_client/types/custom_input.py +21 -0
- letta_client/types/custom_output.py +21 -0
- letta_client/types/file.py +22 -0
- letta_client/types/file_file.py +22 -0
- letta_client/types/function_call_input.py +21 -0
- letta_client/types/function_call_output.py +21 -0
- letta_client/types/{function.py → function_output.py} +1 -1
- letta_client/types/image_url.py +22 -0
- letta_client/types/image_url_detail.py +5 -0
- letta_client/types/input_audio.py +22 -0
- letta_client/types/input_audio_format.py +5 -0
- letta_client/types/internal_template_agent_create.py +2 -2
- letta_client/types/letta_schemas_agent_file_agent_schema.py +2 -2
- letta_client/types/letta_schemas_agent_file_message_schema.py +27 -4
- letta_client/types/letta_schemas_agent_file_message_schema_approvals_item.py +8 -0
- letta_client/types/letta_schemas_letta_message_tool_return.py +26 -0
- letta_client/types/letta_schemas_letta_message_tool_return_status.py +5 -0
- letta_client/types/{tool_return.py → letta_schemas_message_tool_return.py} +9 -3
- letta_client/types/letta_schemas_message_tool_return_status.py +5 -0
- letta_client/types/llm_config.py +5 -0
- letta_client/types/message.py +10 -4
- letta_client/types/message_approvals_item.py +8 -0
- letta_client/types/omitted_reasoning_content.py +4 -0
- letta_client/types/openai_types_chat_chat_completion_message_function_tool_call_function.py +21 -0
- letta_client/types/openai_types_chat_chat_completion_message_function_tool_call_param_function.py +21 -0
- letta_client/types/prompt_tokens_details.py +21 -0
- letta_client/types/provider.py +10 -0
- letta_client/types/run_metrics.py +58 -0
- letta_client/types/sandbox_environment_variable.py +5 -0
- letta_client/types/text_content.py +5 -0
- letta_client/types/tool_call_content.py +5 -0
- letta_client/types/tool_call_message.py +2 -0
- letta_client/types/tool_call_message_tool_calls.py +8 -0
- letta_client/types/tool_return_message.py +8 -5
- letta_client/types/tool_type.py +1 -1
- letta_client/types/top_logprob.py +22 -0
- letta_client/voice/client.py +14 -0
- letta_client/voice/raw_client.py +37 -0
- letta_client-1.0.0a3.dist-info/METADATA +422 -0
- {letta_client-1.0.0a1.dist-info → letta_client-1.0.0a3.dist-info}/RECORD +193 -115
- letta_client/agents/templates/__init__.py +0 -7
- letta_client/agents/templates/client.py +0 -307
- letta_client/agents/templates/raw_client.py +0 -275
- letta_client/agents/templates/types/__init__.py +0 -7
- letta_client/types/action_model.py +0 -39
- letta_client/types/app_auth_scheme.py +0 -35
- letta_client/types/app_auth_scheme_auth_mode.py +0 -19
- letta_client/types/app_model.py +0 -45
- letta_client-1.0.0a1.dist-info/METADATA +0 -211
- {letta_client-1.0.0a1.dist-info → letta_client-1.0.0a3.dist-info}/WHEEL +0 -0
|
@@ -7,6 +7,7 @@ from ...core.request_options import RequestOptions
|
|
|
7
7
|
from ...types.agent_state import AgentState
|
|
8
8
|
from ...types.source import Source
|
|
9
9
|
from .raw_client import AsyncRawFoldersClient, RawFoldersClient
|
|
10
|
+
from .types.folders_list_request_order import FoldersListRequestOrder
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class FoldersClient:
|
|
@@ -96,7 +97,17 @@ class FoldersClient:
|
|
|
96
97
|
_response = self._raw_client.detach(agent_id, folder_id, request_options=request_options)
|
|
97
98
|
return _response.data
|
|
98
99
|
|
|
99
|
-
def list(
|
|
100
|
+
def list(
|
|
101
|
+
self,
|
|
102
|
+
agent_id: str,
|
|
103
|
+
*,
|
|
104
|
+
before: typing.Optional[str] = None,
|
|
105
|
+
after: typing.Optional[str] = None,
|
|
106
|
+
limit: typing.Optional[int] = None,
|
|
107
|
+
order: typing.Optional[FoldersListRequestOrder] = None,
|
|
108
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
109
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
110
|
+
) -> typing.List[Source]:
|
|
100
111
|
"""
|
|
101
112
|
Get the folders associated with an agent.
|
|
102
113
|
|
|
@@ -104,6 +115,21 @@ class FoldersClient:
|
|
|
104
115
|
----------
|
|
105
116
|
agent_id : str
|
|
106
117
|
|
|
118
|
+
before : typing.Optional[str]
|
|
119
|
+
Source ID cursor for pagination. Returns sources that come before this source ID in the specified sort order
|
|
120
|
+
|
|
121
|
+
after : typing.Optional[str]
|
|
122
|
+
Source ID cursor for pagination. Returns sources that come after this source ID in the specified sort order
|
|
123
|
+
|
|
124
|
+
limit : typing.Optional[int]
|
|
125
|
+
Maximum number of sources to return
|
|
126
|
+
|
|
127
|
+
order : typing.Optional[FoldersListRequestOrder]
|
|
128
|
+
Sort order for sources by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
129
|
+
|
|
130
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
131
|
+
Field to sort by
|
|
132
|
+
|
|
107
133
|
request_options : typing.Optional[RequestOptions]
|
|
108
134
|
Request-specific configuration.
|
|
109
135
|
|
|
@@ -122,9 +148,21 @@ class FoldersClient:
|
|
|
122
148
|
)
|
|
123
149
|
client.agents.folders.list(
|
|
124
150
|
agent_id="agent_id",
|
|
151
|
+
before="before",
|
|
152
|
+
after="after",
|
|
153
|
+
limit=1,
|
|
154
|
+
order="asc",
|
|
125
155
|
)
|
|
126
156
|
"""
|
|
127
|
-
_response = self._raw_client.list(
|
|
157
|
+
_response = self._raw_client.list(
|
|
158
|
+
agent_id,
|
|
159
|
+
before=before,
|
|
160
|
+
after=after,
|
|
161
|
+
limit=limit,
|
|
162
|
+
order=order,
|
|
163
|
+
order_by=order_by,
|
|
164
|
+
request_options=request_options,
|
|
165
|
+
)
|
|
128
166
|
return _response.data
|
|
129
167
|
|
|
130
168
|
|
|
@@ -232,7 +270,15 @@ class AsyncFoldersClient:
|
|
|
232
270
|
return _response.data
|
|
233
271
|
|
|
234
272
|
async def list(
|
|
235
|
-
self,
|
|
273
|
+
self,
|
|
274
|
+
agent_id: str,
|
|
275
|
+
*,
|
|
276
|
+
before: typing.Optional[str] = None,
|
|
277
|
+
after: typing.Optional[str] = None,
|
|
278
|
+
limit: typing.Optional[int] = None,
|
|
279
|
+
order: typing.Optional[FoldersListRequestOrder] = None,
|
|
280
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
281
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
236
282
|
) -> typing.List[Source]:
|
|
237
283
|
"""
|
|
238
284
|
Get the folders associated with an agent.
|
|
@@ -241,6 +287,21 @@ class AsyncFoldersClient:
|
|
|
241
287
|
----------
|
|
242
288
|
agent_id : str
|
|
243
289
|
|
|
290
|
+
before : typing.Optional[str]
|
|
291
|
+
Source ID cursor for pagination. Returns sources that come before this source ID in the specified sort order
|
|
292
|
+
|
|
293
|
+
after : typing.Optional[str]
|
|
294
|
+
Source ID cursor for pagination. Returns sources that come after this source ID in the specified sort order
|
|
295
|
+
|
|
296
|
+
limit : typing.Optional[int]
|
|
297
|
+
Maximum number of sources to return
|
|
298
|
+
|
|
299
|
+
order : typing.Optional[FoldersListRequestOrder]
|
|
300
|
+
Sort order for sources by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
301
|
+
|
|
302
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
303
|
+
Field to sort by
|
|
304
|
+
|
|
244
305
|
request_options : typing.Optional[RequestOptions]
|
|
245
306
|
Request-specific configuration.
|
|
246
307
|
|
|
@@ -264,10 +325,22 @@ class AsyncFoldersClient:
|
|
|
264
325
|
async def main() -> None:
|
|
265
326
|
await client.agents.folders.list(
|
|
266
327
|
agent_id="agent_id",
|
|
328
|
+
before="before",
|
|
329
|
+
after="after",
|
|
330
|
+
limit=1,
|
|
331
|
+
order="asc",
|
|
267
332
|
)
|
|
268
333
|
|
|
269
334
|
|
|
270
335
|
asyncio.run(main())
|
|
271
336
|
"""
|
|
272
|
-
_response = await self._raw_client.list(
|
|
337
|
+
_response = await self._raw_client.list(
|
|
338
|
+
agent_id,
|
|
339
|
+
before=before,
|
|
340
|
+
after=after,
|
|
341
|
+
limit=limit,
|
|
342
|
+
order=order,
|
|
343
|
+
order_by=order_by,
|
|
344
|
+
request_options=request_options,
|
|
345
|
+
)
|
|
273
346
|
return _response.data
|
|
@@ -13,6 +13,7 @@ from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
|
13
13
|
from ...types.agent_state import AgentState
|
|
14
14
|
from ...types.http_validation_error import HttpValidationError
|
|
15
15
|
from ...types.source import Source
|
|
16
|
+
from .types.folders_list_request_order import FoldersListRequestOrder
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
class RawFoldersClient:
|
|
@@ -122,7 +123,15 @@ class RawFoldersClient:
|
|
|
122
123
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
123
124
|
|
|
124
125
|
def list(
|
|
125
|
-
self,
|
|
126
|
+
self,
|
|
127
|
+
agent_id: str,
|
|
128
|
+
*,
|
|
129
|
+
before: typing.Optional[str] = None,
|
|
130
|
+
after: typing.Optional[str] = None,
|
|
131
|
+
limit: typing.Optional[int] = None,
|
|
132
|
+
order: typing.Optional[FoldersListRequestOrder] = None,
|
|
133
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
134
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
126
135
|
) -> HttpResponse[typing.List[Source]]:
|
|
127
136
|
"""
|
|
128
137
|
Get the folders associated with an agent.
|
|
@@ -131,6 +140,21 @@ class RawFoldersClient:
|
|
|
131
140
|
----------
|
|
132
141
|
agent_id : str
|
|
133
142
|
|
|
143
|
+
before : typing.Optional[str]
|
|
144
|
+
Source ID cursor for pagination. Returns sources that come before this source ID in the specified sort order
|
|
145
|
+
|
|
146
|
+
after : typing.Optional[str]
|
|
147
|
+
Source ID cursor for pagination. Returns sources that come after this source ID in the specified sort order
|
|
148
|
+
|
|
149
|
+
limit : typing.Optional[int]
|
|
150
|
+
Maximum number of sources to return
|
|
151
|
+
|
|
152
|
+
order : typing.Optional[FoldersListRequestOrder]
|
|
153
|
+
Sort order for sources by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
154
|
+
|
|
155
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
156
|
+
Field to sort by
|
|
157
|
+
|
|
134
158
|
request_options : typing.Optional[RequestOptions]
|
|
135
159
|
Request-specific configuration.
|
|
136
160
|
|
|
@@ -142,6 +166,13 @@ class RawFoldersClient:
|
|
|
142
166
|
_response = self._client_wrapper.httpx_client.request(
|
|
143
167
|
f"v1/agents/{jsonable_encoder(agent_id)}/folders",
|
|
144
168
|
method="GET",
|
|
169
|
+
params={
|
|
170
|
+
"before": before,
|
|
171
|
+
"after": after,
|
|
172
|
+
"limit": limit,
|
|
173
|
+
"order": order,
|
|
174
|
+
"order_by": order_by,
|
|
175
|
+
},
|
|
145
176
|
request_options=request_options,
|
|
146
177
|
)
|
|
147
178
|
try:
|
|
@@ -278,7 +309,15 @@ class AsyncRawFoldersClient:
|
|
|
278
309
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
279
310
|
|
|
280
311
|
async def list(
|
|
281
|
-
self,
|
|
312
|
+
self,
|
|
313
|
+
agent_id: str,
|
|
314
|
+
*,
|
|
315
|
+
before: typing.Optional[str] = None,
|
|
316
|
+
after: typing.Optional[str] = None,
|
|
317
|
+
limit: typing.Optional[int] = None,
|
|
318
|
+
order: typing.Optional[FoldersListRequestOrder] = None,
|
|
319
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
320
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
282
321
|
) -> AsyncHttpResponse[typing.List[Source]]:
|
|
283
322
|
"""
|
|
284
323
|
Get the folders associated with an agent.
|
|
@@ -287,6 +326,21 @@ class AsyncRawFoldersClient:
|
|
|
287
326
|
----------
|
|
288
327
|
agent_id : str
|
|
289
328
|
|
|
329
|
+
before : typing.Optional[str]
|
|
330
|
+
Source ID cursor for pagination. Returns sources that come before this source ID in the specified sort order
|
|
331
|
+
|
|
332
|
+
after : typing.Optional[str]
|
|
333
|
+
Source ID cursor for pagination. Returns sources that come after this source ID in the specified sort order
|
|
334
|
+
|
|
335
|
+
limit : typing.Optional[int]
|
|
336
|
+
Maximum number of sources to return
|
|
337
|
+
|
|
338
|
+
order : typing.Optional[FoldersListRequestOrder]
|
|
339
|
+
Sort order for sources by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
340
|
+
|
|
341
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
342
|
+
Field to sort by
|
|
343
|
+
|
|
290
344
|
request_options : typing.Optional[RequestOptions]
|
|
291
345
|
Request-specific configuration.
|
|
292
346
|
|
|
@@ -298,6 +352,13 @@ class AsyncRawFoldersClient:
|
|
|
298
352
|
_response = await self._client_wrapper.httpx_client.request(
|
|
299
353
|
f"v1/agents/{jsonable_encoder(agent_id)}/folders",
|
|
300
354
|
method="GET",
|
|
355
|
+
params={
|
|
356
|
+
"before": before,
|
|
357
|
+
"after": after,
|
|
358
|
+
"limit": limit,
|
|
359
|
+
"order": order,
|
|
360
|
+
"order_by": order_by,
|
|
361
|
+
},
|
|
301
362
|
request_options=request_options,
|
|
302
363
|
)
|
|
303
364
|
try:
|
|
@@ -6,6 +6,7 @@ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
|
6
6
|
from ...core.request_options import RequestOptions
|
|
7
7
|
from ...types.group import Group
|
|
8
8
|
from .raw_client import AsyncRawGroupsClient, RawGroupsClient
|
|
9
|
+
from .types.groups_list_request_order import GroupsListRequestOrder
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class GroupsClient:
|
|
@@ -28,6 +29,11 @@ class GroupsClient:
|
|
|
28
29
|
agent_id: str,
|
|
29
30
|
*,
|
|
30
31
|
manager_type: typing.Optional[str] = None,
|
|
32
|
+
before: typing.Optional[str] = None,
|
|
33
|
+
after: typing.Optional[str] = None,
|
|
34
|
+
limit: typing.Optional[int] = None,
|
|
35
|
+
order: typing.Optional[GroupsListRequestOrder] = None,
|
|
36
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
31
37
|
request_options: typing.Optional[RequestOptions] = None,
|
|
32
38
|
) -> typing.List[Group]:
|
|
33
39
|
"""
|
|
@@ -40,6 +46,21 @@ class GroupsClient:
|
|
|
40
46
|
manager_type : typing.Optional[str]
|
|
41
47
|
Manager type to filter groups by
|
|
42
48
|
|
|
49
|
+
before : typing.Optional[str]
|
|
50
|
+
Group ID cursor for pagination. Returns groups that come before this group ID in the specified sort order
|
|
51
|
+
|
|
52
|
+
after : typing.Optional[str]
|
|
53
|
+
Group ID cursor for pagination. Returns groups that come after this group ID in the specified sort order
|
|
54
|
+
|
|
55
|
+
limit : typing.Optional[int]
|
|
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
|
|
63
|
+
|
|
43
64
|
request_options : typing.Optional[RequestOptions]
|
|
44
65
|
Request-specific configuration.
|
|
45
66
|
|
|
@@ -58,9 +79,23 @@ class GroupsClient:
|
|
|
58
79
|
)
|
|
59
80
|
client.agents.groups.list(
|
|
60
81
|
agent_id="agent_id",
|
|
82
|
+
manager_type="manager_type",
|
|
83
|
+
before="before",
|
|
84
|
+
after="after",
|
|
85
|
+
limit=1,
|
|
86
|
+
order="asc",
|
|
61
87
|
)
|
|
62
88
|
"""
|
|
63
|
-
_response = self._raw_client.list(
|
|
89
|
+
_response = self._raw_client.list(
|
|
90
|
+
agent_id,
|
|
91
|
+
manager_type=manager_type,
|
|
92
|
+
before=before,
|
|
93
|
+
after=after,
|
|
94
|
+
limit=limit,
|
|
95
|
+
order=order,
|
|
96
|
+
order_by=order_by,
|
|
97
|
+
request_options=request_options,
|
|
98
|
+
)
|
|
64
99
|
return _response.data
|
|
65
100
|
|
|
66
101
|
|
|
@@ -84,6 +119,11 @@ class AsyncGroupsClient:
|
|
|
84
119
|
agent_id: str,
|
|
85
120
|
*,
|
|
86
121
|
manager_type: typing.Optional[str] = None,
|
|
122
|
+
before: typing.Optional[str] = None,
|
|
123
|
+
after: typing.Optional[str] = None,
|
|
124
|
+
limit: typing.Optional[int] = None,
|
|
125
|
+
order: typing.Optional[GroupsListRequestOrder] = None,
|
|
126
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
87
127
|
request_options: typing.Optional[RequestOptions] = None,
|
|
88
128
|
) -> typing.List[Group]:
|
|
89
129
|
"""
|
|
@@ -96,6 +136,21 @@ class AsyncGroupsClient:
|
|
|
96
136
|
manager_type : typing.Optional[str]
|
|
97
137
|
Manager type to filter groups by
|
|
98
138
|
|
|
139
|
+
before : typing.Optional[str]
|
|
140
|
+
Group ID cursor for pagination. Returns groups that come before this group ID in the specified sort order
|
|
141
|
+
|
|
142
|
+
after : typing.Optional[str]
|
|
143
|
+
Group ID cursor for pagination. Returns groups that come after this group ID in the specified sort order
|
|
144
|
+
|
|
145
|
+
limit : typing.Optional[int]
|
|
146
|
+
Maximum number of groups to return
|
|
147
|
+
|
|
148
|
+
order : typing.Optional[GroupsListRequestOrder]
|
|
149
|
+
Sort order for groups by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
150
|
+
|
|
151
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
152
|
+
Field to sort by
|
|
153
|
+
|
|
99
154
|
request_options : typing.Optional[RequestOptions]
|
|
100
155
|
Request-specific configuration.
|
|
101
156
|
|
|
@@ -119,10 +174,24 @@ class AsyncGroupsClient:
|
|
|
119
174
|
async def main() -> None:
|
|
120
175
|
await client.agents.groups.list(
|
|
121
176
|
agent_id="agent_id",
|
|
177
|
+
manager_type="manager_type",
|
|
178
|
+
before="before",
|
|
179
|
+
after="after",
|
|
180
|
+
limit=1,
|
|
181
|
+
order="asc",
|
|
122
182
|
)
|
|
123
183
|
|
|
124
184
|
|
|
125
185
|
asyncio.run(main())
|
|
126
186
|
"""
|
|
127
|
-
_response = await self._raw_client.list(
|
|
187
|
+
_response = await self._raw_client.list(
|
|
188
|
+
agent_id,
|
|
189
|
+
manager_type=manager_type,
|
|
190
|
+
before=before,
|
|
191
|
+
after=after,
|
|
192
|
+
limit=limit,
|
|
193
|
+
order=order,
|
|
194
|
+
order_by=order_by,
|
|
195
|
+
request_options=request_options,
|
|
196
|
+
)
|
|
128
197
|
return _response.data
|
|
@@ -12,6 +12,7 @@ from ...core.unchecked_base_model import construct_type
|
|
|
12
12
|
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
|
13
13
|
from ...types.group import Group
|
|
14
14
|
from ...types.http_validation_error import HttpValidationError
|
|
15
|
+
from .types.groups_list_request_order import GroupsListRequestOrder
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
class RawGroupsClient:
|
|
@@ -23,6 +24,11 @@ class RawGroupsClient:
|
|
|
23
24
|
agent_id: str,
|
|
24
25
|
*,
|
|
25
26
|
manager_type: typing.Optional[str] = None,
|
|
27
|
+
before: typing.Optional[str] = None,
|
|
28
|
+
after: typing.Optional[str] = None,
|
|
29
|
+
limit: typing.Optional[int] = None,
|
|
30
|
+
order: typing.Optional[GroupsListRequestOrder] = None,
|
|
31
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
26
32
|
request_options: typing.Optional[RequestOptions] = None,
|
|
27
33
|
) -> HttpResponse[typing.List[Group]]:
|
|
28
34
|
"""
|
|
@@ -35,6 +41,21 @@ class RawGroupsClient:
|
|
|
35
41
|
manager_type : typing.Optional[str]
|
|
36
42
|
Manager type to filter groups by
|
|
37
43
|
|
|
44
|
+
before : typing.Optional[str]
|
|
45
|
+
Group ID cursor for pagination. Returns groups that come before this group ID in the specified sort order
|
|
46
|
+
|
|
47
|
+
after : typing.Optional[str]
|
|
48
|
+
Group ID cursor for pagination. Returns groups that come after this group ID in the specified sort order
|
|
49
|
+
|
|
50
|
+
limit : typing.Optional[int]
|
|
51
|
+
Maximum number of groups to return
|
|
52
|
+
|
|
53
|
+
order : typing.Optional[GroupsListRequestOrder]
|
|
54
|
+
Sort order for groups by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
55
|
+
|
|
56
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
57
|
+
Field to sort by
|
|
58
|
+
|
|
38
59
|
request_options : typing.Optional[RequestOptions]
|
|
39
60
|
Request-specific configuration.
|
|
40
61
|
|
|
@@ -48,6 +69,11 @@ class RawGroupsClient:
|
|
|
48
69
|
method="GET",
|
|
49
70
|
params={
|
|
50
71
|
"manager_type": manager_type,
|
|
72
|
+
"before": before,
|
|
73
|
+
"after": after,
|
|
74
|
+
"limit": limit,
|
|
75
|
+
"order": order,
|
|
76
|
+
"order_by": order_by,
|
|
51
77
|
},
|
|
52
78
|
request_options=request_options,
|
|
53
79
|
)
|
|
@@ -87,6 +113,11 @@ class AsyncRawGroupsClient:
|
|
|
87
113
|
agent_id: str,
|
|
88
114
|
*,
|
|
89
115
|
manager_type: typing.Optional[str] = None,
|
|
116
|
+
before: typing.Optional[str] = None,
|
|
117
|
+
after: typing.Optional[str] = None,
|
|
118
|
+
limit: typing.Optional[int] = None,
|
|
119
|
+
order: typing.Optional[GroupsListRequestOrder] = None,
|
|
120
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
90
121
|
request_options: typing.Optional[RequestOptions] = None,
|
|
91
122
|
) -> AsyncHttpResponse[typing.List[Group]]:
|
|
92
123
|
"""
|
|
@@ -99,6 +130,21 @@ class AsyncRawGroupsClient:
|
|
|
99
130
|
manager_type : typing.Optional[str]
|
|
100
131
|
Manager type to filter groups by
|
|
101
132
|
|
|
133
|
+
before : typing.Optional[str]
|
|
134
|
+
Group ID cursor for pagination. Returns groups that come before this group ID in the specified sort order
|
|
135
|
+
|
|
136
|
+
after : typing.Optional[str]
|
|
137
|
+
Group ID cursor for pagination. Returns groups that come after this group ID in the specified sort order
|
|
138
|
+
|
|
139
|
+
limit : typing.Optional[int]
|
|
140
|
+
Maximum number of groups to return
|
|
141
|
+
|
|
142
|
+
order : typing.Optional[GroupsListRequestOrder]
|
|
143
|
+
Sort order for groups by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
144
|
+
|
|
145
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
146
|
+
Field to sort by
|
|
147
|
+
|
|
102
148
|
request_options : typing.Optional[RequestOptions]
|
|
103
149
|
Request-specific configuration.
|
|
104
150
|
|
|
@@ -112,6 +158,11 @@ class AsyncRawGroupsClient:
|
|
|
112
158
|
method="GET",
|
|
113
159
|
params={
|
|
114
160
|
"manager_type": manager_type,
|
|
161
|
+
"before": before,
|
|
162
|
+
"after": after,
|
|
163
|
+
"limit": limit,
|
|
164
|
+
"order": order,
|
|
165
|
+
"order_by": order_by,
|
|
115
166
|
},
|
|
116
167
|
request_options=request_options,
|
|
117
168
|
)
|
|
@@ -6,6 +6,7 @@ from .types import (
|
|
|
6
6
|
LettaAsyncRequestMessagesItem,
|
|
7
7
|
LettaStreamingResponse,
|
|
8
8
|
MessageSearchRequestSearchMode,
|
|
9
|
+
MessagesListRequestOrder,
|
|
9
10
|
MessagesModifyRequest,
|
|
10
11
|
MessagesModifyResponse,
|
|
11
12
|
MessagesPreviewRequest,
|
|
@@ -15,6 +16,7 @@ __all__ = [
|
|
|
15
16
|
"LettaAsyncRequestMessagesItem",
|
|
16
17
|
"LettaStreamingResponse",
|
|
17
18
|
"MessageSearchRequestSearchMode",
|
|
19
|
+
"MessagesListRequestOrder",
|
|
18
20
|
"MessagesModifyRequest",
|
|
19
21
|
"MessagesModifyResponse",
|
|
20
22
|
"MessagesPreviewRequest",
|
|
@@ -18,6 +18,7 @@ from .raw_client import AsyncRawMessagesClient, RawMessagesClient
|
|
|
18
18
|
from .types.letta_async_request_messages_item import LettaAsyncRequestMessagesItem
|
|
19
19
|
from .types.letta_streaming_response import LettaStreamingResponse
|
|
20
20
|
from .types.message_search_request_search_mode import MessageSearchRequestSearchMode
|
|
21
|
+
from .types.messages_list_request_order import MessagesListRequestOrder
|
|
21
22
|
from .types.messages_modify_request import MessagesModifyRequest
|
|
22
23
|
from .types.messages_modify_response import MessagesModifyResponse
|
|
23
24
|
from .types.messages_preview_request import MessagesPreviewRequest
|
|
@@ -45,9 +46,11 @@ class MessagesClient:
|
|
|
45
46
|
self,
|
|
46
47
|
agent_id: str,
|
|
47
48
|
*,
|
|
48
|
-
after: typing.Optional[str] = None,
|
|
49
49
|
before: typing.Optional[str] = None,
|
|
50
|
+
after: typing.Optional[str] = None,
|
|
50
51
|
limit: typing.Optional[int] = None,
|
|
52
|
+
order: typing.Optional[MessagesListRequestOrder] = None,
|
|
53
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
51
54
|
group_id: typing.Optional[str] = None,
|
|
52
55
|
use_assistant_message: typing.Optional[bool] = None,
|
|
53
56
|
assistant_message_tool_name: typing.Optional[str] = None,
|
|
@@ -62,14 +65,20 @@ class MessagesClient:
|
|
|
62
65
|
----------
|
|
63
66
|
agent_id : str
|
|
64
67
|
|
|
65
|
-
after : typing.Optional[str]
|
|
66
|
-
Message after which to retrieve the returned messages.
|
|
67
|
-
|
|
68
68
|
before : typing.Optional[str]
|
|
69
|
-
Message before
|
|
69
|
+
Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order
|
|
70
|
+
|
|
71
|
+
after : typing.Optional[str]
|
|
72
|
+
Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order
|
|
70
73
|
|
|
71
74
|
limit : typing.Optional[int]
|
|
72
|
-
Maximum number of messages to
|
|
75
|
+
Maximum number of messages to return
|
|
76
|
+
|
|
77
|
+
order : typing.Optional[MessagesListRequestOrder]
|
|
78
|
+
Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
79
|
+
|
|
80
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
81
|
+
Field to sort by
|
|
73
82
|
|
|
74
83
|
group_id : typing.Optional[str]
|
|
75
84
|
Group ID to filter messages by.
|
|
@@ -104,13 +113,24 @@ class MessagesClient:
|
|
|
104
113
|
)
|
|
105
114
|
client.agents.messages.list(
|
|
106
115
|
agent_id="agent_id",
|
|
116
|
+
before="before",
|
|
117
|
+
after="after",
|
|
118
|
+
limit=1,
|
|
119
|
+
order="asc",
|
|
120
|
+
group_id="group_id",
|
|
121
|
+
use_assistant_message=True,
|
|
122
|
+
assistant_message_tool_name="assistant_message_tool_name",
|
|
123
|
+
assistant_message_tool_kwarg="assistant_message_tool_kwarg",
|
|
124
|
+
include_err=True,
|
|
107
125
|
)
|
|
108
126
|
"""
|
|
109
127
|
_response = self._raw_client.list(
|
|
110
128
|
agent_id,
|
|
111
|
-
after=after,
|
|
112
129
|
before=before,
|
|
130
|
+
after=after,
|
|
113
131
|
limit=limit,
|
|
132
|
+
order=order,
|
|
133
|
+
order_by=order_by,
|
|
114
134
|
group_id=group_id,
|
|
115
135
|
use_assistant_message=use_assistant_message,
|
|
116
136
|
assistant_message_tool_name=assistant_message_tool_name,
|
|
@@ -598,6 +618,7 @@ class MessagesClient:
|
|
|
598
618
|
)
|
|
599
619
|
client.agents.messages.reset(
|
|
600
620
|
agent_id="agent_id",
|
|
621
|
+
add_default_initial_messages=True,
|
|
601
622
|
)
|
|
602
623
|
"""
|
|
603
624
|
_response = self._raw_client.reset(
|
|
@@ -717,9 +738,11 @@ class AsyncMessagesClient:
|
|
|
717
738
|
self,
|
|
718
739
|
agent_id: str,
|
|
719
740
|
*,
|
|
720
|
-
after: typing.Optional[str] = None,
|
|
721
741
|
before: typing.Optional[str] = None,
|
|
742
|
+
after: typing.Optional[str] = None,
|
|
722
743
|
limit: typing.Optional[int] = None,
|
|
744
|
+
order: typing.Optional[MessagesListRequestOrder] = None,
|
|
745
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
723
746
|
group_id: typing.Optional[str] = None,
|
|
724
747
|
use_assistant_message: typing.Optional[bool] = None,
|
|
725
748
|
assistant_message_tool_name: typing.Optional[str] = None,
|
|
@@ -734,14 +757,20 @@ class AsyncMessagesClient:
|
|
|
734
757
|
----------
|
|
735
758
|
agent_id : str
|
|
736
759
|
|
|
737
|
-
after : typing.Optional[str]
|
|
738
|
-
Message after which to retrieve the returned messages.
|
|
739
|
-
|
|
740
760
|
before : typing.Optional[str]
|
|
741
|
-
Message before
|
|
761
|
+
Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order
|
|
762
|
+
|
|
763
|
+
after : typing.Optional[str]
|
|
764
|
+
Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order
|
|
742
765
|
|
|
743
766
|
limit : typing.Optional[int]
|
|
744
|
-
Maximum number of messages to
|
|
767
|
+
Maximum number of messages to return
|
|
768
|
+
|
|
769
|
+
order : typing.Optional[MessagesListRequestOrder]
|
|
770
|
+
Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
771
|
+
|
|
772
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
773
|
+
Field to sort by
|
|
745
774
|
|
|
746
775
|
group_id : typing.Optional[str]
|
|
747
776
|
Group ID to filter messages by.
|
|
@@ -781,6 +810,15 @@ class AsyncMessagesClient:
|
|
|
781
810
|
async def main() -> None:
|
|
782
811
|
await client.agents.messages.list(
|
|
783
812
|
agent_id="agent_id",
|
|
813
|
+
before="before",
|
|
814
|
+
after="after",
|
|
815
|
+
limit=1,
|
|
816
|
+
order="asc",
|
|
817
|
+
group_id="group_id",
|
|
818
|
+
use_assistant_message=True,
|
|
819
|
+
assistant_message_tool_name="assistant_message_tool_name",
|
|
820
|
+
assistant_message_tool_kwarg="assistant_message_tool_kwarg",
|
|
821
|
+
include_err=True,
|
|
784
822
|
)
|
|
785
823
|
|
|
786
824
|
|
|
@@ -788,9 +826,11 @@ class AsyncMessagesClient:
|
|
|
788
826
|
"""
|
|
789
827
|
_response = await self._raw_client.list(
|
|
790
828
|
agent_id,
|
|
791
|
-
after=after,
|
|
792
829
|
before=before,
|
|
830
|
+
after=after,
|
|
793
831
|
limit=limit,
|
|
832
|
+
order=order,
|
|
833
|
+
order_by=order_by,
|
|
794
834
|
group_id=group_id,
|
|
795
835
|
use_assistant_message=use_assistant_message,
|
|
796
836
|
assistant_message_tool_name=assistant_message_tool_name,
|
|
@@ -1334,6 +1374,7 @@ class AsyncMessagesClient:
|
|
|
1334
1374
|
async def main() -> None:
|
|
1335
1375
|
await client.agents.messages.reset(
|
|
1336
1376
|
agent_id="agent_id",
|
|
1377
|
+
add_default_initial_messages=True,
|
|
1337
1378
|
)
|
|
1338
1379
|
|
|
1339
1380
|
|