letta-client 1.0.0a1__py3-none-any.whl → 1.0.0a2__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.0a2.dist-info/METADATA +422 -0
- {letta_client-1.0.0a1.dist-info → letta_client-1.0.0a2.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.0a2.dist-info}/WHEEL +0 -0
letta_client/jobs/client.py
CHANGED
|
@@ -6,6 +6,7 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
|
6
6
|
from ..core.request_options import RequestOptions
|
|
7
7
|
from ..types.job import Job
|
|
8
8
|
from .raw_client import AsyncRawJobsClient, RawJobsClient
|
|
9
|
+
from .types.jobs_list_request_order import JobsListRequestOrder
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class JobsClient:
|
|
@@ -30,6 +31,8 @@ class JobsClient:
|
|
|
30
31
|
before: typing.Optional[str] = None,
|
|
31
32
|
after: typing.Optional[str] = None,
|
|
32
33
|
limit: typing.Optional[int] = None,
|
|
34
|
+
order: typing.Optional[JobsListRequestOrder] = None,
|
|
35
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
33
36
|
active: typing.Optional[bool] = None,
|
|
34
37
|
ascending: typing.Optional[bool] = None,
|
|
35
38
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -43,19 +46,25 @@ class JobsClient:
|
|
|
43
46
|
Only list jobs associated with the source.
|
|
44
47
|
|
|
45
48
|
before : typing.Optional[str]
|
|
46
|
-
|
|
49
|
+
Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order
|
|
47
50
|
|
|
48
51
|
after : typing.Optional[str]
|
|
49
|
-
|
|
52
|
+
Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order
|
|
50
53
|
|
|
51
54
|
limit : typing.Optional[int]
|
|
52
|
-
|
|
55
|
+
Maximum number of jobs to return
|
|
56
|
+
|
|
57
|
+
order : typing.Optional[JobsListRequestOrder]
|
|
58
|
+
Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
59
|
+
|
|
60
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
61
|
+
Field to sort by
|
|
53
62
|
|
|
54
63
|
active : typing.Optional[bool]
|
|
55
64
|
Filter for active jobs.
|
|
56
65
|
|
|
57
66
|
ascending : typing.Optional[bool]
|
|
58
|
-
Whether to sort jobs oldest to newest (True, default) or newest to oldest (False)
|
|
67
|
+
Whether to sort jobs oldest to newest (True, default) or newest to oldest (False). Deprecated in favor of order field.
|
|
59
68
|
|
|
60
69
|
request_options : typing.Optional[RequestOptions]
|
|
61
70
|
Request-specific configuration.
|
|
@@ -73,13 +82,23 @@ class JobsClient:
|
|
|
73
82
|
project="YOUR_PROJECT",
|
|
74
83
|
token="YOUR_TOKEN",
|
|
75
84
|
)
|
|
76
|
-
client.jobs.list(
|
|
85
|
+
client.jobs.list(
|
|
86
|
+
source_id="source_id",
|
|
87
|
+
before="before",
|
|
88
|
+
after="after",
|
|
89
|
+
limit=1,
|
|
90
|
+
order="asc",
|
|
91
|
+
active=True,
|
|
92
|
+
ascending=True,
|
|
93
|
+
)
|
|
77
94
|
"""
|
|
78
95
|
_response = self._raw_client.list(
|
|
79
96
|
source_id=source_id,
|
|
80
97
|
before=before,
|
|
81
98
|
after=after,
|
|
82
99
|
limit=limit,
|
|
100
|
+
order=order,
|
|
101
|
+
order_by=order_by,
|
|
83
102
|
active=active,
|
|
84
103
|
ascending=ascending,
|
|
85
104
|
request_options=request_options,
|
|
@@ -132,7 +151,13 @@ class JobsClient:
|
|
|
132
151
|
project="YOUR_PROJECT",
|
|
133
152
|
token="YOUR_TOKEN",
|
|
134
153
|
)
|
|
135
|
-
client.jobs.list_active(
|
|
154
|
+
client.jobs.list_active(
|
|
155
|
+
source_id="source_id",
|
|
156
|
+
before="before",
|
|
157
|
+
after="after",
|
|
158
|
+
limit=1,
|
|
159
|
+
ascending=True,
|
|
160
|
+
)
|
|
136
161
|
"""
|
|
137
162
|
_response = self._raw_client.list_active(
|
|
138
163
|
source_id=source_id,
|
|
@@ -263,6 +288,8 @@ class AsyncJobsClient:
|
|
|
263
288
|
before: typing.Optional[str] = None,
|
|
264
289
|
after: typing.Optional[str] = None,
|
|
265
290
|
limit: typing.Optional[int] = None,
|
|
291
|
+
order: typing.Optional[JobsListRequestOrder] = None,
|
|
292
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
266
293
|
active: typing.Optional[bool] = None,
|
|
267
294
|
ascending: typing.Optional[bool] = None,
|
|
268
295
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -276,19 +303,25 @@ class AsyncJobsClient:
|
|
|
276
303
|
Only list jobs associated with the source.
|
|
277
304
|
|
|
278
305
|
before : typing.Optional[str]
|
|
279
|
-
|
|
306
|
+
Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order
|
|
280
307
|
|
|
281
308
|
after : typing.Optional[str]
|
|
282
|
-
|
|
309
|
+
Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order
|
|
283
310
|
|
|
284
311
|
limit : typing.Optional[int]
|
|
285
|
-
|
|
312
|
+
Maximum number of jobs to return
|
|
313
|
+
|
|
314
|
+
order : typing.Optional[JobsListRequestOrder]
|
|
315
|
+
Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
316
|
+
|
|
317
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
318
|
+
Field to sort by
|
|
286
319
|
|
|
287
320
|
active : typing.Optional[bool]
|
|
288
321
|
Filter for active jobs.
|
|
289
322
|
|
|
290
323
|
ascending : typing.Optional[bool]
|
|
291
|
-
Whether to sort jobs oldest to newest (True, default) or newest to oldest (False)
|
|
324
|
+
Whether to sort jobs oldest to newest (True, default) or newest to oldest (False). Deprecated in favor of order field.
|
|
292
325
|
|
|
293
326
|
request_options : typing.Optional[RequestOptions]
|
|
294
327
|
Request-specific configuration.
|
|
@@ -311,7 +344,15 @@ class AsyncJobsClient:
|
|
|
311
344
|
|
|
312
345
|
|
|
313
346
|
async def main() -> None:
|
|
314
|
-
await client.jobs.list(
|
|
347
|
+
await client.jobs.list(
|
|
348
|
+
source_id="source_id",
|
|
349
|
+
before="before",
|
|
350
|
+
after="after",
|
|
351
|
+
limit=1,
|
|
352
|
+
order="asc",
|
|
353
|
+
active=True,
|
|
354
|
+
ascending=True,
|
|
355
|
+
)
|
|
315
356
|
|
|
316
357
|
|
|
317
358
|
asyncio.run(main())
|
|
@@ -321,6 +362,8 @@ class AsyncJobsClient:
|
|
|
321
362
|
before=before,
|
|
322
363
|
after=after,
|
|
323
364
|
limit=limit,
|
|
365
|
+
order=order,
|
|
366
|
+
order_by=order_by,
|
|
324
367
|
active=active,
|
|
325
368
|
ascending=ascending,
|
|
326
369
|
request_options=request_options,
|
|
@@ -378,7 +421,13 @@ class AsyncJobsClient:
|
|
|
378
421
|
|
|
379
422
|
|
|
380
423
|
async def main() -> None:
|
|
381
|
-
await client.jobs.list_active(
|
|
424
|
+
await client.jobs.list_active(
|
|
425
|
+
source_id="source_id",
|
|
426
|
+
before="before",
|
|
427
|
+
after="after",
|
|
428
|
+
limit=1,
|
|
429
|
+
ascending=True,
|
|
430
|
+
)
|
|
382
431
|
|
|
383
432
|
|
|
384
433
|
asyncio.run(main())
|
letta_client/jobs/raw_client.py
CHANGED
|
@@ -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.http_validation_error import HttpValidationError
|
|
14
14
|
from ..types.job import Job
|
|
15
|
+
from .types.jobs_list_request_order import JobsListRequestOrder
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
class RawJobsClient:
|
|
@@ -25,6 +26,8 @@ class RawJobsClient:
|
|
|
25
26
|
before: typing.Optional[str] = None,
|
|
26
27
|
after: typing.Optional[str] = None,
|
|
27
28
|
limit: typing.Optional[int] = None,
|
|
29
|
+
order: typing.Optional[JobsListRequestOrder] = None,
|
|
30
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
28
31
|
active: typing.Optional[bool] = None,
|
|
29
32
|
ascending: typing.Optional[bool] = None,
|
|
30
33
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -38,19 +41,25 @@ class RawJobsClient:
|
|
|
38
41
|
Only list jobs associated with the source.
|
|
39
42
|
|
|
40
43
|
before : typing.Optional[str]
|
|
41
|
-
|
|
44
|
+
Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order
|
|
42
45
|
|
|
43
46
|
after : typing.Optional[str]
|
|
44
|
-
|
|
47
|
+
Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order
|
|
45
48
|
|
|
46
49
|
limit : typing.Optional[int]
|
|
47
|
-
|
|
50
|
+
Maximum number of jobs to return
|
|
51
|
+
|
|
52
|
+
order : typing.Optional[JobsListRequestOrder]
|
|
53
|
+
Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
54
|
+
|
|
55
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
56
|
+
Field to sort by
|
|
48
57
|
|
|
49
58
|
active : typing.Optional[bool]
|
|
50
59
|
Filter for active jobs.
|
|
51
60
|
|
|
52
61
|
ascending : typing.Optional[bool]
|
|
53
|
-
Whether to sort jobs oldest to newest (True, default) or newest to oldest (False)
|
|
62
|
+
Whether to sort jobs oldest to newest (True, default) or newest to oldest (False). Deprecated in favor of order field.
|
|
54
63
|
|
|
55
64
|
request_options : typing.Optional[RequestOptions]
|
|
56
65
|
Request-specific configuration.
|
|
@@ -68,6 +77,8 @@ class RawJobsClient:
|
|
|
68
77
|
"before": before,
|
|
69
78
|
"after": after,
|
|
70
79
|
"limit": limit,
|
|
80
|
+
"order": order,
|
|
81
|
+
"order_by": order_by,
|
|
71
82
|
"active": active,
|
|
72
83
|
"ascending": ascending,
|
|
73
84
|
},
|
|
@@ -331,6 +342,8 @@ class AsyncRawJobsClient:
|
|
|
331
342
|
before: typing.Optional[str] = None,
|
|
332
343
|
after: typing.Optional[str] = None,
|
|
333
344
|
limit: typing.Optional[int] = None,
|
|
345
|
+
order: typing.Optional[JobsListRequestOrder] = None,
|
|
346
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
334
347
|
active: typing.Optional[bool] = None,
|
|
335
348
|
ascending: typing.Optional[bool] = None,
|
|
336
349
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -344,19 +357,25 @@ class AsyncRawJobsClient:
|
|
|
344
357
|
Only list jobs associated with the source.
|
|
345
358
|
|
|
346
359
|
before : typing.Optional[str]
|
|
347
|
-
|
|
360
|
+
Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order
|
|
348
361
|
|
|
349
362
|
after : typing.Optional[str]
|
|
350
|
-
|
|
363
|
+
Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order
|
|
351
364
|
|
|
352
365
|
limit : typing.Optional[int]
|
|
353
|
-
|
|
366
|
+
Maximum number of jobs to return
|
|
367
|
+
|
|
368
|
+
order : typing.Optional[JobsListRequestOrder]
|
|
369
|
+
Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
370
|
+
|
|
371
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
372
|
+
Field to sort by
|
|
354
373
|
|
|
355
374
|
active : typing.Optional[bool]
|
|
356
375
|
Filter for active jobs.
|
|
357
376
|
|
|
358
377
|
ascending : typing.Optional[bool]
|
|
359
|
-
Whether to sort jobs oldest to newest (True, default) or newest to oldest (False)
|
|
378
|
+
Whether to sort jobs oldest to newest (True, default) or newest to oldest (False). Deprecated in favor of order field.
|
|
360
379
|
|
|
361
380
|
request_options : typing.Optional[RequestOptions]
|
|
362
381
|
Request-specific configuration.
|
|
@@ -374,6 +393,8 @@ class AsyncRawJobsClient:
|
|
|
374
393
|
"before": before,
|
|
375
394
|
"after": after,
|
|
376
395
|
"limit": limit,
|
|
396
|
+
"order": order,
|
|
397
|
+
"order_by": order_by,
|
|
377
398
|
"active": active,
|
|
378
399
|
"ascending": ascending,
|
|
379
400
|
},
|
letta_client/models/client.py
CHANGED
|
@@ -62,7 +62,10 @@ class ModelsClient:
|
|
|
62
62
|
project="YOUR_PROJECT",
|
|
63
63
|
token="YOUR_TOKEN",
|
|
64
64
|
)
|
|
65
|
-
client.models.list(
|
|
65
|
+
client.models.list(
|
|
66
|
+
provider_name="provider_name",
|
|
67
|
+
provider_type="anthropic",
|
|
68
|
+
)
|
|
66
69
|
"""
|
|
67
70
|
_response = self._raw_client.list(
|
|
68
71
|
provider_category=provider_category,
|
|
@@ -153,7 +156,10 @@ class AsyncModelsClient:
|
|
|
153
156
|
|
|
154
157
|
|
|
155
158
|
async def main() -> None:
|
|
156
|
-
await client.models.list(
|
|
159
|
+
await client.models.list(
|
|
160
|
+
provider_name="provider_name",
|
|
161
|
+
provider_type="anthropic",
|
|
162
|
+
)
|
|
157
163
|
|
|
158
164
|
|
|
159
165
|
asyncio.run(main())
|
letta_client/projects/client.py
CHANGED
|
@@ -58,7 +58,11 @@ class ProjectsClient:
|
|
|
58
58
|
project="YOUR_PROJECT",
|
|
59
59
|
token="YOUR_TOKEN",
|
|
60
60
|
)
|
|
61
|
-
client.projects.list(
|
|
61
|
+
client.projects.list(
|
|
62
|
+
name="name",
|
|
63
|
+
offset="offset",
|
|
64
|
+
limit="limit",
|
|
65
|
+
)
|
|
62
66
|
"""
|
|
63
67
|
_response = self._raw_client.list(name=name, offset=offset, limit=limit, request_options=request_options)
|
|
64
68
|
return _response.data
|
|
@@ -119,7 +123,11 @@ class AsyncProjectsClient:
|
|
|
119
123
|
|
|
120
124
|
|
|
121
125
|
async def main() -> None:
|
|
122
|
-
await client.projects.list(
|
|
126
|
+
await client.projects.list(
|
|
127
|
+
name="name",
|
|
128
|
+
offset="offset",
|
|
129
|
+
limit="limit",
|
|
130
|
+
)
|
|
123
131
|
|
|
124
132
|
|
|
125
133
|
asyncio.run(main())
|
letta_client/providers/client.py
CHANGED
|
@@ -82,7 +82,14 @@ class ProvidersClient:
|
|
|
82
82
|
project="YOUR_PROJECT",
|
|
83
83
|
token="YOUR_TOKEN",
|
|
84
84
|
)
|
|
85
|
-
client.providers.list(
|
|
85
|
+
client.providers.list(
|
|
86
|
+
before="before",
|
|
87
|
+
after="after",
|
|
88
|
+
limit=1,
|
|
89
|
+
order="asc",
|
|
90
|
+
name="name",
|
|
91
|
+
provider_type="anthropic",
|
|
92
|
+
)
|
|
86
93
|
"""
|
|
87
94
|
_response = self._raw_client.list(
|
|
88
95
|
before=before,
|
|
@@ -365,6 +372,39 @@ class ProvidersClient:
|
|
|
365
372
|
)
|
|
366
373
|
return _response.data
|
|
367
374
|
|
|
375
|
+
def check_existing_provider(
|
|
376
|
+
self, provider_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
377
|
+
) -> typing.Optional[typing.Any]:
|
|
378
|
+
"""
|
|
379
|
+
Verify the API key and additional parameters for an existing provider.
|
|
380
|
+
|
|
381
|
+
Parameters
|
|
382
|
+
----------
|
|
383
|
+
provider_id : str
|
|
384
|
+
|
|
385
|
+
request_options : typing.Optional[RequestOptions]
|
|
386
|
+
Request-specific configuration.
|
|
387
|
+
|
|
388
|
+
Returns
|
|
389
|
+
-------
|
|
390
|
+
typing.Optional[typing.Any]
|
|
391
|
+
Successful Response
|
|
392
|
+
|
|
393
|
+
Examples
|
|
394
|
+
--------
|
|
395
|
+
from letta_client import Letta
|
|
396
|
+
|
|
397
|
+
client = Letta(
|
|
398
|
+
project="YOUR_PROJECT",
|
|
399
|
+
token="YOUR_TOKEN",
|
|
400
|
+
)
|
|
401
|
+
client.providers.check_existing_provider(
|
|
402
|
+
provider_id="provider_id",
|
|
403
|
+
)
|
|
404
|
+
"""
|
|
405
|
+
_response = self._raw_client.check_existing_provider(provider_id, request_options=request_options)
|
|
406
|
+
return _response.data
|
|
407
|
+
|
|
368
408
|
|
|
369
409
|
class AsyncProvidersClient:
|
|
370
410
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -440,7 +480,14 @@ class AsyncProvidersClient:
|
|
|
440
480
|
|
|
441
481
|
|
|
442
482
|
async def main() -> None:
|
|
443
|
-
await client.providers.list(
|
|
483
|
+
await client.providers.list(
|
|
484
|
+
before="before",
|
|
485
|
+
after="after",
|
|
486
|
+
limit=1,
|
|
487
|
+
order="asc",
|
|
488
|
+
name="name",
|
|
489
|
+
provider_type="anthropic",
|
|
490
|
+
)
|
|
444
491
|
|
|
445
492
|
|
|
446
493
|
asyncio.run(main())
|
|
@@ -765,3 +812,44 @@ class AsyncProvidersClient:
|
|
|
765
812
|
request_options=request_options,
|
|
766
813
|
)
|
|
767
814
|
return _response.data
|
|
815
|
+
|
|
816
|
+
async def check_existing_provider(
|
|
817
|
+
self, provider_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
818
|
+
) -> typing.Optional[typing.Any]:
|
|
819
|
+
"""
|
|
820
|
+
Verify the API key and additional parameters for an existing provider.
|
|
821
|
+
|
|
822
|
+
Parameters
|
|
823
|
+
----------
|
|
824
|
+
provider_id : str
|
|
825
|
+
|
|
826
|
+
request_options : typing.Optional[RequestOptions]
|
|
827
|
+
Request-specific configuration.
|
|
828
|
+
|
|
829
|
+
Returns
|
|
830
|
+
-------
|
|
831
|
+
typing.Optional[typing.Any]
|
|
832
|
+
Successful Response
|
|
833
|
+
|
|
834
|
+
Examples
|
|
835
|
+
--------
|
|
836
|
+
import asyncio
|
|
837
|
+
|
|
838
|
+
from letta_client import AsyncLetta
|
|
839
|
+
|
|
840
|
+
client = AsyncLetta(
|
|
841
|
+
project="YOUR_PROJECT",
|
|
842
|
+
token="YOUR_TOKEN",
|
|
843
|
+
)
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
async def main() -> None:
|
|
847
|
+
await client.providers.check_existing_provider(
|
|
848
|
+
provider_id="provider_id",
|
|
849
|
+
)
|
|
850
|
+
|
|
851
|
+
|
|
852
|
+
asyncio.run(main())
|
|
853
|
+
"""
|
|
854
|
+
_response = await self._raw_client.check_existing_provider(provider_id, request_options=request_options)
|
|
855
|
+
return _response.data
|
|
@@ -469,6 +469,57 @@ class RawProvidersClient:
|
|
|
469
469
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
470
470
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
471
471
|
|
|
472
|
+
def check_existing_provider(
|
|
473
|
+
self, provider_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
474
|
+
) -> HttpResponse[typing.Optional[typing.Any]]:
|
|
475
|
+
"""
|
|
476
|
+
Verify the API key and additional parameters for an existing provider.
|
|
477
|
+
|
|
478
|
+
Parameters
|
|
479
|
+
----------
|
|
480
|
+
provider_id : str
|
|
481
|
+
|
|
482
|
+
request_options : typing.Optional[RequestOptions]
|
|
483
|
+
Request-specific configuration.
|
|
484
|
+
|
|
485
|
+
Returns
|
|
486
|
+
-------
|
|
487
|
+
HttpResponse[typing.Optional[typing.Any]]
|
|
488
|
+
Successful Response
|
|
489
|
+
"""
|
|
490
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
491
|
+
f"v1/providers/{jsonable_encoder(provider_id)}/check",
|
|
492
|
+
method="POST",
|
|
493
|
+
request_options=request_options,
|
|
494
|
+
)
|
|
495
|
+
try:
|
|
496
|
+
if _response is None or not _response.text.strip():
|
|
497
|
+
return HttpResponse(response=_response, data=None)
|
|
498
|
+
if 200 <= _response.status_code < 300:
|
|
499
|
+
_data = typing.cast(
|
|
500
|
+
typing.Optional[typing.Any],
|
|
501
|
+
construct_type(
|
|
502
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
503
|
+
object_=_response.json(),
|
|
504
|
+
),
|
|
505
|
+
)
|
|
506
|
+
return HttpResponse(response=_response, data=_data)
|
|
507
|
+
if _response.status_code == 422:
|
|
508
|
+
raise UnprocessableEntityError(
|
|
509
|
+
headers=dict(_response.headers),
|
|
510
|
+
body=typing.cast(
|
|
511
|
+
HttpValidationError,
|
|
512
|
+
construct_type(
|
|
513
|
+
type_=HttpValidationError, # type: ignore
|
|
514
|
+
object_=_response.json(),
|
|
515
|
+
),
|
|
516
|
+
),
|
|
517
|
+
)
|
|
518
|
+
_response_json = _response.json()
|
|
519
|
+
except JSONDecodeError:
|
|
520
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
521
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
522
|
+
|
|
472
523
|
|
|
473
524
|
class AsyncRawProvidersClient:
|
|
474
525
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -919,3 +970,54 @@ class AsyncRawProvidersClient:
|
|
|
919
970
|
except JSONDecodeError:
|
|
920
971
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
921
972
|
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
973
|
+
|
|
974
|
+
async def check_existing_provider(
|
|
975
|
+
self, provider_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
976
|
+
) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
|
|
977
|
+
"""
|
|
978
|
+
Verify the API key and additional parameters for an existing provider.
|
|
979
|
+
|
|
980
|
+
Parameters
|
|
981
|
+
----------
|
|
982
|
+
provider_id : str
|
|
983
|
+
|
|
984
|
+
request_options : typing.Optional[RequestOptions]
|
|
985
|
+
Request-specific configuration.
|
|
986
|
+
|
|
987
|
+
Returns
|
|
988
|
+
-------
|
|
989
|
+
AsyncHttpResponse[typing.Optional[typing.Any]]
|
|
990
|
+
Successful Response
|
|
991
|
+
"""
|
|
992
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
993
|
+
f"v1/providers/{jsonable_encoder(provider_id)}/check",
|
|
994
|
+
method="POST",
|
|
995
|
+
request_options=request_options,
|
|
996
|
+
)
|
|
997
|
+
try:
|
|
998
|
+
if _response is None or not _response.text.strip():
|
|
999
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
1000
|
+
if 200 <= _response.status_code < 300:
|
|
1001
|
+
_data = typing.cast(
|
|
1002
|
+
typing.Optional[typing.Any],
|
|
1003
|
+
construct_type(
|
|
1004
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
1005
|
+
object_=_response.json(),
|
|
1006
|
+
),
|
|
1007
|
+
)
|
|
1008
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
1009
|
+
if _response.status_code == 422:
|
|
1010
|
+
raise UnprocessableEntityError(
|
|
1011
|
+
headers=dict(_response.headers),
|
|
1012
|
+
body=typing.cast(
|
|
1013
|
+
HttpValidationError,
|
|
1014
|
+
construct_type(
|
|
1015
|
+
type_=HttpValidationError, # type: ignore
|
|
1016
|
+
object_=_response.json(),
|
|
1017
|
+
),
|
|
1018
|
+
),
|
|
1019
|
+
)
|
|
1020
|
+
_response_json = _response.json()
|
|
1021
|
+
except JSONDecodeError:
|
|
1022
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
1023
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
letta_client/runs/__init__.py
CHANGED
|
@@ -2,8 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
|
-
from .types import LettaStreamingResponse
|
|
5
|
+
from .types import LettaStreamingResponse, RunsListRequestOrder
|
|
6
6
|
from . import messages, steps, usage
|
|
7
7
|
from .messages import MessagesListRequestOrder
|
|
8
|
+
from .steps import StepsListRequestOrder
|
|
8
9
|
|
|
9
|
-
__all__ = [
|
|
10
|
+
__all__ = [
|
|
11
|
+
"LettaStreamingResponse",
|
|
12
|
+
"MessagesListRequestOrder",
|
|
13
|
+
"RunsListRequestOrder",
|
|
14
|
+
"StepsListRequestOrder",
|
|
15
|
+
"messages",
|
|
16
|
+
"steps",
|
|
17
|
+
"usage",
|
|
18
|
+
]
|