letta-client 0.1.4__py3-none-any.whl → 0.1.6__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/__init__.py +34 -12
- letta/agents/__init__.py +49 -13
- letta/agents/client.py +40 -0
- letta/agents/messages/__init__.py +36 -2
- letta/agents/messages/client.py +46 -0
- letta/agents/messages/types/__init__.py +37 -3
- letta/agents/messages/types/letta_streaming_response.py +132 -14
- letta/agents/messages/types/messages_list_response_item.py +114 -7
- letta/agents/types/__init__.py +26 -18
- letta/agents/types/agents_search_deployed_agents_request_search_item.py +59 -8
- letta/agents/types/{agents_search_deployed_agents_request_search_item_operator.py → agents_search_deployed_agents_request_search_item_name.py} +5 -6
- letta/agents/types/{agents_search_deployed_agents_request_search_item_operator_operator.py → agents_search_deployed_agents_request_search_item_name_operator.py} +1 -1
- letta/agents/types/agents_search_deployed_agents_request_search_item_order_by.py +26 -0
- letta/agents/types/agents_search_deployed_agents_request_search_item_order_by_direction.py +5 -0
- letta/agents/types/{agents_search_deployed_agents_request_search_item_direction_value.py → agents_search_deployed_agents_request_search_item_order_by_value.py} +1 -1
- letta/agents/types/{agents_search_deployed_agents_request_search_item_zero.py → agents_search_deployed_agents_request_search_item_version.py} +2 -3
- letta/client.py +4 -4
- letta/core/client_wrapper.py +7 -18
- letta/types/__init__.py +18 -0
- letta/types/agent_environment_variable.py +68 -0
- letta/types/agent_state.py +15 -9
- letta/types/assistant_message_output.py +1 -2
- letta/types/block.py +9 -9
- letta/types/context_window_overview.py +5 -0
- letta/types/embedding_config.py +8 -8
- letta/types/job.py +5 -5
- letta/types/letta_response.py +4 -3
- letta/types/letta_response_messages_item.py +120 -0
- letta/types/letta_schemas_message_message.py +10 -10
- letta/types/letta_schemas_tool_tool.py +5 -5
- letta/types/letta_usage_statistics.py +4 -5
- letta/types/llm_config.py +7 -7
- letta/types/passage.py +8 -8
- letta/types/reasoning_message.py +4 -5
- letta/types/sandbox_environment_variable.py +4 -4
- letta/types/sandbox_environment_variable_update.py +0 -4
- letta/types/source.py +6 -6
- letta/types/system_message_output.py +4 -5
- letta/types/tool_call_message.py +4 -5
- letta/types/tool_return_message.py +8 -9
- letta/types/user.py +3 -3
- letta/types/user_message_output.py +4 -5
- {letta_client-0.1.4.dist-info → letta_client-0.1.6.dist-info}/METADATA +1 -1
- {letta_client-0.1.4.dist-info → letta_client-0.1.6.dist-info}/RECORD +45 -43
- letta/agents/types/agents_search_deployed_agents_request_search_item_direction.py +0 -27
- letta/agents/types/agents_search_deployed_agents_request_search_item_direction_direction.py +0 -5
- {letta_client-0.1.4.dist-info → letta_client-0.1.6.dist-info}/WHEEL +0 -0
|
@@ -43,6 +43,11 @@ class ContextWindowOverview(UniversalBaseModel):
|
|
|
43
43
|
The number of tokens in the external memory summary (archival + recall metadata).
|
|
44
44
|
"""
|
|
45
45
|
|
|
46
|
+
external_memory_summary: str = pydantic.Field()
|
|
47
|
+
"""
|
|
48
|
+
The metadata summary of the external memory sources (archival + recall metadata).
|
|
49
|
+
"""
|
|
50
|
+
|
|
46
51
|
num_tokens_system: int = pydantic.Field()
|
|
47
52
|
"""
|
|
48
53
|
The number of tokens in the system prompt.
|
letta/types/embedding_config.py
CHANGED
|
@@ -12,14 +12,14 @@ class EmbeddingConfig(UniversalBaseModel):
|
|
|
12
12
|
Embedding model configuration. This object specifies all the information necessary to access an embedding model to usage with Letta, except for secret keys.
|
|
13
13
|
|
|
14
14
|
Attributes:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
embedding_endpoint_type (str): The endpoint type for the model.
|
|
16
|
+
embedding_endpoint (str): The endpoint for the model.
|
|
17
|
+
embedding_model (str): The model for the embedding.
|
|
18
|
+
embedding_dim (int): The dimension of the embedding.
|
|
19
|
+
embedding_chunk_size (int): The chunk size of the embedding.
|
|
20
|
+
azure_endpoint (:obj:`str`, optional): The Azure endpoint for the model (Azure only).
|
|
21
|
+
azure_version (str): The Azure version for the model (Azure only).
|
|
22
|
+
azure_deployment (str): The Azure deployment for the model (Azure only).
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
25
|
embedding_endpoint_type: EmbeddingConfigEmbeddingEndpointType = pydantic.Field()
|
letta/types/job.py
CHANGED
|
@@ -15,11 +15,11 @@ class Job(UniversalBaseModel):
|
|
|
15
15
|
Representation of offline jobs, used for tracking status of data loading tasks (involving parsing and embedding files).
|
|
16
16
|
|
|
17
17
|
Parameters:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
id (str): The unique identifier of the job.
|
|
19
|
+
status (JobStatus): The status of the job.
|
|
20
|
+
created_at (datetime): The unix timestamp of when the job was created.
|
|
21
|
+
completed_at (datetime): The unix timestamp of when the job was completed.
|
|
22
|
+
user_id (str): The unique identifier of the user associated with the.
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
25
|
created_by_id: typing.Optional[str] = pydantic.Field(default=None)
|
letta/types/letta_response.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
4
|
import typing
|
|
5
|
+
from .letta_response_messages_item import LettaResponseMessagesItem
|
|
5
6
|
import pydantic
|
|
6
7
|
from .letta_usage_statistics import LettaUsageStatistics
|
|
7
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
@@ -13,11 +14,11 @@ class LettaResponse(UniversalBaseModel):
|
|
|
13
14
|
The type of the returned messages can be either `Message` or `LettaMessage`, depending on what was specified in the request.
|
|
14
15
|
|
|
15
16
|
Attributes:
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
messages (List[Union[Message, LettaMessage]]): The messages returned by the agent.
|
|
18
|
+
usage (LettaUsageStatistics): The usage statistics
|
|
18
19
|
"""
|
|
19
20
|
|
|
20
|
-
messages: typing.List[
|
|
21
|
+
messages: typing.List[LettaResponseMessagesItem] = pydantic.Field()
|
|
21
22
|
"""
|
|
22
23
|
The messages returned by the agent.
|
|
23
24
|
"""
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
5
|
+
import typing
|
|
6
|
+
import datetime as dt
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
import pydantic
|
|
9
|
+
from .tool_call_message_tool_call import ToolCallMessageToolCall
|
|
10
|
+
from .tool_return_message_status import ToolReturnMessageStatus
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class LettaResponseMessagesItem_SystemMessage(UniversalBaseModel):
|
|
14
|
+
message_type: typing.Literal["system_message"] = "system_message"
|
|
15
|
+
id: str
|
|
16
|
+
date: dt.datetime
|
|
17
|
+
message: str
|
|
18
|
+
|
|
19
|
+
if IS_PYDANTIC_V2:
|
|
20
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
21
|
+
else:
|
|
22
|
+
|
|
23
|
+
class Config:
|
|
24
|
+
frozen = True
|
|
25
|
+
smart_union = True
|
|
26
|
+
extra = pydantic.Extra.allow
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class LettaResponseMessagesItem_UserMessage(UniversalBaseModel):
|
|
30
|
+
message_type: typing.Literal["user_message"] = "user_message"
|
|
31
|
+
id: str
|
|
32
|
+
date: dt.datetime
|
|
33
|
+
message: str
|
|
34
|
+
|
|
35
|
+
if IS_PYDANTIC_V2:
|
|
36
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
37
|
+
else:
|
|
38
|
+
|
|
39
|
+
class Config:
|
|
40
|
+
frozen = True
|
|
41
|
+
smart_union = True
|
|
42
|
+
extra = pydantic.Extra.allow
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class LettaResponseMessagesItem_ReasoningMessage(UniversalBaseModel):
|
|
46
|
+
message_type: typing.Literal["reasoning_message"] = "reasoning_message"
|
|
47
|
+
id: str
|
|
48
|
+
date: dt.datetime
|
|
49
|
+
reasoning: str
|
|
50
|
+
|
|
51
|
+
if IS_PYDANTIC_V2:
|
|
52
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
53
|
+
else:
|
|
54
|
+
|
|
55
|
+
class Config:
|
|
56
|
+
frozen = True
|
|
57
|
+
smart_union = True
|
|
58
|
+
extra = pydantic.Extra.allow
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class LettaResponseMessagesItem_ToolCallMessage(UniversalBaseModel):
|
|
62
|
+
message_type: typing.Literal["tool_call_message"] = "tool_call_message"
|
|
63
|
+
id: str
|
|
64
|
+
date: dt.datetime
|
|
65
|
+
tool_call: ToolCallMessageToolCall
|
|
66
|
+
|
|
67
|
+
if IS_PYDANTIC_V2:
|
|
68
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
69
|
+
else:
|
|
70
|
+
|
|
71
|
+
class Config:
|
|
72
|
+
frozen = True
|
|
73
|
+
smart_union = True
|
|
74
|
+
extra = pydantic.Extra.allow
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class LettaResponseMessagesItem_ToolReturnMessage(UniversalBaseModel):
|
|
78
|
+
message_type: typing.Literal["tool_return_message"] = "tool_return_message"
|
|
79
|
+
id: str
|
|
80
|
+
date: dt.datetime
|
|
81
|
+
tool_return: str
|
|
82
|
+
status: ToolReturnMessageStatus
|
|
83
|
+
tool_call_id: str
|
|
84
|
+
stdout: typing.Optional[typing.List[str]] = None
|
|
85
|
+
stderr: typing.Optional[typing.List[str]] = None
|
|
86
|
+
|
|
87
|
+
if IS_PYDANTIC_V2:
|
|
88
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
89
|
+
else:
|
|
90
|
+
|
|
91
|
+
class Config:
|
|
92
|
+
frozen = True
|
|
93
|
+
smart_union = True
|
|
94
|
+
extra = pydantic.Extra.allow
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class LettaResponseMessagesItem_AssistantMessage(UniversalBaseModel):
|
|
98
|
+
message_type: typing.Literal["assistant_message"] = "assistant_message"
|
|
99
|
+
id: str
|
|
100
|
+
date: dt.datetime
|
|
101
|
+
assistant_message: str
|
|
102
|
+
|
|
103
|
+
if IS_PYDANTIC_V2:
|
|
104
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
105
|
+
else:
|
|
106
|
+
|
|
107
|
+
class Config:
|
|
108
|
+
frozen = True
|
|
109
|
+
smart_union = True
|
|
110
|
+
extra = pydantic.Extra.allow
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
LettaResponseMessagesItem = typing.Union[
|
|
114
|
+
LettaResponseMessagesItem_SystemMessage,
|
|
115
|
+
LettaResponseMessagesItem_UserMessage,
|
|
116
|
+
LettaResponseMessagesItem_ReasoningMessage,
|
|
117
|
+
LettaResponseMessagesItem_ToolCallMessage,
|
|
118
|
+
LettaResponseMessagesItem_ToolReturnMessage,
|
|
119
|
+
LettaResponseMessagesItem_AssistantMessage,
|
|
120
|
+
]
|
|
@@ -14,16 +14,16 @@ class LettaSchemasMessageMessage(UniversalBaseModel):
|
|
|
14
14
|
Letta's internal representation of a message. Includes methods to convert to/from LLM provider formats.
|
|
15
15
|
|
|
16
16
|
Attributes:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
id (str): The unique identifier of the message.
|
|
18
|
+
role (MessageRole): The role of the participant.
|
|
19
|
+
text (str): The text of the message.
|
|
20
|
+
user_id (str): The unique identifier of the user.
|
|
21
|
+
agent_id (str): The unique identifier of the agent.
|
|
22
|
+
model (str): The model used to make the function call.
|
|
23
|
+
name (str): The name of the participant.
|
|
24
|
+
created_at (datetime): The time the message was created.
|
|
25
|
+
tool_calls (List[ToolCall]): The list of tool calls requested.
|
|
26
|
+
tool_call_id (str): The id of the tool call.
|
|
27
27
|
"""
|
|
28
28
|
|
|
29
29
|
created_by_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
@@ -11,11 +11,11 @@ class LettaSchemasToolTool(UniversalBaseModel):
|
|
|
11
11
|
Representation of a tool, which is a function that can be called by the agent.
|
|
12
12
|
|
|
13
13
|
Parameters:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
id (str): The unique identifier of the tool.
|
|
15
|
+
name (str): The name of the function.
|
|
16
|
+
tags (List[str]): Metadata tags.
|
|
17
|
+
source_code (str): The source code of the function.
|
|
18
|
+
json_schema (Dict): The JSON schema of the function.
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
id: typing.Optional[str] = pydantic.Field(default=None)
|
|
@@ -11,13 +11,12 @@ class LettaUsageStatistics(UniversalBaseModel):
|
|
|
11
11
|
Usage statistics for the agent interaction.
|
|
12
12
|
|
|
13
13
|
Attributes:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
completion_tokens (int): The number of tokens generated by the agent.
|
|
15
|
+
prompt_tokens (int): The number of tokens in the prompt.
|
|
16
|
+
total_tokens (int): The total number of tokens processed by the agent.
|
|
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
|
|
21
20
|
completion_tokens: typing.Optional[int] = pydantic.Field(default=None)
|
|
22
21
|
"""
|
|
23
22
|
The number of tokens generated by the agent.
|
letta/types/llm_config.py
CHANGED
|
@@ -12,17 +12,17 @@ class LlmConfig(UniversalBaseModel):
|
|
|
12
12
|
Configuration for a Language Model (LLM) model. This object specifies all the information necessary to access an LLM model to usage with Letta, except for secret keys.
|
|
13
13
|
|
|
14
14
|
Attributes:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
model (str): The name of the LLM model.
|
|
16
|
+
model_endpoint_type (str): The endpoint type for the model.
|
|
17
|
+
model_endpoint (str): The endpoint for the model.
|
|
18
|
+
model_wrapper (str): The wrapper for the model. This is used to wrap additional text around the input/output of the model. This is useful for text-to-text completions, such as the Completions API in OpenAI.
|
|
19
|
+
context_window (int): The context window size for the model.
|
|
20
|
+
put_inner_thoughts_in_kwargs (bool): Puts `inner_thoughts` as a kwarg in the function call if this is set to True. This helps with function calling performance and also the generation of inner thoughts.
|
|
21
21
|
"""
|
|
22
22
|
|
|
23
23
|
model: str = pydantic.Field()
|
|
24
24
|
"""
|
|
25
|
-
LLM model name.
|
|
25
|
+
LLM model name.
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
28
|
model_endpoint_type: LlmConfigModelEndpointType = pydantic.Field()
|
letta/types/passage.py
CHANGED
|
@@ -15,14 +15,14 @@ class Passage(UniversalBaseModel):
|
|
|
15
15
|
Representation of a passage, which is stored in archival memory.
|
|
16
16
|
|
|
17
17
|
Parameters:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
text (str): The text of the passage.
|
|
19
|
+
embedding (List[float]): The embedding of the passage.
|
|
20
|
+
embedding_config (EmbeddingConfig): The embedding configuration used by the passage.
|
|
21
|
+
created_at (datetime): The creation date of the passage.
|
|
22
|
+
user_id (str): The unique identifier of the user associated with the passage.
|
|
23
|
+
agent_id (str): The unique identifier of the agent associated with the passage.
|
|
24
|
+
source_id (str): The data source of the passage.
|
|
25
|
+
file_id (str): The unique identifier of the file associated with the passage.
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
28
|
created_by_id: typing.Optional[str] = pydantic.Field(default=None)
|
letta/types/reasoning_message.py
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
4
|
import datetime as dt
|
|
5
|
-
import typing
|
|
6
5
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
+
import typing
|
|
7
7
|
import pydantic
|
|
8
8
|
|
|
9
9
|
|
|
@@ -12,14 +12,13 @@ class ReasoningMessage(UniversalBaseModel):
|
|
|
12
12
|
Representation of an agent's internal reasoning.
|
|
13
13
|
|
|
14
14
|
Attributes:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
reasoning (str): The internal reasoning of the agent
|
|
16
|
+
id (str): The ID of the message
|
|
17
|
+
date (datetime): The date the message was created in ISO format
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
20
|
id: str
|
|
21
21
|
date: dt.datetime
|
|
22
|
-
message_type: typing.Literal["reasoning_message"] = "reasoning_message"
|
|
23
22
|
reasoning: str
|
|
24
23
|
|
|
25
24
|
if IS_PYDANTIC_V2:
|
|
@@ -48,14 +48,14 @@ class SandboxEnvironmentVariable(UniversalBaseModel):
|
|
|
48
48
|
An optional description of the environment variable.
|
|
49
49
|
"""
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
organization_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
52
52
|
"""
|
|
53
|
-
The ID of the
|
|
53
|
+
The ID of the organization this environment variable belongs to.
|
|
54
54
|
"""
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
sandbox_config_id: str = pydantic.Field()
|
|
57
57
|
"""
|
|
58
|
-
The ID of the
|
|
58
|
+
The ID of the sandbox config this environment variable belongs to.
|
|
59
59
|
"""
|
|
60
60
|
|
|
61
61
|
if IS_PYDANTIC_V2:
|
|
@@ -7,10 +7,6 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class SandboxEnvironmentVariableUpdate(UniversalBaseModel):
|
|
10
|
-
"""
|
|
11
|
-
Pydantic model for updating SandboxEnvironmentVariable fields.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
10
|
key: typing.Optional[str] = pydantic.Field(default=None)
|
|
15
11
|
"""
|
|
16
12
|
The name of the environment variable.
|
letta/types/source.py
CHANGED
|
@@ -15,12 +15,12 @@ class Source(UniversalBaseModel):
|
|
|
15
15
|
Representation of a source, which is a collection of files and passages.
|
|
16
16
|
|
|
17
17
|
Parameters:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
id (str): The ID of the source
|
|
19
|
+
name (str): The name of the source.
|
|
20
|
+
embedding_config (EmbeddingConfig): The embedding configuration used by the source.
|
|
21
|
+
user_id (str): The ID of the user that created the source.
|
|
22
|
+
metadata_ (dict): Metadata associated with the source.
|
|
23
|
+
description (str): The description of the source.
|
|
24
24
|
"""
|
|
25
25
|
|
|
26
26
|
id: typing.Optional[str] = pydantic.Field(default=None)
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
4
|
import datetime as dt
|
|
5
|
-
import typing
|
|
6
5
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
+
import typing
|
|
7
7
|
import pydantic
|
|
8
8
|
|
|
9
9
|
|
|
@@ -12,14 +12,13 @@ class SystemMessageOutput(UniversalBaseModel):
|
|
|
12
12
|
A message generated by the system. Never streamed back on a response, only used for cursor pagination.
|
|
13
13
|
|
|
14
14
|
Attributes:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
message (str): The message sent by the system
|
|
16
|
+
id (str): The ID of the message
|
|
17
|
+
date (datetime): The date the message was created in ISO format
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
20
|
id: str
|
|
21
21
|
date: dt.datetime
|
|
22
|
-
message_type: typing.Literal["system_message"] = "system_message"
|
|
23
22
|
message: str
|
|
24
23
|
|
|
25
24
|
if IS_PYDANTIC_V2:
|
letta/types/tool_call_message.py
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
4
|
import datetime as dt
|
|
5
|
-
import typing
|
|
6
5
|
from .tool_call_message_tool_call import ToolCallMessageToolCall
|
|
7
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
import typing
|
|
8
8
|
import pydantic
|
|
9
9
|
|
|
10
10
|
|
|
@@ -13,14 +13,13 @@ class ToolCallMessage(UniversalBaseModel):
|
|
|
13
13
|
A message representing a request to call a tool (generated by the LLM to trigger tool execution).
|
|
14
14
|
|
|
15
15
|
Attributes:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
tool_call (Union[ToolCall, ToolCallDelta]): The tool call
|
|
17
|
+
id (str): The ID of the message
|
|
18
|
+
date (datetime): The date the message was created in ISO format
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
id: str
|
|
22
22
|
date: dt.datetime
|
|
23
|
-
message_type: typing.Literal["tool_call_message"] = "tool_call_message"
|
|
24
23
|
tool_call: ToolCallMessageToolCall
|
|
25
24
|
|
|
26
25
|
if IS_PYDANTIC_V2:
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
4
|
import datetime as dt
|
|
5
|
-
import typing
|
|
6
5
|
from .tool_return_message_status import ToolReturnMessageStatus
|
|
6
|
+
import typing
|
|
7
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
8
|
import pydantic
|
|
9
9
|
|
|
@@ -13,18 +13,17 @@ class ToolReturnMessage(UniversalBaseModel):
|
|
|
13
13
|
A message representing the return value of a tool call (generated by Letta executing the requested tool).
|
|
14
14
|
|
|
15
15
|
Attributes:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
tool_return (str): The return value of the tool
|
|
17
|
+
status (Literal["success", "error"]): The status of the tool call
|
|
18
|
+
id (str): The ID of the message
|
|
19
|
+
date (datetime): The date the message was created in ISO format
|
|
20
|
+
tool_call_id (str): A unique identifier for the tool call that generated this message
|
|
21
|
+
stdout (Optional[List(str)]): Captured stdout (e.g. prints, logs) from the tool invocation
|
|
22
|
+
stderr (Optional[List(str)]): Captured stderr from the tool invocation
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
25
|
id: str
|
|
26
26
|
date: dt.datetime
|
|
27
|
-
message_type: typing.Literal["tool_return_message"] = "tool_return_message"
|
|
28
27
|
tool_return: str
|
|
29
28
|
status: ToolReturnMessageStatus
|
|
30
29
|
tool_call_id: str
|
letta/types/user.py
CHANGED
|
@@ -12,9 +12,9 @@ class User(UniversalBaseModel):
|
|
|
12
12
|
Representation of a user.
|
|
13
13
|
|
|
14
14
|
Parameters:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
id (str): The unique identifier of the user.
|
|
16
|
+
name (str): The name of the user.
|
|
17
|
+
created_at (datetime): The creation date of the user.
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
20
|
id: typing.Optional[str] = pydantic.Field(default=None)
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
4
|
import datetime as dt
|
|
5
|
-
import typing
|
|
6
5
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
+
import typing
|
|
7
7
|
import pydantic
|
|
8
8
|
|
|
9
9
|
|
|
@@ -12,14 +12,13 @@ class UserMessageOutput(UniversalBaseModel):
|
|
|
12
12
|
A message sent by the user. Never streamed back on a response, only used for cursor pagination.
|
|
13
13
|
|
|
14
14
|
Attributes:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
message (str): The message sent by the user
|
|
16
|
+
id (str): The ID of the message
|
|
17
|
+
date (datetime): The date the message was created in ISO format
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
20
|
id: str
|
|
21
21
|
date: dt.datetime
|
|
22
|
-
message_type: typing.Literal["user_message"] = "user_message"
|
|
23
22
|
message: str
|
|
24
23
|
|
|
25
24
|
if IS_PYDANTIC_V2:
|