letta-client 0.1.4__py3-none-any.whl → 0.1.9__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/__init__.py +44 -21
- letta/agents/__init__.py +71 -24
- letta/agents/archival_memory/client.py +17 -17
- letta/agents/client.py +424 -1700
- letta/agents/context/client.py +5 -5
- letta/agents/core_memory/client.py +1080 -0
- letta/agents/memory_variables/__init__.py +5 -0
- letta/agents/{memory → memory_variables}/client.py +41 -40
- letta/agents/memory_variables/types/__init__.py +5 -0
- letta/agents/{types/agents_get_agent_variables_response.py → memory_variables/types/memory_variables_get_response.py} +3 -3
- letta/agents/messages/__init__.py +36 -2
- letta/agents/messages/client.py +278 -17
- letta/agents/messages/types/__init__.py +37 -3
- letta/agents/messages/types/letta_streaming_response.py +139 -16
- letta/agents/messages/types/messages_list_response_item.py +121 -9
- letta/agents/recall_memory/client.py +5 -5
- letta/agents/sources/client.py +5 -5
- letta/agents/templates/__init__.py +5 -0
- letta/agents/templates/client.py +578 -0
- letta/agents/templates/types/__init__.py +5 -0
- letta/agents/templates/types/templates_migrate_response.py +19 -0
- letta/agents/tools/client.py +13 -13
- letta/agents/types/__init__.py +23 -29
- letta/agents/types/agents_search_request_combinator.py +5 -0
- letta/agents/types/agents_search_request_search_item.py +64 -0
- letta/agents/types/{agents_search_deployed_agents_request_search_item_zero.py → agents_search_request_search_item_name.py} +5 -4
- letta/agents/types/agents_search_request_search_item_name_operator.py +5 -0
- letta/agents/types/agents_search_request_search_item_order_by.py +22 -0
- letta/agents/types/agents_search_request_search_item_order_by_direction.py +5 -0
- letta/agents/types/agents_search_request_search_item_order_by_value.py +5 -0
- letta/agents/types/{agents_migrate_response.py → agents_search_request_search_item_version.py} +3 -3
- letta/blocks/client.py +25 -25
- letta/client.py +8 -4
- letta/core/__init__.py +4 -0
- letta/core/client_wrapper.py +7 -18
- letta/core/unchecked_base_model.py +305 -0
- letta/health/client.py +3 -3
- letta/jobs/client.py +17 -17
- letta/models/client.py +5 -5
- letta/providers/client.py +597 -0
- letta/sources/client.py +33 -33
- letta/sources/files/client.py +11 -11
- letta/sources/passages/client.py +5 -5
- letta/tools/client.py +77 -57
- letta/types/__init__.py +22 -0
- letta/types/action_model.py +2 -2
- letta/types/action_parameters_model.py +2 -2
- letta/types/action_response_model.py +2 -2
- letta/types/agent_environment_variable.py +63 -0
- letta/types/agent_state.py +19 -16
- letta/types/agent_type.py +1 -2
- letta/types/app_auth_scheme.py +2 -2
- letta/types/app_model.py +2 -2
- letta/types/archival_memory_summary.py +2 -2
- letta/types/assistant_file.py +2 -2
- letta/types/assistant_message_input.py +2 -2
- letta/types/assistant_message_output.py +3 -4
- letta/types/auth_request.py +2 -2
- letta/types/auth_response.py +2 -2
- letta/types/auth_scheme_field.py +2 -2
- letta/types/block.py +11 -16
- letta/types/block_update.py +2 -2
- letta/types/chat_completion_request.py +2 -2
- letta/types/chat_completion_response.py +2 -2
- letta/types/child_tool_rule.py +2 -2
- letta/types/choice.py +2 -2
- letta/types/conditional_tool_rule.py +2 -2
- letta/types/conflict_error_body.py +2 -2
- letta/types/context_window_overview.py +7 -2
- letta/types/create_assistant_file_request.py +2 -2
- letta/types/create_assistant_request.py +2 -2
- letta/types/create_block.py +2 -2
- letta/types/delete_assistant_file_response.py +2 -2
- letta/types/delete_assistant_response.py +2 -2
- letta/types/e_2_b_sandbox_config.py +2 -2
- letta/types/embedding_config.py +10 -10
- letta/types/file_metadata.py +2 -7
- letta/types/function_call_input.py +2 -2
- letta/types/function_call_output.py +2 -2
- letta/types/function_schema.py +2 -2
- letta/types/health.py +2 -2
- letta/types/http_validation_error.py +2 -2
- letta/types/init_tool_rule.py +2 -2
- letta/types/internal_server_error_body.py +2 -2
- letta/types/job.py +7 -12
- letta/types/letta_request.py +7 -2
- letta/types/letta_response.py +6 -5
- letta/types/letta_response_messages_item.py +125 -0
- letta/types/letta_schemas_letta_message_tool_call.py +2 -2
- letta/types/letta_schemas_message_message.py +12 -17
- letta/types/letta_schemas_openai_chat_completion_request_tool.py +2 -2
- letta/types/letta_schemas_openai_chat_completion_request_tool_call.py +2 -2
- letta/types/letta_schemas_openai_chat_completion_request_tool_call_function.py +2 -2
- letta/types/letta_schemas_openai_chat_completion_response_message.py +2 -2
- letta/types/letta_schemas_openai_chat_completion_response_tool_call.py +2 -2
- letta/types/letta_schemas_openai_chat_completions_tool_call_function.py +2 -2
- letta/types/letta_schemas_openai_chat_completions_tool_call_input.py +2 -2
- letta/types/letta_schemas_openai_chat_completions_tool_call_output.py +2 -2
- letta/types/letta_schemas_tool_tool.py +14 -13
- letta/types/letta_usage_statistics.py +6 -7
- letta/types/llm_config.py +9 -9
- letta/types/local_sandbox_config.py +2 -2
- letta/types/log_prob_token.py +2 -2
- letta/types/memory.py +2 -2
- letta/types/message_content_log_prob.py +2 -2
- letta/types/message_create.py +2 -2
- letta/types/not_found_error_body.py +2 -2
- letta/types/open_ai_assistant.py +2 -2
- letta/types/organization.py +2 -2
- letta/types/organization_create.py +2 -2
- letta/types/passage.py +10 -15
- letta/types/provider.py +38 -0
- letta/types/reasoning_message.py +6 -7
- letta/types/recall_memory_summary.py +2 -2
- letta/types/response_format.py +2 -2
- letta/types/sandbox_config.py +2 -7
- letta/types/sandbox_config_create.py +2 -2
- letta/types/sandbox_config_update.py +2 -2
- letta/types/sandbox_environment_variable.py +2 -7
- letta/types/sandbox_environment_variable_create.py +2 -2
- letta/types/sandbox_environment_variable_update.py +2 -6
- letta/types/source.py +8 -13
- letta/types/system_message_input.py +2 -2
- letta/types/system_message_output.py +6 -7
- letta/types/terminal_tool_rule.py +2 -2
- letta/types/tool_call_delta.py +2 -2
- letta/types/tool_call_function_output.py +2 -2
- letta/types/tool_call_message.py +6 -7
- letta/types/tool_create.py +2 -2
- letta/types/tool_function_choice.py +2 -2
- letta/types/tool_input.py +2 -2
- letta/types/tool_message.py +2 -2
- letta/types/tool_return_message.py +10 -11
- letta/types/tool_type.py +5 -0
- letta/types/usage_statistics.py +2 -2
- letta/types/user.py +5 -10
- letta/types/user_create.py +2 -7
- letta/types/user_message_input.py +2 -2
- letta/types/user_message_output.py +6 -7
- letta/types/user_update.py +2 -7
- letta/types/validation_error.py +2 -2
- {letta_client-0.1.4.dist-info → letta_client-0.1.9.dist-info}/METADATA +1 -1
- letta_client-0.1.9.dist-info/RECORD +200 -0
- letta/agents/memory/__init__.py +0 -5
- letta/agents/memory/messages/client.py +0 -147
- letta/agents/memory_blocks/client.py +0 -364
- letta/agents/types/agents_search_deployed_agents_request_combinator.py +0 -5
- letta/agents/types/agents_search_deployed_agents_request_search_item.py +0 -16
- 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/agents/types/agents_search_deployed_agents_request_search_item_direction_value.py +0 -7
- letta/agents/types/agents_search_deployed_agents_request_search_item_operator.py +0 -24
- letta/agents/types/agents_search_deployed_agents_request_search_item_operator_operator.py +0 -7
- letta_client-0.1.4.dist-info/RECORD +0 -191
- /letta/agents/{memory/messages → core_memory}/__init__.py +0 -0
- /letta/{agents/memory_blocks → providers}/__init__.py +0 -0
- {letta_client-0.1.4.dist-info → letta_client-0.1.9.dist-info}/WHEEL +0 -0
letta/types/file_metadata.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
import pydantic
|
|
6
6
|
import datetime as dt
|
|
7
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class FileMetadata(
|
|
10
|
+
class FileMetadata(UncheckedBaseModel):
|
|
11
11
|
"""
|
|
12
12
|
Representation of a single FileMetadata
|
|
13
13
|
"""
|
|
@@ -17,11 +17,6 @@ class FileMetadata(UniversalBaseModel):
|
|
|
17
17
|
The human-friendly ID of the File
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
|
-
organization_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
21
|
-
"""
|
|
22
|
-
The unique identifier of the organization associated with the document.
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
20
|
source_id: str = pydantic.Field()
|
|
26
21
|
"""
|
|
27
22
|
The unique identifier of the source associated with the document.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
5
5
|
import typing
|
|
6
6
|
import pydantic
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class FunctionCallInput(
|
|
9
|
+
class FunctionCallInput(UncheckedBaseModel):
|
|
10
10
|
name: str
|
|
11
11
|
|
|
12
12
|
if IS_PYDANTIC_V2:
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
5
5
|
import typing
|
|
6
6
|
import pydantic
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class FunctionCallOutput(
|
|
9
|
+
class FunctionCallOutput(UncheckedBaseModel):
|
|
10
10
|
arguments: str
|
|
11
11
|
name: str
|
|
12
12
|
|
letta/types/function_schema.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
6
|
import pydantic
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class FunctionSchema(
|
|
9
|
+
class FunctionSchema(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
|
letta/types/health.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
5
5
|
import typing
|
|
6
6
|
import pydantic
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class Health(
|
|
9
|
+
class Health(UncheckedBaseModel):
|
|
10
10
|
"""
|
|
11
11
|
Health check response body
|
|
12
12
|
"""
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
from .validation_error import ValidationError
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
7
|
import pydantic
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class HttpValidationError(
|
|
10
|
+
class HttpValidationError(UncheckedBaseModel):
|
|
11
11
|
detail: typing.Optional[typing.List[ValidationError]] = None
|
|
12
12
|
|
|
13
13
|
if IS_PYDANTIC_V2:
|
letta/types/init_tool_rule.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import pydantic
|
|
5
5
|
import typing
|
|
6
6
|
from .tool_rule_type import ToolRuleType
|
|
7
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class InitToolRule(
|
|
10
|
+
class InitToolRule(UncheckedBaseModel):
|
|
11
11
|
"""
|
|
12
12
|
Represents the initial tool rule configuration.
|
|
13
13
|
"""
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
6
|
import pydantic
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class InternalServerErrorBody(
|
|
9
|
+
class InternalServerErrorBody(UncheckedBaseModel):
|
|
10
10
|
message: typing.Literal["Failed to create agent template"] = "Failed to create agent template"
|
|
11
11
|
|
|
12
12
|
if IS_PYDANTIC_V2:
|
letta/types/job.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
import pydantic
|
|
6
6
|
import datetime as dt
|
|
@@ -10,16 +10,16 @@ from ..core.serialization import FieldMetadata
|
|
|
10
10
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
class Job(
|
|
13
|
+
class Job(UncheckedBaseModel):
|
|
14
14
|
"""
|
|
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)
|
|
@@ -64,11 +64,6 @@ class Job(UniversalBaseModel):
|
|
|
64
64
|
The human-friendly ID of the Job
|
|
65
65
|
"""
|
|
66
66
|
|
|
67
|
-
user_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
68
|
-
"""
|
|
69
|
-
The unique identifier of the user associated with the job.
|
|
70
|
-
"""
|
|
71
|
-
|
|
72
67
|
if IS_PYDANTIC_V2:
|
|
73
68
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
74
69
|
else:
|
letta/types/letta_request.py
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
from .message_create import MessageCreate
|
|
6
6
|
import pydantic
|
|
7
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class LettaRequest(
|
|
10
|
+
class LettaRequest(UncheckedBaseModel):
|
|
11
11
|
messages: typing.List[MessageCreate] = pydantic.Field()
|
|
12
12
|
"""
|
|
13
13
|
The messages to be sent to the agent.
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
|
+
use_assistant_message: typing.Optional[bool] = pydantic.Field(default=None)
|
|
17
|
+
"""
|
|
18
|
+
Whether the server should parse specific tool call arguments (default `send_message`) as `AssistantMessage` objects.
|
|
19
|
+
"""
|
|
20
|
+
|
|
16
21
|
assistant_message_tool_name: typing.Optional[str] = pydantic.Field(default=None)
|
|
17
22
|
"""
|
|
18
23
|
The name of the designated message tool.
|
letta/types/letta_response.py
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
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
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
class LettaResponse(
|
|
11
|
+
class LettaResponse(UncheckedBaseModel):
|
|
11
12
|
"""
|
|
12
13
|
Response object from an agent interaction, consisting of the new messages generated by the agent and usage statistics.
|
|
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,125 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
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
|
+
import typing_extensions
|
|
12
|
+
from ..core.unchecked_base_model import UnionMetadata
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class LettaResponseMessagesItem_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 LettaResponseMessagesItem_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 LettaResponseMessagesItem_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 LettaResponseMessagesItem_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 LettaResponseMessagesItem_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 LettaResponseMessagesItem_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
|
+
LettaResponseMessagesItem = typing_extensions.Annotated[
|
|
116
|
+
typing.Union[
|
|
117
|
+
LettaResponseMessagesItem_SystemMessage,
|
|
118
|
+
LettaResponseMessagesItem_UserMessage,
|
|
119
|
+
LettaResponseMessagesItem_ReasoningMessage,
|
|
120
|
+
LettaResponseMessagesItem_ToolCallMessage,
|
|
121
|
+
LettaResponseMessagesItem_ToolReturnMessage,
|
|
122
|
+
LettaResponseMessagesItem_AssistantMessage,
|
|
123
|
+
],
|
|
124
|
+
UnionMetadata(discriminant="message_type"),
|
|
125
|
+
]
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
5
5
|
import typing
|
|
6
6
|
import pydantic
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class LettaSchemasLettaMessageToolCall(
|
|
9
|
+
class LettaSchemasLettaMessageToolCall(UncheckedBaseModel):
|
|
10
10
|
name: str
|
|
11
11
|
arguments: str
|
|
12
12
|
tool_call_id: str
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
import pydantic
|
|
6
6
|
import datetime as dt
|
|
@@ -9,21 +9,21 @@ from .letta_schemas_openai_chat_completions_tool_call_output import LettaSchemas
|
|
|
9
9
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class LettaSchemasMessageMessage(
|
|
12
|
+
class LettaSchemasMessageMessage(UncheckedBaseModel):
|
|
13
13
|
"""
|
|
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)
|
|
@@ -61,11 +61,6 @@ class LettaSchemasMessageMessage(UniversalBaseModel):
|
|
|
61
61
|
The text of the message.
|
|
62
62
|
"""
|
|
63
63
|
|
|
64
|
-
organization_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
65
|
-
"""
|
|
66
|
-
The unique identifier of the organization.
|
|
67
|
-
"""
|
|
68
|
-
|
|
69
64
|
agent_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
70
65
|
"""
|
|
71
66
|
The unique identifier of the agent.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
from .function_schema import FunctionSchema
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
7
|
import pydantic
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class LettaSchemasOpenaiChatCompletionRequestTool(
|
|
10
|
+
class LettaSchemasOpenaiChatCompletionRequestTool(UncheckedBaseModel):
|
|
11
11
|
type: typing.Optional[typing.Literal["function"]] = None
|
|
12
12
|
function: FunctionSchema
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
from .letta_schemas_openai_chat_completion_request_tool_call_function import (
|
|
6
6
|
LettaSchemasOpenaiChatCompletionRequestToolCallFunction,
|
|
@@ -9,7 +9,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
|
9
9
|
import pydantic
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class LettaSchemasOpenaiChatCompletionRequestToolCall(
|
|
12
|
+
class LettaSchemasOpenaiChatCompletionRequestToolCall(UncheckedBaseModel):
|
|
13
13
|
id: str
|
|
14
14
|
type: typing.Optional[typing.Literal["function"]] = None
|
|
15
15
|
function: LettaSchemasOpenaiChatCompletionRequestToolCallFunction
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
5
5
|
import typing
|
|
6
6
|
import pydantic
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class LettaSchemasOpenaiChatCompletionRequestToolCallFunction(
|
|
9
|
+
class LettaSchemasOpenaiChatCompletionRequestToolCallFunction(UncheckedBaseModel):
|
|
10
10
|
name: str
|
|
11
11
|
arguments: str
|
|
12
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
from .letta_schemas_openai_chat_completion_response_tool_call import LettaSchemasOpenaiChatCompletionResponseToolCall
|
|
6
6
|
from .function_call_output import FunctionCallOutput
|
|
@@ -8,7 +8,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
|
8
8
|
import pydantic
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class LettaSchemasOpenaiChatCompletionResponseMessage(
|
|
11
|
+
class LettaSchemasOpenaiChatCompletionResponseMessage(UncheckedBaseModel):
|
|
12
12
|
content: typing.Optional[str] = None
|
|
13
13
|
tool_calls: typing.Optional[typing.List[LettaSchemasOpenaiChatCompletionResponseToolCall]] = None
|
|
14
14
|
role: str
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
from .function_call_output import FunctionCallOutput
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
7
|
import pydantic
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class LettaSchemasOpenaiChatCompletionResponseToolCall(
|
|
10
|
+
class LettaSchemasOpenaiChatCompletionResponseToolCall(UncheckedBaseModel):
|
|
11
11
|
id: str
|
|
12
12
|
type: typing.Optional[typing.Literal["function"]] = None
|
|
13
13
|
function: FunctionCallOutput
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import pydantic
|
|
5
5
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
6
|
import typing
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class LettaSchemasOpenaiChatCompletionsToolCallFunction(
|
|
9
|
+
class LettaSchemasOpenaiChatCompletionsToolCallFunction(UncheckedBaseModel):
|
|
10
10
|
name: str = pydantic.Field()
|
|
11
11
|
"""
|
|
12
12
|
The name of the function to call
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import pydantic
|
|
5
5
|
import typing
|
|
6
6
|
from .letta_schemas_openai_chat_completions_tool_call_function import LettaSchemasOpenaiChatCompletionsToolCallFunction
|
|
7
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class LettaSchemasOpenaiChatCompletionsToolCallInput(
|
|
10
|
+
class LettaSchemasOpenaiChatCompletionsToolCallInput(UncheckedBaseModel):
|
|
11
11
|
id: str = pydantic.Field()
|
|
12
12
|
"""
|
|
13
13
|
The ID of the tool call
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import pydantic
|
|
5
5
|
import typing
|
|
6
6
|
from .tool_call_function_output import ToolCallFunctionOutput
|
|
7
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class LettaSchemasOpenaiChatCompletionsToolCallOutput(
|
|
10
|
+
class LettaSchemasOpenaiChatCompletionsToolCallOutput(UncheckedBaseModel):
|
|
11
11
|
id: str = pydantic.Field()
|
|
12
12
|
"""
|
|
13
13
|
The ID of the tool call
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
import pydantic
|
|
6
|
+
from .tool_type import ToolType
|
|
6
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
class LettaSchemasToolTool(
|
|
10
|
+
class LettaSchemasToolTool(UncheckedBaseModel):
|
|
10
11
|
"""
|
|
11
12
|
Representation of a tool, which is a function that can be called by the agent.
|
|
12
13
|
|
|
13
14
|
Parameters:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
id (str): The unique identifier of the tool.
|
|
16
|
+
name (str): The name of the function.
|
|
17
|
+
tags (List[str]): Metadata tags.
|
|
18
|
+
source_code (str): The source code of the function.
|
|
19
|
+
json_schema (Dict): The JSON schema of the function.
|
|
19
20
|
"""
|
|
20
21
|
|
|
21
22
|
id: typing.Optional[str] = pydantic.Field(default=None)
|
|
@@ -23,6 +24,11 @@ class LettaSchemasToolTool(UniversalBaseModel):
|
|
|
23
24
|
The human-friendly ID of the Tool
|
|
24
25
|
"""
|
|
25
26
|
|
|
27
|
+
tool_type: typing.Optional[ToolType] = pydantic.Field(default=None)
|
|
28
|
+
"""
|
|
29
|
+
The type of the tool.
|
|
30
|
+
"""
|
|
31
|
+
|
|
26
32
|
description: typing.Optional[str] = pydantic.Field(default=None)
|
|
27
33
|
"""
|
|
28
34
|
The description of the tool.
|
|
@@ -38,11 +44,6 @@ class LettaSchemasToolTool(UniversalBaseModel):
|
|
|
38
44
|
The module of the function.
|
|
39
45
|
"""
|
|
40
46
|
|
|
41
|
-
organization_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
42
|
-
"""
|
|
43
|
-
The unique identifier of the organization associated with the tool.
|
|
44
|
-
"""
|
|
45
|
-
|
|
46
47
|
name: typing.Optional[str] = pydantic.Field(default=None)
|
|
47
48
|
"""
|
|
48
49
|
The name of the function.
|
|
@@ -53,7 +54,7 @@ class LettaSchemasToolTool(UniversalBaseModel):
|
|
|
53
54
|
Metadata tags.
|
|
54
55
|
"""
|
|
55
56
|
|
|
56
|
-
source_code: str = pydantic.Field()
|
|
57
|
+
source_code: typing.Optional[str] = pydantic.Field(default=None)
|
|
57
58
|
"""
|
|
58
59
|
The source code of the function.
|
|
59
60
|
"""
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from ..core.
|
|
3
|
+
from ..core.unchecked_base_model import UncheckedBaseModel
|
|
4
4
|
import typing
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class LettaUsageStatistics(
|
|
9
|
+
class LettaUsageStatistics(UncheckedBaseModel):
|
|
10
10
|
"""
|
|
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.
|