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
|
@@ -28,6 +28,7 @@ from ...types.run import Run
|
|
|
28
28
|
from .types.letta_async_request_messages_item import LettaAsyncRequestMessagesItem
|
|
29
29
|
from .types.letta_streaming_response import LettaStreamingResponse
|
|
30
30
|
from .types.message_search_request_search_mode import MessageSearchRequestSearchMode
|
|
31
|
+
from .types.messages_list_request_order import MessagesListRequestOrder
|
|
31
32
|
from .types.messages_modify_request import MessagesModifyRequest
|
|
32
33
|
from .types.messages_modify_response import MessagesModifyResponse
|
|
33
34
|
from .types.messages_preview_request import MessagesPreviewRequest
|
|
@@ -44,9 +45,11 @@ class RawMessagesClient:
|
|
|
44
45
|
self,
|
|
45
46
|
agent_id: str,
|
|
46
47
|
*,
|
|
47
|
-
after: typing.Optional[str] = None,
|
|
48
48
|
before: typing.Optional[str] = None,
|
|
49
|
+
after: typing.Optional[str] = None,
|
|
49
50
|
limit: typing.Optional[int] = None,
|
|
51
|
+
order: typing.Optional[MessagesListRequestOrder] = None,
|
|
52
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
50
53
|
group_id: typing.Optional[str] = None,
|
|
51
54
|
use_assistant_message: typing.Optional[bool] = None,
|
|
52
55
|
assistant_message_tool_name: typing.Optional[str] = None,
|
|
@@ -61,14 +64,20 @@ class RawMessagesClient:
|
|
|
61
64
|
----------
|
|
62
65
|
agent_id : str
|
|
63
66
|
|
|
64
|
-
after : typing.Optional[str]
|
|
65
|
-
Message after which to retrieve the returned messages.
|
|
66
|
-
|
|
67
67
|
before : typing.Optional[str]
|
|
68
|
-
Message before
|
|
68
|
+
Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order
|
|
69
|
+
|
|
70
|
+
after : typing.Optional[str]
|
|
71
|
+
Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order
|
|
69
72
|
|
|
70
73
|
limit : typing.Optional[int]
|
|
71
|
-
Maximum number of messages to
|
|
74
|
+
Maximum number of messages to return
|
|
75
|
+
|
|
76
|
+
order : typing.Optional[MessagesListRequestOrder]
|
|
77
|
+
Sort order for messages 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
|
|
72
81
|
|
|
73
82
|
group_id : typing.Optional[str]
|
|
74
83
|
Group ID to filter messages by.
|
|
@@ -97,9 +106,11 @@ class RawMessagesClient:
|
|
|
97
106
|
f"v1/agents/{jsonable_encoder(agent_id)}/messages",
|
|
98
107
|
method="GET",
|
|
99
108
|
params={
|
|
100
|
-
"after": after,
|
|
101
109
|
"before": before,
|
|
110
|
+
"after": after,
|
|
102
111
|
"limit": limit,
|
|
112
|
+
"order": order,
|
|
113
|
+
"order_by": order_by,
|
|
103
114
|
"group_id": group_id,
|
|
104
115
|
"use_assistant_message": use_assistant_message,
|
|
105
116
|
"assistant_message_tool_name": assistant_message_tool_name,
|
|
@@ -871,9 +882,11 @@ class AsyncRawMessagesClient:
|
|
|
871
882
|
self,
|
|
872
883
|
agent_id: str,
|
|
873
884
|
*,
|
|
874
|
-
after: typing.Optional[str] = None,
|
|
875
885
|
before: typing.Optional[str] = None,
|
|
886
|
+
after: typing.Optional[str] = None,
|
|
876
887
|
limit: typing.Optional[int] = None,
|
|
888
|
+
order: typing.Optional[MessagesListRequestOrder] = None,
|
|
889
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
877
890
|
group_id: typing.Optional[str] = None,
|
|
878
891
|
use_assistant_message: typing.Optional[bool] = None,
|
|
879
892
|
assistant_message_tool_name: typing.Optional[str] = None,
|
|
@@ -888,14 +901,20 @@ class AsyncRawMessagesClient:
|
|
|
888
901
|
----------
|
|
889
902
|
agent_id : str
|
|
890
903
|
|
|
891
|
-
after : typing.Optional[str]
|
|
892
|
-
Message after which to retrieve the returned messages.
|
|
893
|
-
|
|
894
904
|
before : typing.Optional[str]
|
|
895
|
-
Message before
|
|
905
|
+
Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order
|
|
906
|
+
|
|
907
|
+
after : typing.Optional[str]
|
|
908
|
+
Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order
|
|
896
909
|
|
|
897
910
|
limit : typing.Optional[int]
|
|
898
|
-
Maximum number of messages to
|
|
911
|
+
Maximum number of messages to return
|
|
912
|
+
|
|
913
|
+
order : typing.Optional[MessagesListRequestOrder]
|
|
914
|
+
Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
915
|
+
|
|
916
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
917
|
+
Field to sort by
|
|
899
918
|
|
|
900
919
|
group_id : typing.Optional[str]
|
|
901
920
|
Group ID to filter messages by.
|
|
@@ -924,9 +943,11 @@ class AsyncRawMessagesClient:
|
|
|
924
943
|
f"v1/agents/{jsonable_encoder(agent_id)}/messages",
|
|
925
944
|
method="GET",
|
|
926
945
|
params={
|
|
927
|
-
"after": after,
|
|
928
946
|
"before": before,
|
|
947
|
+
"after": after,
|
|
929
948
|
"limit": limit,
|
|
949
|
+
"order": order,
|
|
950
|
+
"order_by": order_by,
|
|
930
951
|
"group_id": group_id,
|
|
931
952
|
"use_assistant_message": use_assistant_message,
|
|
932
953
|
"assistant_message_tool_name": assistant_message_tool_name,
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
from .letta_async_request_messages_item import LettaAsyncRequestMessagesItem
|
|
6
6
|
from .letta_streaming_response import LettaStreamingResponse
|
|
7
7
|
from .message_search_request_search_mode import MessageSearchRequestSearchMode
|
|
8
|
+
from .messages_list_request_order import MessagesListRequestOrder
|
|
8
9
|
from .messages_modify_request import MessagesModifyRequest
|
|
9
10
|
from .messages_modify_response import MessagesModifyResponse
|
|
10
11
|
from .messages_preview_request import MessagesPreviewRequest
|
|
@@ -13,6 +14,7 @@ __all__ = [
|
|
|
13
14
|
"LettaAsyncRequestMessagesItem",
|
|
14
15
|
"LettaStreamingResponse",
|
|
15
16
|
"MessageSearchRequestSearchMode",
|
|
17
|
+
"MessagesListRequestOrder",
|
|
16
18
|
"MessagesModifyRequest",
|
|
17
19
|
"MessagesModifyResponse",
|
|
18
20
|
"MessagesPreviewRequest",
|
|
@@ -80,6 +80,11 @@ class PassagesClient:
|
|
|
80
80
|
)
|
|
81
81
|
client.agents.passages.list(
|
|
82
82
|
agent_id="agent_id",
|
|
83
|
+
after="after",
|
|
84
|
+
before="before",
|
|
85
|
+
limit=1,
|
|
86
|
+
search="search",
|
|
87
|
+
ascending=True,
|
|
83
88
|
)
|
|
84
89
|
"""
|
|
85
90
|
_response = self._raw_client.list(
|
|
@@ -195,6 +200,8 @@ class PassagesClient:
|
|
|
195
200
|
|
|
196
201
|
Examples
|
|
197
202
|
--------
|
|
203
|
+
import datetime
|
|
204
|
+
|
|
198
205
|
from letta_client import Letta
|
|
199
206
|
|
|
200
207
|
client = Letta(
|
|
@@ -204,6 +211,14 @@ class PassagesClient:
|
|
|
204
211
|
client.agents.passages.search(
|
|
205
212
|
agent_id="agent_id",
|
|
206
213
|
query="query",
|
|
214
|
+
tag_match_mode="any",
|
|
215
|
+
top_k=1,
|
|
216
|
+
start_datetime=datetime.datetime.fromisoformat(
|
|
217
|
+
"2024-01-15 09:30:00+00:00",
|
|
218
|
+
),
|
|
219
|
+
end_datetime=datetime.datetime.fromisoformat(
|
|
220
|
+
"2024-01-15 09:30:00+00:00",
|
|
221
|
+
),
|
|
207
222
|
)
|
|
208
223
|
"""
|
|
209
224
|
_response = self._raw_client.search(
|
|
@@ -357,6 +372,11 @@ class AsyncPassagesClient:
|
|
|
357
372
|
async def main() -> None:
|
|
358
373
|
await client.agents.passages.list(
|
|
359
374
|
agent_id="agent_id",
|
|
375
|
+
after="after",
|
|
376
|
+
before="before",
|
|
377
|
+
limit=1,
|
|
378
|
+
search="search",
|
|
379
|
+
ascending=True,
|
|
360
380
|
)
|
|
361
381
|
|
|
362
382
|
|
|
@@ -484,6 +504,7 @@ class AsyncPassagesClient:
|
|
|
484
504
|
Examples
|
|
485
505
|
--------
|
|
486
506
|
import asyncio
|
|
507
|
+
import datetime
|
|
487
508
|
|
|
488
509
|
from letta_client import AsyncLetta
|
|
489
510
|
|
|
@@ -497,6 +518,14 @@ class AsyncPassagesClient:
|
|
|
497
518
|
await client.agents.passages.search(
|
|
498
519
|
agent_id="agent_id",
|
|
499
520
|
query="query",
|
|
521
|
+
tag_match_mode="any",
|
|
522
|
+
top_k=1,
|
|
523
|
+
start_datetime=datetime.datetime.fromisoformat(
|
|
524
|
+
"2024-01-15 09:30:00+00:00",
|
|
525
|
+
),
|
|
526
|
+
end_datetime=datetime.datetime.fromisoformat(
|
|
527
|
+
"2024-01-15 09:30:00+00:00",
|
|
528
|
+
),
|
|
500
529
|
)
|
|
501
530
|
|
|
502
531
|
|
|
@@ -311,10 +311,10 @@ class RawAgentsClient:
|
|
|
311
311
|
Whether to enable reasoning for this agent.
|
|
312
312
|
|
|
313
313
|
from_template : typing.Optional[str]
|
|
314
|
-
|
|
314
|
+
Deprecated: please use the 'create agents from a template' endpoint instead.
|
|
315
315
|
|
|
316
316
|
template : typing.Optional[bool]
|
|
317
|
-
|
|
317
|
+
Deprecated: No longer used
|
|
318
318
|
|
|
319
319
|
project : typing.Optional[str]
|
|
320
320
|
Deprecated: Project should now be passed via the X-Project header instead of in the request body. If using the sdk, this can be done via the new x_project field below.
|
|
@@ -1352,10 +1352,10 @@ class AsyncRawAgentsClient:
|
|
|
1352
1352
|
Whether to enable reasoning for this agent.
|
|
1353
1353
|
|
|
1354
1354
|
from_template : typing.Optional[str]
|
|
1355
|
-
|
|
1355
|
+
Deprecated: please use the 'create agents from a template' endpoint instead.
|
|
1356
1356
|
|
|
1357
1357
|
template : typing.Optional[bool]
|
|
1358
|
-
|
|
1358
|
+
Deprecated: No longer used
|
|
1359
1359
|
|
|
1360
1360
|
project : typing.Optional[str]
|
|
1361
1361
|
Deprecated: Project should now be passed via the X-Project header instead of in the request body. If using the sdk, this can be done via the new x_project field below.
|
|
@@ -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 AsyncRawSourcesClient, RawSourcesClient
|
|
10
|
+
from .types.sources_list_request_order import SourcesListRequestOrder
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class SourcesClient:
|
|
@@ -96,7 +97,17 @@ class SourcesClient:
|
|
|
96
97
|
_response = self._raw_client.detach(agent_id, source_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[SourcesListRequestOrder] = 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 sources associated with an agent.
|
|
102
113
|
|
|
@@ -104,6 +115,21 @@ class SourcesClient:
|
|
|
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[SourcesListRequestOrder]
|
|
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 SourcesClient:
|
|
|
122
148
|
)
|
|
123
149
|
client.agents.sources.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 AsyncSourcesClient:
|
|
|
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[SourcesListRequestOrder] = 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 sources associated with an agent.
|
|
@@ -241,6 +287,21 @@ class AsyncSourcesClient:
|
|
|
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[SourcesListRequestOrder]
|
|
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 AsyncSourcesClient:
|
|
|
264
325
|
async def main() -> None:
|
|
265
326
|
await client.agents.sources.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.sources_list_request_order import SourcesListRequestOrder
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
class RawSourcesClient:
|
|
@@ -122,7 +123,15 @@ class RawSourcesClient:
|
|
|
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[SourcesListRequestOrder] = 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 sources associated with an agent.
|
|
@@ -131,6 +140,21 @@ class RawSourcesClient:
|
|
|
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[SourcesListRequestOrder]
|
|
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 RawSourcesClient:
|
|
|
142
166
|
_response = self._client_wrapper.httpx_client.request(
|
|
143
167
|
f"v1/agents/{jsonable_encoder(agent_id)}/sources",
|
|
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 AsyncRawSourcesClient:
|
|
|
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[SourcesListRequestOrder] = 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 sources associated with an agent.
|
|
@@ -287,6 +326,21 @@ class AsyncRawSourcesClient:
|
|
|
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[SourcesListRequestOrder]
|
|
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 AsyncRawSourcesClient:
|
|
|
298
352
|
_response = await self._client_wrapper.httpx_client.request(
|
|
299
353
|
f"v1/agents/{jsonable_encoder(agent_id)}/sources",
|
|
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:
|
|
@@ -7,6 +7,7 @@ from ...core.request_options import RequestOptions
|
|
|
7
7
|
from ...types.agent_state import AgentState
|
|
8
8
|
from ...types.tool import Tool
|
|
9
9
|
from .raw_client import AsyncRawToolsClient, RawToolsClient
|
|
10
|
+
from .types.tools_list_request_order import ToolsListRequestOrder
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class ToolsClient:
|
|
@@ -24,7 +25,17 @@ class ToolsClient:
|
|
|
24
25
|
"""
|
|
25
26
|
return self._raw_client
|
|
26
27
|
|
|
27
|
-
def list(
|
|
28
|
+
def list(
|
|
29
|
+
self,
|
|
30
|
+
agent_id: str,
|
|
31
|
+
*,
|
|
32
|
+
before: typing.Optional[str] = None,
|
|
33
|
+
after: typing.Optional[str] = None,
|
|
34
|
+
limit: typing.Optional[int] = None,
|
|
35
|
+
order: typing.Optional[ToolsListRequestOrder] = None,
|
|
36
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
37
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
38
|
+
) -> typing.List[Tool]:
|
|
28
39
|
"""
|
|
29
40
|
Get tools from an existing agent
|
|
30
41
|
|
|
@@ -32,6 +43,21 @@ class ToolsClient:
|
|
|
32
43
|
----------
|
|
33
44
|
agent_id : str
|
|
34
45
|
|
|
46
|
+
before : typing.Optional[str]
|
|
47
|
+
Tool ID cursor for pagination. Returns tools that come before this tool ID in the specified sort order
|
|
48
|
+
|
|
49
|
+
after : typing.Optional[str]
|
|
50
|
+
Tool ID cursor for pagination. Returns tools that come after this tool ID in the specified sort order
|
|
51
|
+
|
|
52
|
+
limit : typing.Optional[int]
|
|
53
|
+
Maximum number of tools to return
|
|
54
|
+
|
|
55
|
+
order : typing.Optional[ToolsListRequestOrder]
|
|
56
|
+
Sort order for tools by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
57
|
+
|
|
58
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
59
|
+
Field to sort by
|
|
60
|
+
|
|
35
61
|
request_options : typing.Optional[RequestOptions]
|
|
36
62
|
Request-specific configuration.
|
|
37
63
|
|
|
@@ -50,9 +76,21 @@ class ToolsClient:
|
|
|
50
76
|
)
|
|
51
77
|
client.agents.tools.list(
|
|
52
78
|
agent_id="agent_id",
|
|
79
|
+
before="before",
|
|
80
|
+
after="after",
|
|
81
|
+
limit=1,
|
|
82
|
+
order="asc",
|
|
53
83
|
)
|
|
54
84
|
"""
|
|
55
|
-
_response = self._raw_client.list(
|
|
85
|
+
_response = self._raw_client.list(
|
|
86
|
+
agent_id,
|
|
87
|
+
before=before,
|
|
88
|
+
after=after,
|
|
89
|
+
limit=limit,
|
|
90
|
+
order=order,
|
|
91
|
+
order_by=order_by,
|
|
92
|
+
request_options=request_options,
|
|
93
|
+
)
|
|
56
94
|
return _response.data
|
|
57
95
|
|
|
58
96
|
def attach(
|
|
@@ -190,7 +228,15 @@ class AsyncToolsClient:
|
|
|
190
228
|
return self._raw_client
|
|
191
229
|
|
|
192
230
|
async def list(
|
|
193
|
-
self,
|
|
231
|
+
self,
|
|
232
|
+
agent_id: str,
|
|
233
|
+
*,
|
|
234
|
+
before: typing.Optional[str] = None,
|
|
235
|
+
after: typing.Optional[str] = None,
|
|
236
|
+
limit: typing.Optional[int] = None,
|
|
237
|
+
order: typing.Optional[ToolsListRequestOrder] = None,
|
|
238
|
+
order_by: typing.Optional[typing.Literal["created_at"]] = None,
|
|
239
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
194
240
|
) -> typing.List[Tool]:
|
|
195
241
|
"""
|
|
196
242
|
Get tools from an existing agent
|
|
@@ -199,6 +245,21 @@ class AsyncToolsClient:
|
|
|
199
245
|
----------
|
|
200
246
|
agent_id : str
|
|
201
247
|
|
|
248
|
+
before : typing.Optional[str]
|
|
249
|
+
Tool ID cursor for pagination. Returns tools that come before this tool ID in the specified sort order
|
|
250
|
+
|
|
251
|
+
after : typing.Optional[str]
|
|
252
|
+
Tool ID cursor for pagination. Returns tools that come after this tool ID in the specified sort order
|
|
253
|
+
|
|
254
|
+
limit : typing.Optional[int]
|
|
255
|
+
Maximum number of tools to return
|
|
256
|
+
|
|
257
|
+
order : typing.Optional[ToolsListRequestOrder]
|
|
258
|
+
Sort order for tools by creation time. 'asc' for oldest first, 'desc' for newest first
|
|
259
|
+
|
|
260
|
+
order_by : typing.Optional[typing.Literal["created_at"]]
|
|
261
|
+
Field to sort by
|
|
262
|
+
|
|
202
263
|
request_options : typing.Optional[RequestOptions]
|
|
203
264
|
Request-specific configuration.
|
|
204
265
|
|
|
@@ -222,12 +283,24 @@ class AsyncToolsClient:
|
|
|
222
283
|
async def main() -> None:
|
|
223
284
|
await client.agents.tools.list(
|
|
224
285
|
agent_id="agent_id",
|
|
286
|
+
before="before",
|
|
287
|
+
after="after",
|
|
288
|
+
limit=1,
|
|
289
|
+
order="asc",
|
|
225
290
|
)
|
|
226
291
|
|
|
227
292
|
|
|
228
293
|
asyncio.run(main())
|
|
229
294
|
"""
|
|
230
|
-
_response = await self._raw_client.list(
|
|
295
|
+
_response = await self._raw_client.list(
|
|
296
|
+
agent_id,
|
|
297
|
+
before=before,
|
|
298
|
+
after=after,
|
|
299
|
+
limit=limit,
|
|
300
|
+
order=order,
|
|
301
|
+
order_by=order_by,
|
|
302
|
+
request_options=request_options,
|
|
303
|
+
)
|
|
231
304
|
return _response.data
|
|
232
305
|
|
|
233
306
|
async def attach(
|