letta-client 0.1.17__py3-none-any.whl → 0.1.19__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 +34 -116
- letta_client/agents/__init__.py +17 -42
- letta_client/agents/archival_memory/client.py +19 -212
- letta_client/agents/client.py +1633 -336
- letta_client/agents/context/client.py +6 -4
- letta_client/agents/core_memory/client.py +97 -499
- letta_client/agents/memory_variables/__init__.py +2 -2
- letta_client/agents/memory_variables/client.py +13 -13
- 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 +20 -26
- letta_client/agents/messages/types/__init__.py +2 -21
- letta_client/agents/messages/types/letta_streaming_response.py +16 -139
- 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 +12 -260
- 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 +4 -4
- letta_client/runs/client.py +14 -12
- letta_client/sources/client.py +12 -288
- letta_client/tools/client.py +63 -69
- letta_client/types/__init__.py +21 -99
- letta_client/types/agent_state.py +3 -7
- letta_client/types/{assistant_message_output.py → assistant_message.py} +3 -2
- letta_client/types/block.py +2 -6
- letta_client/types/block_update.py +1 -5
- letta_client/types/{create_assistant_file_request.py → chat_completion_message_tool_call.py} +7 -7
- 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/{letta_schemas_message_message.py → message.py} +4 -6
- 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} +3 -2
- 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} +3 -2
- {letta_client-0.1.17.dist-info → letta_client-0.1.19.dist-info}/METADATA +1 -1
- {letta_client-0.1.17.dist-info → letta_client-0.1.19.dist-info}/RECORD +64 -95
- 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_completion_response_tool_call.py +0 -22
- 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.19.dist-info}/WHEEL +0 -0
letta_client/types/__init__.py
CHANGED
|
@@ -10,37 +10,25 @@ 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 .assistant_message_input import AssistantMessageInput
|
|
15
|
-
from .assistant_message_output import AssistantMessageOutput
|
|
13
|
+
from .assistant_message import AssistantMessage
|
|
16
14
|
from .auth_request import AuthRequest
|
|
17
15
|
from .auth_response import AuthResponse
|
|
18
16
|
from .auth_scheme_field import AuthSchemeField
|
|
19
17
|
from .block import Block
|
|
20
18
|
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
|
|
19
|
+
from .chat_completion_message_tool_call import ChatCompletionMessageToolCall
|
|
27
20
|
from .child_tool_rule import ChildToolRule
|
|
28
|
-
from .choice import Choice
|
|
29
21
|
from .conditional_tool_rule import ConditionalToolRule
|
|
30
22
|
from .conflict_error_body import ConflictErrorBody
|
|
31
23
|
from .context_window_overview import ContextWindowOverview
|
|
32
|
-
from .create_assistant_file_request import CreateAssistantFileRequest
|
|
33
|
-
from .create_assistant_request import CreateAssistantRequest
|
|
34
24
|
from .create_block import CreateBlock
|
|
35
|
-
from .delete_assistant_file_response import DeleteAssistantFileResponse
|
|
36
|
-
from .delete_assistant_response import DeleteAssistantResponse
|
|
37
25
|
from .e_2_b_sandbox_config import E2BSandboxConfig
|
|
38
26
|
from .embedding_config import EmbeddingConfig
|
|
39
27
|
from .embedding_config_embedding_endpoint_type import EmbeddingConfigEmbeddingEndpointType
|
|
40
28
|
from .file_metadata import FileMetadata
|
|
41
|
-
from .
|
|
42
|
-
from .
|
|
43
|
-
from .
|
|
29
|
+
from .function import Function
|
|
30
|
+
from .function_definition import FunctionDefinition
|
|
31
|
+
from .function_tool import FunctionTool
|
|
44
32
|
from .health import Health
|
|
45
33
|
from .http_validation_error import HttpValidationError
|
|
46
34
|
from .init_tool_rule import InitToolRule
|
|
@@ -48,50 +36,26 @@ from .internal_server_error_body import InternalServerErrorBody
|
|
|
48
36
|
from .job import Job
|
|
49
37
|
from .job_status import JobStatus
|
|
50
38
|
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
|
-
)
|
|
39
|
+
from .letta_message_union import LettaMessageUnion
|
|
60
40
|
from .letta_request import LettaRequest
|
|
61
41
|
from .letta_request_config import LettaRequestConfig
|
|
62
42
|
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
43
|
from .letta_usage_statistics import LettaUsageStatistics
|
|
77
44
|
from .llm_config import LlmConfig
|
|
78
45
|
from .llm_config_model_endpoint_type import LlmConfigModelEndpointType
|
|
79
46
|
from .local_sandbox_config import LocalSandboxConfig
|
|
80
|
-
from .log_prob_token import LogProbToken
|
|
81
47
|
from .memory import Memory
|
|
82
|
-
from .
|
|
48
|
+
from .message import Message
|
|
83
49
|
from .message_create import MessageCreate
|
|
84
50
|
from .message_create_role import MessageCreateRole
|
|
85
51
|
from .message_role import MessageRole
|
|
86
52
|
from .not_found_error_body import NotFoundErrorBody
|
|
87
53
|
from .not_found_error_body_message import NotFoundErrorBodyMessage
|
|
88
|
-
from .open_ai_assistant import OpenAiAssistant
|
|
89
54
|
from .organization import Organization
|
|
90
55
|
from .organization_create import OrganizationCreate
|
|
91
56
|
from .passage import Passage
|
|
92
57
|
from .provider import Provider
|
|
93
58
|
from .reasoning_message import ReasoningMessage
|
|
94
|
-
from .response_format import ResponseFormat
|
|
95
59
|
from .run import Run
|
|
96
60
|
from .sandbox_config import SandboxConfig
|
|
97
61
|
from .sandbox_config_create import SandboxConfigCreate
|
|
@@ -103,17 +67,14 @@ from .sandbox_environment_variable_create import SandboxEnvironmentVariableCreat
|
|
|
103
67
|
from .sandbox_environment_variable_update import SandboxEnvironmentVariableUpdate
|
|
104
68
|
from .sandbox_type import SandboxType
|
|
105
69
|
from .source import Source
|
|
106
|
-
from .
|
|
107
|
-
from .system_message_output import SystemMessageOutput
|
|
70
|
+
from .system_message import SystemMessage
|
|
108
71
|
from .terminal_tool_rule import TerminalToolRule
|
|
72
|
+
from .tool import Tool
|
|
73
|
+
from .tool_call import ToolCall
|
|
109
74
|
from .tool_call_delta import ToolCallDelta
|
|
110
|
-
from .tool_call_function_output import ToolCallFunctionOutput
|
|
111
75
|
from .tool_call_message import ToolCallMessage
|
|
112
76
|
from .tool_call_message_tool_call import ToolCallMessageToolCall
|
|
113
77
|
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
78
|
from .tool_return_message import ToolReturnMessage
|
|
118
79
|
from .tool_return_message_status import ToolReturnMessageStatus
|
|
119
80
|
from .tool_rule_type import ToolRuleType
|
|
@@ -121,9 +82,7 @@ from .tool_type import ToolType
|
|
|
121
82
|
from .usage_statistics import UsageStatistics
|
|
122
83
|
from .user import User
|
|
123
84
|
from .user_create import UserCreate
|
|
124
|
-
from .
|
|
125
|
-
from .user_message_input_content import UserMessageInputContent
|
|
126
|
-
from .user_message_output import UserMessageOutput
|
|
85
|
+
from .user_message import UserMessage
|
|
127
86
|
from .user_update import UserUpdate
|
|
128
87
|
from .validation_error import ValidationError
|
|
129
88
|
from .validation_error_loc_item import ValidationErrorLocItem
|
|
@@ -139,37 +98,25 @@ __all__ = [
|
|
|
139
98
|
"AppAuthScheme",
|
|
140
99
|
"AppAuthSchemeAuthMode",
|
|
141
100
|
"AppModel",
|
|
142
|
-
"
|
|
143
|
-
"AssistantMessageInput",
|
|
144
|
-
"AssistantMessageOutput",
|
|
101
|
+
"AssistantMessage",
|
|
145
102
|
"AuthRequest",
|
|
146
103
|
"AuthResponse",
|
|
147
104
|
"AuthSchemeField",
|
|
148
105
|
"Block",
|
|
149
106
|
"BlockUpdate",
|
|
150
|
-
"
|
|
151
|
-
"ChatCompletionRequestFunctionCall",
|
|
152
|
-
"ChatCompletionRequestMessagesItem",
|
|
153
|
-
"ChatCompletionRequestStop",
|
|
154
|
-
"ChatCompletionRequestToolChoice",
|
|
155
|
-
"ChatCompletionResponse",
|
|
107
|
+
"ChatCompletionMessageToolCall",
|
|
156
108
|
"ChildToolRule",
|
|
157
|
-
"Choice",
|
|
158
109
|
"ConditionalToolRule",
|
|
159
110
|
"ConflictErrorBody",
|
|
160
111
|
"ContextWindowOverview",
|
|
161
|
-
"CreateAssistantFileRequest",
|
|
162
|
-
"CreateAssistantRequest",
|
|
163
112
|
"CreateBlock",
|
|
164
|
-
"DeleteAssistantFileResponse",
|
|
165
|
-
"DeleteAssistantResponse",
|
|
166
113
|
"E2BSandboxConfig",
|
|
167
114
|
"EmbeddingConfig",
|
|
168
115
|
"EmbeddingConfigEmbeddingEndpointType",
|
|
169
116
|
"FileMetadata",
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
117
|
+
"Function",
|
|
118
|
+
"FunctionDefinition",
|
|
119
|
+
"FunctionTool",
|
|
173
120
|
"Health",
|
|
174
121
|
"HttpValidationError",
|
|
175
122
|
"InitToolRule",
|
|
@@ -178,45 +125,25 @@ __all__ = [
|
|
|
178
125
|
"JobStatus",
|
|
179
126
|
"JobType",
|
|
180
127
|
"LettaMessageUnion",
|
|
181
|
-
"LettaMessageUnion_AssistantMessage",
|
|
182
|
-
"LettaMessageUnion_ReasoningMessage",
|
|
183
|
-
"LettaMessageUnion_SystemMessage",
|
|
184
|
-
"LettaMessageUnion_ToolCallMessage",
|
|
185
|
-
"LettaMessageUnion_ToolReturnMessage",
|
|
186
|
-
"LettaMessageUnion_UserMessage",
|
|
187
128
|
"LettaRequest",
|
|
188
129
|
"LettaRequestConfig",
|
|
189
130
|
"LettaResponse",
|
|
190
|
-
"LettaSchemasLettaMessageToolCall",
|
|
191
|
-
"LettaSchemasMessageMessage",
|
|
192
|
-
"LettaSchemasOpenaiChatCompletionRequestTool",
|
|
193
|
-
"LettaSchemasOpenaiChatCompletionRequestToolCall",
|
|
194
|
-
"LettaSchemasOpenaiChatCompletionRequestToolCallFunction",
|
|
195
|
-
"LettaSchemasOpenaiChatCompletionResponseMessage",
|
|
196
|
-
"LettaSchemasOpenaiChatCompletionResponseToolCall",
|
|
197
|
-
"LettaSchemasOpenaiChatCompletionsToolCallFunction",
|
|
198
|
-
"LettaSchemasOpenaiChatCompletionsToolCallInput",
|
|
199
|
-
"LettaSchemasOpenaiChatCompletionsToolCallOutput",
|
|
200
|
-
"LettaSchemasToolTool",
|
|
201
131
|
"LettaUsageStatistics",
|
|
202
132
|
"LlmConfig",
|
|
203
133
|
"LlmConfigModelEndpointType",
|
|
204
134
|
"LocalSandboxConfig",
|
|
205
|
-
"LogProbToken",
|
|
206
135
|
"Memory",
|
|
207
|
-
"
|
|
136
|
+
"Message",
|
|
208
137
|
"MessageCreate",
|
|
209
138
|
"MessageCreateRole",
|
|
210
139
|
"MessageRole",
|
|
211
140
|
"NotFoundErrorBody",
|
|
212
141
|
"NotFoundErrorBodyMessage",
|
|
213
|
-
"OpenAiAssistant",
|
|
214
142
|
"Organization",
|
|
215
143
|
"OrganizationCreate",
|
|
216
144
|
"Passage",
|
|
217
145
|
"Provider",
|
|
218
146
|
"ReasoningMessage",
|
|
219
|
-
"ResponseFormat",
|
|
220
147
|
"Run",
|
|
221
148
|
"SandboxConfig",
|
|
222
149
|
"SandboxConfigCreate",
|
|
@@ -228,17 +155,14 @@ __all__ = [
|
|
|
228
155
|
"SandboxEnvironmentVariableUpdate",
|
|
229
156
|
"SandboxType",
|
|
230
157
|
"Source",
|
|
231
|
-
"
|
|
232
|
-
"SystemMessageOutput",
|
|
158
|
+
"SystemMessage",
|
|
233
159
|
"TerminalToolRule",
|
|
160
|
+
"Tool",
|
|
161
|
+
"ToolCall",
|
|
234
162
|
"ToolCallDelta",
|
|
235
|
-
"ToolCallFunctionOutput",
|
|
236
163
|
"ToolCallMessage",
|
|
237
164
|
"ToolCallMessageToolCall",
|
|
238
165
|
"ToolCreate",
|
|
239
|
-
"ToolFunctionChoice",
|
|
240
|
-
"ToolInput",
|
|
241
|
-
"ToolMessage",
|
|
242
166
|
"ToolReturnMessage",
|
|
243
167
|
"ToolReturnMessageStatus",
|
|
244
168
|
"ToolRuleType",
|
|
@@ -246,9 +170,7 @@ __all__ = [
|
|
|
246
170
|
"UsageStatistics",
|
|
247
171
|
"User",
|
|
248
172
|
"UserCreate",
|
|
249
|
-
"
|
|
250
|
-
"UserMessageInputContent",
|
|
251
|
-
"UserMessageOutput",
|
|
173
|
+
"UserMessage",
|
|
252
174
|
"UserUpdate",
|
|
253
175
|
"ValidationError",
|
|
254
176
|
"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
|
"""
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import datetime as dt
|
|
5
|
-
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
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 AssistantMessage(UncheckedBaseModel):
|
|
11
11
|
id: str
|
|
12
12
|
date: dt.datetime
|
|
13
|
+
message_type: typing.Literal["assistant_message"] = "assistant_message"
|
|
13
14
|
assistant_message: str
|
|
14
15
|
|
|
15
16
|
if IS_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
|
"""
|
letta_client/types/{create_assistant_file_request.py → chat_completion_message_tool_call.py}
RENAMED
|
@@ -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
|
-
import
|
|
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
|
+
import pydantic
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
class
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"""
|
|
10
|
+
class ChatCompletionMessageToolCall(UncheckedBaseModel):
|
|
11
|
+
id: str
|
|
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.
|
|
@@ -5,11 +5,11 @@ import typing
|
|
|
5
5
|
import pydantic
|
|
6
6
|
import datetime as dt
|
|
7
7
|
from .message_role import MessageRole
|
|
8
|
-
from .
|
|
8
|
+
from .chat_completion_message_tool_call import ChatCompletionMessageToolCall
|
|
9
9
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class
|
|
12
|
+
class Message(UncheckedBaseModel):
|
|
13
13
|
"""
|
|
14
14
|
Letta's internal representation of a message. Includes methods to convert to/from LLM provider formats.
|
|
15
15
|
|
|
@@ -22,7 +22,7 @@ class LettaSchemasMessageMessage(UncheckedBaseModel):
|
|
|
22
22
|
model (str): The model used to make the function call.
|
|
23
23
|
name (str): The name of the participant.
|
|
24
24
|
created_at (datetime): The time the message was created.
|
|
25
|
-
tool_calls (List[
|
|
25
|
+
tool_calls (List[OpenAIToolCall,]): The list of tool calls requested.
|
|
26
26
|
tool_call_id (str): The id of the tool call.
|
|
27
27
|
"""
|
|
28
28
|
|
|
@@ -76,9 +76,7 @@ class LettaSchemasMessageMessage(UncheckedBaseModel):
|
|
|
76
76
|
The name of the participant.
|
|
77
77
|
"""
|
|
78
78
|
|
|
79
|
-
tool_calls: typing.Optional[typing.List[
|
|
80
|
-
default=None
|
|
81
|
-
)
|
|
79
|
+
tool_calls: typing.Optional[typing.List[ChatCompletionMessageToolCall]] = pydantic.Field(default=None)
|
|
82
80
|
"""
|
|
83
81
|
The list of tool calls requested.
|
|
84
82
|
"""
|