letta-client 0.1.17__py3-none-any.whl → 0.1.21__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.
- letta_client/__init__.py +44 -116
- letta_client/agents/__init__.py +18 -42
- letta_client/agents/archival_memory/client.py +6 -6
- letta_client/agents/client.py +28 -18
- letta_client/agents/context/client.py +6 -4
- letta_client/agents/core_memory/client.py +152 -227
- letta_client/agents/memory_variables/__init__.py +2 -2
- letta_client/agents/memory_variables/client.py +15 -15
- letta_client/agents/memory_variables/types/__init__.py +2 -2
- letta_client/agents/memory_variables/types/{memory_variables_get_response.py → memory_variables_list_response.py} +1 -1
- letta_client/agents/messages/__init__.py +2 -22
- letta_client/agents/messages/client.py +39 -40
- letta_client/agents/messages/types/__init__.py +3 -21
- letta_client/agents/messages/types/letta_streaming_response.py +16 -139
- letta_client/agents/messages/types/message_update_content.py +6 -0
- letta_client/agents/messages/types/messages_list_response.py +2 -2
- letta_client/agents/sources/client.py +266 -5
- letta_client/agents/tools/client.py +25 -27
- letta_client/agents/types/__init__.py +15 -25
- letta_client/agents/types/agents_search_request_search_item.py +10 -78
- letta_client/agents/types/{agents_search_request_search_item_order_by.py → agents_search_request_search_item_direction.py} +7 -6
- letta_client/agents/types/agents_search_request_search_item_direction_direction.py +5 -0
- letta_client/agents/types/agents_search_request_search_item_direction_value.py +5 -0
- letta_client/agents/types/{agents_search_request_search_item_name.py → agents_search_request_search_item_one.py} +5 -4
- letta_client/agents/types/agents_search_request_search_item_one_operator.py +5 -0
- letta_client/agents/types/{agents_search_request_search_item_tags.py → agents_search_request_search_item_two.py} +2 -1
- letta_client/agents/types/{agents_search_request_search_item_version.py → agents_search_request_search_item_zero.py} +3 -2
- letta_client/blocks/client.py +45 -166
- letta_client/client.py +3 -3
- letta_client/core/client_wrapper.py +1 -1
- letta_client/jobs/client.py +4 -4
- letta_client/providers/client.py +10 -10
- letta_client/runs/client.py +44 -30
- letta_client/sources/client.py +12 -288
- letta_client/sources/files/client.py +6 -6
- letta_client/tag/client.py +6 -6
- letta_client/tools/client.py +69 -75
- letta_client/types/__init__.py +31 -99
- letta_client/types/agent_state.py +3 -7
- letta_client/types/{letta_schemas_openai_chat_completion_response_tool_call.py → assistant_message.py} +6 -4
- letta_client/types/assistant_message_content.py +6 -0
- letta_client/types/block.py +2 -6
- letta_client/types/block_update.py +1 -5
- letta_client/types/{assistant_message_output.py → chat_completion_message_tool_call.py} +5 -5
- letta_client/types/context_window_overview.py +4 -6
- letta_client/types/create_block.py +1 -5
- letta_client/types/{function_call_output.py → function.py} +1 -1
- letta_client/types/{function_schema.py → function_definition.py} +2 -1
- letta_client/types/{function_call_input.py → function_tool.py} +5 -3
- letta_client/types/job.py +1 -5
- letta_client/types/letta_message_union.py +9 -121
- letta_client/types/letta_usage_statistics.py +1 -0
- letta_client/types/llm_config.py +6 -0
- letta_client/types/{letta_schemas_message_message.py → message.py} +7 -8
- letta_client/types/message_create.py +3 -2
- letta_client/types/message_create_content.py +6 -0
- letta_client/types/passage.py +1 -5
- letta_client/types/reasoning_message.py +2 -1
- letta_client/types/run.py +1 -5
- letta_client/types/source.py +2 -6
- letta_client/types/{system_message_output.py → system_message.py} +6 -4
- letta_client/types/system_message_content.py +6 -0
- letta_client/types/{create_assistant_file_request.py → text_content.py} +5 -4
- letta_client/types/{letta_schemas_tool_tool.py → tool.py} +1 -1
- letta_client/types/{letta_schemas_letta_message_tool_call.py → tool_call.py} +1 -1
- letta_client/types/tool_call_message.py +2 -1
- letta_client/types/tool_call_message_tool_call.py +2 -2
- letta_client/types/tool_return_message.py +2 -1
- letta_client/types/tool_type.py +2 -1
- letta_client/types/{user_message_output.py → user_message.py} +6 -4
- letta_client/types/user_message_content.py +6 -0
- {letta_client-0.1.17.dist-info → letta_client-0.1.21.dist-info}/METADATA +2 -2
- {letta_client-0.1.17.dist-info → letta_client-0.1.21.dist-info}/RECORD +74 -99
- letta_client/agents/types/agents_search_request_search_item_name_operator.py +0 -5
- letta_client/agents/types/agents_search_request_search_item_order_by_direction.py +0 -5
- letta_client/agents/types/agents_search_request_search_item_order_by_value.py +0 -5
- letta_client/types/assistant_file.py +0 -33
- letta_client/types/assistant_message_input.py +0 -23
- letta_client/types/chat_completion_request.py +0 -49
- letta_client/types/chat_completion_request_function_call.py +0 -6
- letta_client/types/chat_completion_request_messages_item.py +0 -11
- letta_client/types/chat_completion_request_stop.py +0 -5
- letta_client/types/chat_completion_request_tool_choice.py +0 -8
- letta_client/types/chat_completion_response.py +0 -32
- letta_client/types/choice.py +0 -25
- letta_client/types/create_assistant_request.py +0 -57
- letta_client/types/delete_assistant_file_response.py +0 -28
- letta_client/types/delete_assistant_response.py +0 -28
- letta_client/types/letta_schemas_openai_chat_completion_request_tool.py +0 -21
- letta_client/types/letta_schemas_openai_chat_completion_request_tool_call.py +0 -24
- letta_client/types/letta_schemas_openai_chat_completion_request_tool_call_function.py +0 -20
- letta_client/types/letta_schemas_openai_chat_completion_response_message.py +0 -24
- letta_client/types/letta_schemas_openai_chat_completions_tool_call_function.py +0 -27
- letta_client/types/letta_schemas_openai_chat_completions_tool_call_input.py +0 -29
- letta_client/types/letta_schemas_openai_chat_completions_tool_call_output.py +0 -29
- letta_client/types/log_prob_token.py +0 -21
- letta_client/types/message_content_log_prob.py +0 -23
- letta_client/types/open_ai_assistant.py +0 -67
- letta_client/types/response_format.py +0 -19
- letta_client/types/system_message_input.py +0 -21
- letta_client/types/tool_call_function_output.py +0 -27
- letta_client/types/tool_function_choice.py +0 -21
- letta_client/types/tool_input.py +0 -21
- letta_client/types/tool_message.py +0 -21
- letta_client/types/user_message_input.py +0 -22
- letta_client/types/user_message_input_content.py +0 -5
- {letta_client-0.1.17.dist-info → letta_client-0.1.21.dist-info}/WHEEL +0 -0
letta_client/types/__init__.py
CHANGED
|
@@ -10,37 +10,26 @@ from .agent_type import AgentType
|
|
|
10
10
|
from .app_auth_scheme import AppAuthScheme
|
|
11
11
|
from .app_auth_scheme_auth_mode import AppAuthSchemeAuthMode
|
|
12
12
|
from .app_model import AppModel
|
|
13
|
-
from .
|
|
14
|
-
from .
|
|
15
|
-
from .assistant_message_output import AssistantMessageOutput
|
|
13
|
+
from .assistant_message import AssistantMessage
|
|
14
|
+
from .assistant_message_content import AssistantMessageContent
|
|
16
15
|
from .auth_request import AuthRequest
|
|
17
16
|
from .auth_response import AuthResponse
|
|
18
17
|
from .auth_scheme_field import AuthSchemeField
|
|
19
18
|
from .block import Block
|
|
20
19
|
from .block_update import BlockUpdate
|
|
21
|
-
from .
|
|
22
|
-
from .chat_completion_request_function_call import ChatCompletionRequestFunctionCall
|
|
23
|
-
from .chat_completion_request_messages_item import ChatCompletionRequestMessagesItem
|
|
24
|
-
from .chat_completion_request_stop import ChatCompletionRequestStop
|
|
25
|
-
from .chat_completion_request_tool_choice import ChatCompletionRequestToolChoice
|
|
26
|
-
from .chat_completion_response import ChatCompletionResponse
|
|
20
|
+
from .chat_completion_message_tool_call import ChatCompletionMessageToolCall
|
|
27
21
|
from .child_tool_rule import ChildToolRule
|
|
28
|
-
from .choice import Choice
|
|
29
22
|
from .conditional_tool_rule import ConditionalToolRule
|
|
30
23
|
from .conflict_error_body import ConflictErrorBody
|
|
31
24
|
from .context_window_overview import ContextWindowOverview
|
|
32
|
-
from .create_assistant_file_request import CreateAssistantFileRequest
|
|
33
|
-
from .create_assistant_request import CreateAssistantRequest
|
|
34
25
|
from .create_block import CreateBlock
|
|
35
|
-
from .delete_assistant_file_response import DeleteAssistantFileResponse
|
|
36
|
-
from .delete_assistant_response import DeleteAssistantResponse
|
|
37
26
|
from .e_2_b_sandbox_config import E2BSandboxConfig
|
|
38
27
|
from .embedding_config import EmbeddingConfig
|
|
39
28
|
from .embedding_config_embedding_endpoint_type import EmbeddingConfigEmbeddingEndpointType
|
|
40
29
|
from .file_metadata import FileMetadata
|
|
41
|
-
from .
|
|
42
|
-
from .
|
|
43
|
-
from .
|
|
30
|
+
from .function import Function
|
|
31
|
+
from .function_definition import FunctionDefinition
|
|
32
|
+
from .function_tool import FunctionTool
|
|
44
33
|
from .health import Health
|
|
45
34
|
from .http_validation_error import HttpValidationError
|
|
46
35
|
from .init_tool_rule import InitToolRule
|
|
@@ -48,50 +37,27 @@ from .internal_server_error_body import InternalServerErrorBody
|
|
|
48
37
|
from .job import Job
|
|
49
38
|
from .job_status import JobStatus
|
|
50
39
|
from .job_type import JobType
|
|
51
|
-
from .letta_message_union import
|
|
52
|
-
LettaMessageUnion,
|
|
53
|
-
LettaMessageUnion_AssistantMessage,
|
|
54
|
-
LettaMessageUnion_ReasoningMessage,
|
|
55
|
-
LettaMessageUnion_SystemMessage,
|
|
56
|
-
LettaMessageUnion_ToolCallMessage,
|
|
57
|
-
LettaMessageUnion_ToolReturnMessage,
|
|
58
|
-
LettaMessageUnion_UserMessage,
|
|
59
|
-
)
|
|
40
|
+
from .letta_message_union import LettaMessageUnion
|
|
60
41
|
from .letta_request import LettaRequest
|
|
61
42
|
from .letta_request_config import LettaRequestConfig
|
|
62
43
|
from .letta_response import LettaResponse
|
|
63
|
-
from .letta_schemas_letta_message_tool_call import LettaSchemasLettaMessageToolCall
|
|
64
|
-
from .letta_schemas_message_message import LettaSchemasMessageMessage
|
|
65
|
-
from .letta_schemas_openai_chat_completion_request_tool import LettaSchemasOpenaiChatCompletionRequestTool
|
|
66
|
-
from .letta_schemas_openai_chat_completion_request_tool_call import LettaSchemasOpenaiChatCompletionRequestToolCall
|
|
67
|
-
from .letta_schemas_openai_chat_completion_request_tool_call_function import (
|
|
68
|
-
LettaSchemasOpenaiChatCompletionRequestToolCallFunction,
|
|
69
|
-
)
|
|
70
|
-
from .letta_schemas_openai_chat_completion_response_message import LettaSchemasOpenaiChatCompletionResponseMessage
|
|
71
|
-
from .letta_schemas_openai_chat_completion_response_tool_call import LettaSchemasOpenaiChatCompletionResponseToolCall
|
|
72
|
-
from .letta_schemas_openai_chat_completions_tool_call_function import LettaSchemasOpenaiChatCompletionsToolCallFunction
|
|
73
|
-
from .letta_schemas_openai_chat_completions_tool_call_input import LettaSchemasOpenaiChatCompletionsToolCallInput
|
|
74
|
-
from .letta_schemas_openai_chat_completions_tool_call_output import LettaSchemasOpenaiChatCompletionsToolCallOutput
|
|
75
|
-
from .letta_schemas_tool_tool import LettaSchemasToolTool
|
|
76
44
|
from .letta_usage_statistics import LettaUsageStatistics
|
|
77
45
|
from .llm_config import LlmConfig
|
|
78
46
|
from .llm_config_model_endpoint_type import LlmConfigModelEndpointType
|
|
79
47
|
from .local_sandbox_config import LocalSandboxConfig
|
|
80
|
-
from .log_prob_token import LogProbToken
|
|
81
48
|
from .memory import Memory
|
|
82
|
-
from .
|
|
49
|
+
from .message import Message
|
|
83
50
|
from .message_create import MessageCreate
|
|
51
|
+
from .message_create_content import MessageCreateContent
|
|
84
52
|
from .message_create_role import MessageCreateRole
|
|
85
53
|
from .message_role import MessageRole
|
|
86
54
|
from .not_found_error_body import NotFoundErrorBody
|
|
87
55
|
from .not_found_error_body_message import NotFoundErrorBodyMessage
|
|
88
|
-
from .open_ai_assistant import OpenAiAssistant
|
|
89
56
|
from .organization import Organization
|
|
90
57
|
from .organization_create import OrganizationCreate
|
|
91
58
|
from .passage import Passage
|
|
92
59
|
from .provider import Provider
|
|
93
60
|
from .reasoning_message import ReasoningMessage
|
|
94
|
-
from .response_format import ResponseFormat
|
|
95
61
|
from .run import Run
|
|
96
62
|
from .sandbox_config import SandboxConfig
|
|
97
63
|
from .sandbox_config_create import SandboxConfigCreate
|
|
@@ -103,17 +69,16 @@ from .sandbox_environment_variable_create import SandboxEnvironmentVariableCreat
|
|
|
103
69
|
from .sandbox_environment_variable_update import SandboxEnvironmentVariableUpdate
|
|
104
70
|
from .sandbox_type import SandboxType
|
|
105
71
|
from .source import Source
|
|
106
|
-
from .
|
|
107
|
-
from .
|
|
72
|
+
from .system_message import SystemMessage
|
|
73
|
+
from .system_message_content import SystemMessageContent
|
|
108
74
|
from .terminal_tool_rule import TerminalToolRule
|
|
75
|
+
from .text_content import TextContent
|
|
76
|
+
from .tool import Tool
|
|
77
|
+
from .tool_call import ToolCall
|
|
109
78
|
from .tool_call_delta import ToolCallDelta
|
|
110
|
-
from .tool_call_function_output import ToolCallFunctionOutput
|
|
111
79
|
from .tool_call_message import ToolCallMessage
|
|
112
80
|
from .tool_call_message_tool_call import ToolCallMessageToolCall
|
|
113
81
|
from .tool_create import ToolCreate
|
|
114
|
-
from .tool_function_choice import ToolFunctionChoice
|
|
115
|
-
from .tool_input import ToolInput
|
|
116
|
-
from .tool_message import ToolMessage
|
|
117
82
|
from .tool_return_message import ToolReturnMessage
|
|
118
83
|
from .tool_return_message_status import ToolReturnMessageStatus
|
|
119
84
|
from .tool_rule_type import ToolRuleType
|
|
@@ -121,9 +86,8 @@ from .tool_type import ToolType
|
|
|
121
86
|
from .usage_statistics import UsageStatistics
|
|
122
87
|
from .user import User
|
|
123
88
|
from .user_create import UserCreate
|
|
124
|
-
from .
|
|
125
|
-
from .
|
|
126
|
-
from .user_message_output import UserMessageOutput
|
|
89
|
+
from .user_message import UserMessage
|
|
90
|
+
from .user_message_content import UserMessageContent
|
|
127
91
|
from .user_update import UserUpdate
|
|
128
92
|
from .validation_error import ValidationError
|
|
129
93
|
from .validation_error_loc_item import ValidationErrorLocItem
|
|
@@ -139,37 +103,26 @@ __all__ = [
|
|
|
139
103
|
"AppAuthScheme",
|
|
140
104
|
"AppAuthSchemeAuthMode",
|
|
141
105
|
"AppModel",
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
"AssistantMessageOutput",
|
|
106
|
+
"AssistantMessage",
|
|
107
|
+
"AssistantMessageContent",
|
|
145
108
|
"AuthRequest",
|
|
146
109
|
"AuthResponse",
|
|
147
110
|
"AuthSchemeField",
|
|
148
111
|
"Block",
|
|
149
112
|
"BlockUpdate",
|
|
150
|
-
"
|
|
151
|
-
"ChatCompletionRequestFunctionCall",
|
|
152
|
-
"ChatCompletionRequestMessagesItem",
|
|
153
|
-
"ChatCompletionRequestStop",
|
|
154
|
-
"ChatCompletionRequestToolChoice",
|
|
155
|
-
"ChatCompletionResponse",
|
|
113
|
+
"ChatCompletionMessageToolCall",
|
|
156
114
|
"ChildToolRule",
|
|
157
|
-
"Choice",
|
|
158
115
|
"ConditionalToolRule",
|
|
159
116
|
"ConflictErrorBody",
|
|
160
117
|
"ContextWindowOverview",
|
|
161
|
-
"CreateAssistantFileRequest",
|
|
162
|
-
"CreateAssistantRequest",
|
|
163
118
|
"CreateBlock",
|
|
164
|
-
"DeleteAssistantFileResponse",
|
|
165
|
-
"DeleteAssistantResponse",
|
|
166
119
|
"E2BSandboxConfig",
|
|
167
120
|
"EmbeddingConfig",
|
|
168
121
|
"EmbeddingConfigEmbeddingEndpointType",
|
|
169
122
|
"FileMetadata",
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
123
|
+
"Function",
|
|
124
|
+
"FunctionDefinition",
|
|
125
|
+
"FunctionTool",
|
|
173
126
|
"Health",
|
|
174
127
|
"HttpValidationError",
|
|
175
128
|
"InitToolRule",
|
|
@@ -178,45 +131,26 @@ __all__ = [
|
|
|
178
131
|
"JobStatus",
|
|
179
132
|
"JobType",
|
|
180
133
|
"LettaMessageUnion",
|
|
181
|
-
"LettaMessageUnion_AssistantMessage",
|
|
182
|
-
"LettaMessageUnion_ReasoningMessage",
|
|
183
|
-
"LettaMessageUnion_SystemMessage",
|
|
184
|
-
"LettaMessageUnion_ToolCallMessage",
|
|
185
|
-
"LettaMessageUnion_ToolReturnMessage",
|
|
186
|
-
"LettaMessageUnion_UserMessage",
|
|
187
134
|
"LettaRequest",
|
|
188
135
|
"LettaRequestConfig",
|
|
189
136
|
"LettaResponse",
|
|
190
|
-
"LettaSchemasLettaMessageToolCall",
|
|
191
|
-
"LettaSchemasMessageMessage",
|
|
192
|
-
"LettaSchemasOpenaiChatCompletionRequestTool",
|
|
193
|
-
"LettaSchemasOpenaiChatCompletionRequestToolCall",
|
|
194
|
-
"LettaSchemasOpenaiChatCompletionRequestToolCallFunction",
|
|
195
|
-
"LettaSchemasOpenaiChatCompletionResponseMessage",
|
|
196
|
-
"LettaSchemasOpenaiChatCompletionResponseToolCall",
|
|
197
|
-
"LettaSchemasOpenaiChatCompletionsToolCallFunction",
|
|
198
|
-
"LettaSchemasOpenaiChatCompletionsToolCallInput",
|
|
199
|
-
"LettaSchemasOpenaiChatCompletionsToolCallOutput",
|
|
200
|
-
"LettaSchemasToolTool",
|
|
201
137
|
"LettaUsageStatistics",
|
|
202
138
|
"LlmConfig",
|
|
203
139
|
"LlmConfigModelEndpointType",
|
|
204
140
|
"LocalSandboxConfig",
|
|
205
|
-
"LogProbToken",
|
|
206
141
|
"Memory",
|
|
207
|
-
"
|
|
142
|
+
"Message",
|
|
208
143
|
"MessageCreate",
|
|
144
|
+
"MessageCreateContent",
|
|
209
145
|
"MessageCreateRole",
|
|
210
146
|
"MessageRole",
|
|
211
147
|
"NotFoundErrorBody",
|
|
212
148
|
"NotFoundErrorBodyMessage",
|
|
213
|
-
"OpenAiAssistant",
|
|
214
149
|
"Organization",
|
|
215
150
|
"OrganizationCreate",
|
|
216
151
|
"Passage",
|
|
217
152
|
"Provider",
|
|
218
153
|
"ReasoningMessage",
|
|
219
|
-
"ResponseFormat",
|
|
220
154
|
"Run",
|
|
221
155
|
"SandboxConfig",
|
|
222
156
|
"SandboxConfigCreate",
|
|
@@ -228,17 +162,16 @@ __all__ = [
|
|
|
228
162
|
"SandboxEnvironmentVariableUpdate",
|
|
229
163
|
"SandboxType",
|
|
230
164
|
"Source",
|
|
231
|
-
"
|
|
232
|
-
"
|
|
165
|
+
"SystemMessage",
|
|
166
|
+
"SystemMessageContent",
|
|
233
167
|
"TerminalToolRule",
|
|
168
|
+
"TextContent",
|
|
169
|
+
"Tool",
|
|
170
|
+
"ToolCall",
|
|
234
171
|
"ToolCallDelta",
|
|
235
|
-
"ToolCallFunctionOutput",
|
|
236
172
|
"ToolCallMessage",
|
|
237
173
|
"ToolCallMessageToolCall",
|
|
238
174
|
"ToolCreate",
|
|
239
|
-
"ToolFunctionChoice",
|
|
240
|
-
"ToolInput",
|
|
241
|
-
"ToolMessage",
|
|
242
175
|
"ToolReturnMessage",
|
|
243
176
|
"ToolReturnMessageStatus",
|
|
244
177
|
"ToolRuleType",
|
|
@@ -246,9 +179,8 @@ __all__ = [
|
|
|
246
179
|
"UsageStatistics",
|
|
247
180
|
"User",
|
|
248
181
|
"UserCreate",
|
|
249
|
-
"
|
|
250
|
-
"
|
|
251
|
-
"UserMessageOutput",
|
|
182
|
+
"UserMessage",
|
|
183
|
+
"UserMessageContent",
|
|
252
184
|
"UserUpdate",
|
|
253
185
|
"ValidationError",
|
|
254
186
|
"ValidationErrorLocItem",
|
|
@@ -8,10 +8,8 @@ from .agent_state_tool_rules_item import AgentStateToolRulesItem
|
|
|
8
8
|
from .agent_type import AgentType
|
|
9
9
|
from .llm_config import LlmConfig
|
|
10
10
|
from .embedding_config import EmbeddingConfig
|
|
11
|
-
import typing_extensions
|
|
12
|
-
from ..core.serialization import FieldMetadata
|
|
13
11
|
from .memory import Memory
|
|
14
|
-
from .
|
|
12
|
+
from .tool import Tool
|
|
15
13
|
from .source import Source
|
|
16
14
|
from .agent_environment_variable import AgentEnvironmentVariable
|
|
17
15
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
@@ -98,9 +96,7 @@ class AgentState(UncheckedBaseModel):
|
|
|
98
96
|
The description of the agent.
|
|
99
97
|
"""
|
|
100
98
|
|
|
101
|
-
metadata:
|
|
102
|
-
typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="metadata_")
|
|
103
|
-
] = pydantic.Field(default=None)
|
|
99
|
+
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
104
100
|
"""
|
|
105
101
|
The metadata of the agent.
|
|
106
102
|
"""
|
|
@@ -110,7 +106,7 @@ class AgentState(UncheckedBaseModel):
|
|
|
110
106
|
The in-context memory of the agent.
|
|
111
107
|
"""
|
|
112
108
|
|
|
113
|
-
tools: typing.List[
|
|
109
|
+
tools: typing.List[Tool] = pydantic.Field()
|
|
114
110
|
"""
|
|
115
111
|
The tools used by the agent.
|
|
116
112
|
"""
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
+
import datetime as dt
|
|
4
5
|
import typing
|
|
5
|
-
from .
|
|
6
|
+
from .assistant_message_content import AssistantMessageContent
|
|
6
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
8
|
import pydantic
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
class
|
|
11
|
+
class AssistantMessage(UncheckedBaseModel):
|
|
11
12
|
id: str
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
date: dt.datetime
|
|
14
|
+
message_type: typing.Literal["assistant_message"] = "assistant_message"
|
|
15
|
+
content: AssistantMessageContent
|
|
14
16
|
|
|
15
17
|
if IS_PYDANTIC_V2:
|
|
16
18
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
letta_client/types/block.py
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import pydantic
|
|
5
5
|
import typing
|
|
6
|
-
import typing_extensions
|
|
7
|
-
from ..core.serialization import FieldMetadata
|
|
8
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
7
|
|
|
10
8
|
|
|
@@ -20,7 +18,7 @@ class Block(UncheckedBaseModel):
|
|
|
20
18
|
label (str): The label of the block (e.g. 'human', 'persona'). This defines a category for the block.
|
|
21
19
|
template_name (str): The name of the block template (if it is a template).
|
|
22
20
|
description (str): Description of the block.
|
|
23
|
-
|
|
21
|
+
metadata (Dict): Metadata of the block.
|
|
24
22
|
user_id (str): The unique identifier of the user associated with the block.
|
|
25
23
|
"""
|
|
26
24
|
|
|
@@ -54,9 +52,7 @@ class Block(UncheckedBaseModel):
|
|
|
54
52
|
Description of the block.
|
|
55
53
|
"""
|
|
56
54
|
|
|
57
|
-
metadata:
|
|
58
|
-
typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="metadata_")
|
|
59
|
-
] = pydantic.Field(default=None)
|
|
55
|
+
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
60
56
|
"""
|
|
61
57
|
Metadata of the block.
|
|
62
58
|
"""
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
import pydantic
|
|
6
|
-
import typing_extensions
|
|
7
|
-
from ..core.serialization import FieldMetadata
|
|
8
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
7
|
|
|
10
8
|
|
|
@@ -43,9 +41,7 @@ class BlockUpdate(UncheckedBaseModel):
|
|
|
43
41
|
Description of the block.
|
|
44
42
|
"""
|
|
45
43
|
|
|
46
|
-
metadata:
|
|
47
|
-
typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="metadata_")
|
|
48
|
-
] = pydantic.Field(default=None)
|
|
44
|
+
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
49
45
|
"""
|
|
50
46
|
Metadata of the block.
|
|
51
47
|
"""
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
-
|
|
5
|
-
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
4
|
+
from .function import Function
|
|
6
5
|
import typing
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
7
|
import pydantic
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class
|
|
10
|
+
class ChatCompletionMessageToolCall(UncheckedBaseModel):
|
|
11
11
|
id: str
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
function: Function
|
|
13
|
+
type: typing.Literal["function"] = "function"
|
|
14
14
|
|
|
15
15
|
if IS_PYDANTIC_V2:
|
|
16
16
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import pydantic
|
|
5
5
|
import typing
|
|
6
|
-
from .
|
|
7
|
-
from .
|
|
6
|
+
from .function_tool import FunctionTool
|
|
7
|
+
from .message import Message
|
|
8
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
9
|
|
|
10
10
|
|
|
@@ -83,9 +83,7 @@ class ContextWindowOverview(UncheckedBaseModel):
|
|
|
83
83
|
The number of tokens in the functions definitions.
|
|
84
84
|
"""
|
|
85
85
|
|
|
86
|
-
functions_definitions: typing.Optional[typing.List[
|
|
87
|
-
default=None
|
|
88
|
-
)
|
|
86
|
+
functions_definitions: typing.Optional[typing.List[FunctionTool]] = pydantic.Field(default=None)
|
|
89
87
|
"""
|
|
90
88
|
The content of the functions definitions.
|
|
91
89
|
"""
|
|
@@ -95,7 +93,7 @@ class ContextWindowOverview(UncheckedBaseModel):
|
|
|
95
93
|
The number of tokens in the messages list.
|
|
96
94
|
"""
|
|
97
95
|
|
|
98
|
-
messages: typing.List[
|
|
96
|
+
messages: typing.List[Message] = pydantic.Field()
|
|
99
97
|
"""
|
|
100
98
|
The messages in the context window.
|
|
101
99
|
"""
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import pydantic
|
|
5
5
|
import typing
|
|
6
|
-
import typing_extensions
|
|
7
|
-
from ..core.serialization import FieldMetadata
|
|
8
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
9
7
|
|
|
10
8
|
|
|
@@ -39,9 +37,7 @@ class CreateBlock(UncheckedBaseModel):
|
|
|
39
37
|
Description of the block.
|
|
40
38
|
"""
|
|
41
39
|
|
|
42
|
-
metadata:
|
|
43
|
-
typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="metadata_")
|
|
44
|
-
] = pydantic.Field(default=None)
|
|
40
|
+
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
45
41
|
"""
|
|
46
42
|
Metadata of the block.
|
|
47
43
|
"""
|
|
@@ -6,10 +6,11 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
|
6
6
|
import pydantic
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class
|
|
9
|
+
class FunctionDefinition(UncheckedBaseModel):
|
|
10
10
|
name: str
|
|
11
11
|
description: typing.Optional[str] = None
|
|
12
12
|
parameters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
|
13
|
+
strict: typing.Optional[bool] = None
|
|
13
14
|
|
|
14
15
|
if IS_PYDANTIC_V2:
|
|
15
16
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
|
-
from
|
|
4
|
+
from .function_definition import FunctionDefinition
|
|
5
5
|
import typing
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
7
|
import pydantic
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
class
|
|
10
|
-
|
|
10
|
+
class FunctionTool(UncheckedBaseModel):
|
|
11
|
+
function: FunctionDefinition
|
|
12
|
+
type: typing.Literal["function"] = "function"
|
|
11
13
|
|
|
12
14
|
if IS_PYDANTIC_V2:
|
|
13
15
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
letta_client/types/job.py
CHANGED
|
@@ -5,8 +5,6 @@ import typing
|
|
|
5
5
|
import pydantic
|
|
6
6
|
import datetime as dt
|
|
7
7
|
from .job_status import JobStatus
|
|
8
|
-
import typing_extensions
|
|
9
|
-
from ..core.serialization import FieldMetadata
|
|
10
8
|
from .job_type import JobType
|
|
11
9
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
12
10
|
|
|
@@ -53,9 +51,7 @@ class Job(UncheckedBaseModel):
|
|
|
53
51
|
The unix timestamp of when the job was completed.
|
|
54
52
|
"""
|
|
55
53
|
|
|
56
|
-
metadata:
|
|
57
|
-
typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="metadata_")
|
|
58
|
-
] = pydantic.Field(default=None)
|
|
54
|
+
metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
|
59
55
|
"""
|
|
60
56
|
The metadata of the job.
|
|
61
57
|
"""
|
|
@@ -1,125 +1,13 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
5
3
|
import typing
|
|
6
|
-
|
|
7
|
-
from
|
|
8
|
-
import
|
|
9
|
-
from .
|
|
10
|
-
from .
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class LettaMessageUnion_SystemMessage(UncheckedBaseModel):
|
|
16
|
-
message_type: typing.Literal["system_message"] = "system_message"
|
|
17
|
-
id: str
|
|
18
|
-
date: dt.datetime
|
|
19
|
-
message: str
|
|
20
|
-
|
|
21
|
-
if IS_PYDANTIC_V2:
|
|
22
|
-
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
23
|
-
else:
|
|
24
|
-
|
|
25
|
-
class Config:
|
|
26
|
-
frozen = True
|
|
27
|
-
smart_union = True
|
|
28
|
-
extra = pydantic.Extra.allow
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
class LettaMessageUnion_UserMessage(UncheckedBaseModel):
|
|
32
|
-
message_type: typing.Literal["user_message"] = "user_message"
|
|
33
|
-
id: str
|
|
34
|
-
date: dt.datetime
|
|
35
|
-
message: str
|
|
36
|
-
|
|
37
|
-
if IS_PYDANTIC_V2:
|
|
38
|
-
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
39
|
-
else:
|
|
40
|
-
|
|
41
|
-
class Config:
|
|
42
|
-
frozen = True
|
|
43
|
-
smart_union = True
|
|
44
|
-
extra = pydantic.Extra.allow
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
class LettaMessageUnion_ReasoningMessage(UncheckedBaseModel):
|
|
48
|
-
message_type: typing.Literal["reasoning_message"] = "reasoning_message"
|
|
49
|
-
id: str
|
|
50
|
-
date: dt.datetime
|
|
51
|
-
reasoning: str
|
|
52
|
-
|
|
53
|
-
if IS_PYDANTIC_V2:
|
|
54
|
-
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
55
|
-
else:
|
|
56
|
-
|
|
57
|
-
class Config:
|
|
58
|
-
frozen = True
|
|
59
|
-
smart_union = True
|
|
60
|
-
extra = pydantic.Extra.allow
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
class LettaMessageUnion_ToolCallMessage(UncheckedBaseModel):
|
|
64
|
-
message_type: typing.Literal["tool_call_message"] = "tool_call_message"
|
|
65
|
-
id: str
|
|
66
|
-
date: dt.datetime
|
|
67
|
-
tool_call: ToolCallMessageToolCall
|
|
68
|
-
|
|
69
|
-
if IS_PYDANTIC_V2:
|
|
70
|
-
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
71
|
-
else:
|
|
72
|
-
|
|
73
|
-
class Config:
|
|
74
|
-
frozen = True
|
|
75
|
-
smart_union = True
|
|
76
|
-
extra = pydantic.Extra.allow
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
class LettaMessageUnion_ToolReturnMessage(UncheckedBaseModel):
|
|
80
|
-
message_type: typing.Literal["tool_return_message"] = "tool_return_message"
|
|
81
|
-
id: str
|
|
82
|
-
date: dt.datetime
|
|
83
|
-
tool_return: str
|
|
84
|
-
status: ToolReturnMessageStatus
|
|
85
|
-
tool_call_id: str
|
|
86
|
-
stdout: typing.Optional[typing.List[str]] = None
|
|
87
|
-
stderr: typing.Optional[typing.List[str]] = None
|
|
88
|
-
|
|
89
|
-
if IS_PYDANTIC_V2:
|
|
90
|
-
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
91
|
-
else:
|
|
92
|
-
|
|
93
|
-
class Config:
|
|
94
|
-
frozen = True
|
|
95
|
-
smart_union = True
|
|
96
|
-
extra = pydantic.Extra.allow
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
class LettaMessageUnion_AssistantMessage(UncheckedBaseModel):
|
|
100
|
-
message_type: typing.Literal["assistant_message"] = "assistant_message"
|
|
101
|
-
id: str
|
|
102
|
-
date: dt.datetime
|
|
103
|
-
assistant_message: str
|
|
104
|
-
|
|
105
|
-
if IS_PYDANTIC_V2:
|
|
106
|
-
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
107
|
-
else:
|
|
108
|
-
|
|
109
|
-
class Config:
|
|
110
|
-
frozen = True
|
|
111
|
-
smart_union = True
|
|
112
|
-
extra = pydantic.Extra.allow
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
LettaMessageUnion = typing_extensions.Annotated[
|
|
116
|
-
typing.Union[
|
|
117
|
-
LettaMessageUnion_SystemMessage,
|
|
118
|
-
LettaMessageUnion_UserMessage,
|
|
119
|
-
LettaMessageUnion_ReasoningMessage,
|
|
120
|
-
LettaMessageUnion_ToolCallMessage,
|
|
121
|
-
LettaMessageUnion_ToolReturnMessage,
|
|
122
|
-
LettaMessageUnion_AssistantMessage,
|
|
123
|
-
],
|
|
124
|
-
UnionMetadata(discriminant="message_type"),
|
|
4
|
+
from .system_message import SystemMessage
|
|
5
|
+
from .user_message import UserMessage
|
|
6
|
+
from .reasoning_message import ReasoningMessage
|
|
7
|
+
from .tool_call_message import ToolCallMessage
|
|
8
|
+
from .tool_return_message import ToolReturnMessage
|
|
9
|
+
from .assistant_message import AssistantMessage
|
|
10
|
+
|
|
11
|
+
LettaMessageUnion = typing.Union[
|
|
12
|
+
SystemMessage, UserMessage, ReasoningMessage, ToolCallMessage, ToolReturnMessage, AssistantMessage
|
|
125
13
|
]
|
|
@@ -17,6 +17,7 @@ class LettaUsageStatistics(UncheckedBaseModel):
|
|
|
17
17
|
step_count (int): The number of steps taken by the agent.
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
|
+
message_type: typing.Optional[typing.Literal["usage_statistics"]] = None
|
|
20
21
|
completion_tokens: typing.Optional[int] = pydantic.Field(default=None)
|
|
21
22
|
"""
|
|
22
23
|
The number of tokens generated by the agent.
|