letta-client 0.1.0__py3-none-any.whl → 0.1.2__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.
Files changed (201) hide show
  1. letta/__init__.py +293 -0
  2. letta/agents/__init__.py +28 -0
  3. letta/agents/archival_memory/__init__.py +2 -0
  4. letta/agents/archival_memory/client.py +591 -0
  5. letta/agents/client.py +2166 -0
  6. letta/agents/context/__init__.py +2 -0
  7. letta/agents/context/client.py +145 -0
  8. letta/agents/memory/__init__.py +5 -0
  9. letta/agents/memory/client.py +149 -0
  10. letta/agents/memory/messages/__init__.py +2 -0
  11. letta/agents/memory/messages/client.py +147 -0
  12. letta/agents/memory_blocks/__init__.py +2 -0
  13. letta/agents/memory_blocks/client.py +364 -0
  14. letta/agents/messages/__init__.py +5 -0
  15. letta/agents/messages/client.py +787 -0
  16. letta/agents/messages/types/__init__.py +7 -0
  17. letta/agents/messages/types/letta_streaming_response.py +20 -0
  18. letta/agents/messages/types/messages_list_response.py +7 -0
  19. letta/agents/messages/types/messages_list_response_item.py +13 -0
  20. letta/agents/recall_memory/__init__.py +2 -0
  21. letta/agents/recall_memory/client.py +147 -0
  22. letta/agents/sources/__init__.py +2 -0
  23. letta/agents/sources/client.py +145 -0
  24. letta/agents/tools/__init__.py +2 -0
  25. letta/agents/tools/client.py +408 -0
  26. letta/agents/types/__init__.py +13 -0
  27. letta/agents/types/agents_create_version_response.py +22 -0
  28. letta/agents/types/agents_migrate_response.py +19 -0
  29. letta/agents/types/create_agent_request_tool_rules_item.py +9 -0
  30. letta/agents/types/update_agent_tool_rules_item.py +9 -0
  31. letta/blocks/__init__.py +2 -0
  32. letta/blocks/client.py +1054 -0
  33. letta/client.py +164 -0
  34. letta/core/__init__.py +47 -0
  35. letta/core/api_error.py +15 -0
  36. letta/core/client_wrapper.py +76 -0
  37. letta/core/datetime_utils.py +28 -0
  38. letta/core/file.py +67 -0
  39. letta/core/http_client.py +499 -0
  40. letta/core/jsonable_encoder.py +101 -0
  41. letta/core/pydantic_utilities.py +296 -0
  42. letta/core/query_encoder.py +58 -0
  43. letta/core/remove_none_from_dict.py +11 -0
  44. letta/core/request_options.py +35 -0
  45. letta/core/serialization.py +272 -0
  46. letta/environment.py +8 -0
  47. letta/errors/__init__.py +8 -0
  48. letta/errors/conflict_error.py +9 -0
  49. letta/errors/internal_server_error.py +9 -0
  50. letta/errors/not_found_error.py +9 -0
  51. letta/errors/unprocessable_entity_error.py +9 -0
  52. letta/health/__init__.py +2 -0
  53. letta/health/client.py +108 -0
  54. letta/jobs/__init__.py +2 -0
  55. letta/jobs/client.py +503 -0
  56. letta/models/__init__.py +2 -0
  57. letta/models/client.py +201 -0
  58. letta/sources/__init__.py +5 -0
  59. letta/sources/client.py +1154 -0
  60. letta/sources/files/__init__.py +2 -0
  61. letta/sources/files/client.py +436 -0
  62. letta/sources/passages/__init__.py +2 -0
  63. letta/sources/passages/client.py +145 -0
  64. letta/tools/__init__.py +2 -0
  65. letta/tools/client.py +1823 -0
  66. letta/types/__init__.py +263 -0
  67. letta/types/action_model.py +36 -0
  68. letta/types/action_parameters_model.py +26 -0
  69. letta/types/action_response_model.py +26 -0
  70. letta/types/agent_state.py +139 -0
  71. letta/types/agent_state_tool_rules_item.py +9 -0
  72. letta/types/agent_type.py +8 -0
  73. letta/types/app_auth_scheme.py +34 -0
  74. letta/types/app_auth_scheme_auth_mode.py +7 -0
  75. letta/types/app_model.py +44 -0
  76. letta/types/archival_memory_summary.py +22 -0
  77. letta/types/assistant_file.py +33 -0
  78. letta/types/assistant_message_input.py +23 -0
  79. letta/types/assistant_message_output.py +23 -0
  80. letta/types/auth_request.py +22 -0
  81. letta/types/auth_response.py +29 -0
  82. letta/types/auth_scheme_field.py +30 -0
  83. letta/types/block.py +91 -0
  84. letta/types/block_update.py +60 -0
  85. letta/types/chat_completion_request.py +49 -0
  86. letta/types/chat_completion_request_function_call.py +6 -0
  87. letta/types/chat_completion_request_messages_item.py +11 -0
  88. letta/types/chat_completion_request_stop.py +5 -0
  89. letta/types/chat_completion_request_tool_choice.py +8 -0
  90. letta/types/chat_completion_response.py +32 -0
  91. letta/types/child_tool_rule.py +33 -0
  92. letta/types/choice.py +25 -0
  93. letta/types/conditional_tool_rule.py +43 -0
  94. letta/types/conflict_error_body.py +21 -0
  95. letta/types/context_window_overview.py +105 -0
  96. letta/types/create_assistant_file_request.py +22 -0
  97. letta/types/create_assistant_request.py +57 -0
  98. letta/types/create_block.py +56 -0
  99. letta/types/delete_assistant_file_response.py +28 -0
  100. letta/types/delete_assistant_response.py +28 -0
  101. letta/types/e_2_b_sandbox_config.py +32 -0
  102. letta/types/embedding_config.py +72 -0
  103. letta/types/embedding_config_embedding_endpoint_type.py +26 -0
  104. letta/types/file_metadata.py +82 -0
  105. letta/types/function_call_input.py +19 -0
  106. letta/types/function_call_output.py +20 -0
  107. letta/types/function_schema.py +21 -0
  108. letta/types/health.py +24 -0
  109. letta/types/http_validation_error.py +20 -0
  110. letta/types/init_tool_rule.py +29 -0
  111. letta/types/internal_server_error_body.py +19 -0
  112. letta/types/job.py +79 -0
  113. letta/types/job_status.py +5 -0
  114. letta/types/letta_request.py +33 -0
  115. letta/types/letta_response.py +125 -0
  116. letta/types/letta_response_assistant_message.py +23 -0
  117. letta/types/letta_response_letta_usage_statistics.py +47 -0
  118. letta/types/letta_response_reasoning_message.py +32 -0
  119. letta/types/letta_response_system_message.py +32 -0
  120. letta/types/letta_response_tool_call.py +21 -0
  121. letta/types/letta_response_tool_call_delta.py +21 -0
  122. letta/types/letta_response_tool_call_message.py +33 -0
  123. letta/types/letta_response_tool_call_message_tool_call.py +9 -0
  124. letta/types/letta_response_tool_call_message_tool_call_one.py +21 -0
  125. letta/types/letta_response_tool_call_message_tool_call_zero.py +21 -0
  126. letta/types/letta_response_tool_return_message.py +41 -0
  127. letta/types/letta_response_tool_return_message_status.py +5 -0
  128. letta/types/letta_response_usage_message.py +40 -0
  129. letta/types/letta_response_usage_message_usage.py +47 -0
  130. letta/types/letta_response_user_message.py +32 -0
  131. letta/types/letta_schemas_letta_message_tool_call.py +21 -0
  132. letta/types/letta_schemas_message_message.py +103 -0
  133. letta/types/letta_schemas_openai_chat_completion_request_tool.py +21 -0
  134. letta/types/letta_schemas_openai_chat_completion_request_tool_call.py +24 -0
  135. letta/types/letta_schemas_openai_chat_completion_request_tool_call_function.py +20 -0
  136. letta/types/letta_schemas_openai_chat_completion_response_message.py +24 -0
  137. letta/types/letta_schemas_openai_chat_completion_response_tool_call.py +22 -0
  138. letta/types/letta_schemas_openai_chat_completions_tool_call_function.py +27 -0
  139. letta/types/letta_schemas_openai_chat_completions_tool_call_input.py +29 -0
  140. letta/types/letta_schemas_openai_chat_completions_tool_call_output.py +29 -0
  141. letta/types/letta_schemas_tool_tool.py +88 -0
  142. letta/types/letta_usage_statistics.py +47 -0
  143. letta/types/llm_config.py +60 -0
  144. letta/types/llm_config_model_endpoint_type.py +26 -0
  145. letta/types/local_sandbox_config.py +32 -0
  146. letta/types/log_prob_token.py +21 -0
  147. letta/types/memory.py +32 -0
  148. letta/types/message_content_log_prob.py +23 -0
  149. letta/types/message_create.py +37 -0
  150. letta/types/message_create_role.py +5 -0
  151. letta/types/message_role.py +5 -0
  152. letta/types/not_found_error_body.py +20 -0
  153. letta/types/not_found_error_body_message.py +11 -0
  154. letta/types/open_ai_assistant.py +67 -0
  155. letta/types/organization.py +33 -0
  156. letta/types/organization_create.py +22 -0
  157. letta/types/passage.py +107 -0
  158. letta/types/reasoning_message.py +32 -0
  159. letta/types/recall_memory_summary.py +22 -0
  160. letta/types/response_format.py +19 -0
  161. letta/types/sandbox_config.py +59 -0
  162. letta/types/sandbox_config_create.py +23 -0
  163. letta/types/sandbox_config_create_config.py +7 -0
  164. letta/types/sandbox_config_update.py +27 -0
  165. letta/types/sandbox_config_update_config.py +7 -0
  166. letta/types/sandbox_environment_variable.py +68 -0
  167. letta/types/sandbox_environment_variable_create.py +32 -0
  168. letta/types/sandbox_environment_variable_update.py +36 -0
  169. letta/types/sandbox_type.py +5 -0
  170. letta/types/source.py +85 -0
  171. letta/types/system_message_input.py +21 -0
  172. letta/types/system_message_output.py +32 -0
  173. letta/types/terminal_tool_rule.py +29 -0
  174. letta/types/tool_call_delta.py +21 -0
  175. letta/types/tool_call_function_output.py +27 -0
  176. letta/types/tool_call_message.py +33 -0
  177. letta/types/tool_call_message_tool_call.py +7 -0
  178. letta/types/tool_create.py +57 -0
  179. letta/types/tool_function_choice.py +21 -0
  180. letta/types/tool_input.py +21 -0
  181. letta/types/tool_message.py +21 -0
  182. letta/types/tool_return_message.py +41 -0
  183. letta/types/tool_return_message_status.py +5 -0
  184. letta/types/tool_rule_type.py +10 -0
  185. letta/types/usage_message.py +31 -0
  186. letta/types/usage_statistics.py +21 -0
  187. letta/types/user.py +57 -0
  188. letta/types/user_create.py +27 -0
  189. letta/types/user_message_input.py +22 -0
  190. letta/types/user_message_input_content.py +5 -0
  191. letta/types/user_message_output.py +32 -0
  192. letta/types/user_update.py +32 -0
  193. letta/types/validation_error.py +22 -0
  194. letta/types/validation_error_loc_item.py +5 -0
  195. letta/version.py +3 -0
  196. letta_client-0.1.2.dist-info/METADATA +189 -0
  197. letta_client-0.1.2.dist-info/RECORD +199 -0
  198. {letta_client-0.1.0.dist-info → letta_client-0.1.2.dist-info}/WHEEL +1 -1
  199. letta_client-0.1.0.dist-info/METADATA +0 -15
  200. letta_client-0.1.0.dist-info/RECORD +0 -4
  201. /letta_client/__init__.py → /letta/py.typed +0 -0
letta/types/source.py ADDED
@@ -0,0 +1,85 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ import pydantic
6
+ from .embedding_config import EmbeddingConfig
7
+ import typing_extensions
8
+ from ..core.serialization import FieldMetadata
9
+ import datetime as dt
10
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
11
+
12
+
13
+ class Source(UniversalBaseModel):
14
+ """
15
+ Representation of a source, which is a collection of files and passages.
16
+
17
+ Parameters:
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
+ """
25
+
26
+ id: typing.Optional[str] = pydantic.Field(default=None)
27
+ """
28
+ The human-friendly ID of the Source
29
+ """
30
+
31
+ name: str = pydantic.Field()
32
+ """
33
+ The name of the source.
34
+ """
35
+
36
+ description: typing.Optional[str] = pydantic.Field(default=None)
37
+ """
38
+ The description of the source.
39
+ """
40
+
41
+ embedding_config: EmbeddingConfig = pydantic.Field()
42
+ """
43
+ The embedding configuration used by the source.
44
+ """
45
+
46
+ organization_id: typing.Optional[str] = pydantic.Field(default=None)
47
+ """
48
+ The ID of the organization that created the source.
49
+ """
50
+
51
+ metadata: typing_extensions.Annotated[
52
+ typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="metadata_")
53
+ ] = pydantic.Field(default=None)
54
+ """
55
+ Metadata associated with the source.
56
+ """
57
+
58
+ created_by_id: typing.Optional[str] = pydantic.Field(default=None)
59
+ """
60
+ The id of the user that made this Tool.
61
+ """
62
+
63
+ last_updated_by_id: typing.Optional[str] = pydantic.Field(default=None)
64
+ """
65
+ The id of the user that made this Tool.
66
+ """
67
+
68
+ created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
69
+ """
70
+ The timestamp when the source was created.
71
+ """
72
+
73
+ updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
74
+ """
75
+ The timestamp when the source was last updated.
76
+ """
77
+
78
+ if IS_PYDANTIC_V2:
79
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
80
+ else:
81
+
82
+ class Config:
83
+ frozen = True
84
+ smart_union = True
85
+ extra = pydantic.Extra.allow
@@ -0,0 +1,21 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+ import pydantic
7
+
8
+
9
+ class SystemMessageInput(UniversalBaseModel):
10
+ content: str
11
+ role: typing.Optional[str] = None
12
+ name: typing.Optional[str] = None
13
+
14
+ if IS_PYDANTIC_V2:
15
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
16
+ else:
17
+
18
+ class Config:
19
+ frozen = True
20
+ smart_union = True
21
+ extra = pydantic.Extra.allow
@@ -0,0 +1,32 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import datetime as dt
5
+ import typing
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
+ import pydantic
8
+
9
+
10
+ class SystemMessageOutput(UniversalBaseModel):
11
+ """
12
+ A message generated by the system. Never streamed back on a response, only used for cursor pagination.
13
+
14
+ Attributes:
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
+ """
19
+
20
+ id: str
21
+ date: dt.datetime
22
+ message_type: typing.Literal["system_message"] = "system_message"
23
+ message: str
24
+
25
+ if IS_PYDANTIC_V2:
26
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
27
+ else:
28
+
29
+ class Config:
30
+ frozen = True
31
+ smart_union = True
32
+ extra = pydantic.Extra.allow
@@ -0,0 +1,29 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import pydantic
5
+ import typing
6
+ from .tool_rule_type import ToolRuleType
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+
9
+
10
+ class TerminalToolRule(UniversalBaseModel):
11
+ """
12
+ Represents a terminal tool rule configuration where if this tool gets called, it must end the agent loop.
13
+ """
14
+
15
+ tool_name: str = pydantic.Field()
16
+ """
17
+ The name of the tool. Must exist in the database for the user's organization.
18
+ """
19
+
20
+ type: typing.Optional[ToolRuleType] = None
21
+
22
+ if IS_PYDANTIC_V2:
23
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
24
+ else:
25
+
26
+ class Config:
27
+ frozen = True
28
+ smart_union = True
29
+ extra = pydantic.Extra.allow
@@ -0,0 +1,21 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+ import pydantic
7
+
8
+
9
+ class ToolCallDelta(UniversalBaseModel):
10
+ name: typing.Optional[str] = None
11
+ arguments: typing.Optional[str] = None
12
+ tool_call_id: typing.Optional[str] = None
13
+
14
+ if IS_PYDANTIC_V2:
15
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
16
+ else:
17
+
18
+ class Config:
19
+ frozen = True
20
+ smart_union = True
21
+ extra = pydantic.Extra.allow
@@ -0,0 +1,27 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import pydantic
5
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+ import typing
7
+
8
+
9
+ class ToolCallFunctionOutput(UniversalBaseModel):
10
+ name: str = pydantic.Field()
11
+ """
12
+ The name of the function to call
13
+ """
14
+
15
+ arguments: str = pydantic.Field()
16
+ """
17
+ The arguments to pass to the function (JSON dump)
18
+ """
19
+
20
+ if IS_PYDANTIC_V2:
21
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
22
+ else:
23
+
24
+ class Config:
25
+ frozen = True
26
+ smart_union = True
27
+ extra = pydantic.Extra.allow
@@ -0,0 +1,33 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import datetime as dt
5
+ import typing
6
+ from .tool_call_message_tool_call import ToolCallMessageToolCall
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ import pydantic
9
+
10
+
11
+ class ToolCallMessage(UniversalBaseModel):
12
+ """
13
+ A message representing a request to call a tool (generated by the LLM to trigger tool execution).
14
+
15
+ Attributes:
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
+ """
20
+
21
+ id: str
22
+ date: dt.datetime
23
+ message_type: typing.Literal["tool_call_message"] = "tool_call_message"
24
+ tool_call: ToolCallMessageToolCall
25
+
26
+ if IS_PYDANTIC_V2:
27
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
28
+ else:
29
+
30
+ class Config:
31
+ frozen = True
32
+ smart_union = True
33
+ extra = pydantic.Extra.allow
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from .letta_schemas_letta_message_tool_call import LettaSchemasLettaMessageToolCall
5
+ from .tool_call_delta import ToolCallDelta
6
+
7
+ ToolCallMessageToolCall = typing.Union[LettaSchemasLettaMessageToolCall, ToolCallDelta]
@@ -0,0 +1,57 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
+
8
+
9
+ class ToolCreate(UniversalBaseModel):
10
+ name: typing.Optional[str] = pydantic.Field(default=None)
11
+ """
12
+ The name of the function (auto-generated from source_code if not provided).
13
+ """
14
+
15
+ description: typing.Optional[str] = pydantic.Field(default=None)
16
+ """
17
+ The description of the tool.
18
+ """
19
+
20
+ tags: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
21
+ """
22
+ Metadata tags.
23
+ """
24
+
25
+ module: typing.Optional[str] = pydantic.Field(default=None)
26
+ """
27
+ The source code of the function.
28
+ """
29
+
30
+ source_code: str = pydantic.Field()
31
+ """
32
+ The source code of the function.
33
+ """
34
+
35
+ source_type: typing.Optional[str] = pydantic.Field(default=None)
36
+ """
37
+ The source type of the function.
38
+ """
39
+
40
+ json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
41
+ """
42
+ The JSON schema of the function (auto-generated from source_code if not provided)
43
+ """
44
+
45
+ return_char_limit: typing.Optional[int] = pydantic.Field(default=None)
46
+ """
47
+ The maximum number of characters in the response.
48
+ """
49
+
50
+ if IS_PYDANTIC_V2:
51
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
52
+ else:
53
+
54
+ class Config:
55
+ frozen = True
56
+ smart_union = True
57
+ extra = pydantic.Extra.allow
@@ -0,0 +1,21 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from .function_call_input import FunctionCallInput
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
+ import pydantic
8
+
9
+
10
+ class ToolFunctionChoice(UniversalBaseModel):
11
+ type: typing.Optional[typing.Literal["function"]] = None
12
+ function: FunctionCallInput
13
+
14
+ if IS_PYDANTIC_V2:
15
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
16
+ else:
17
+
18
+ class Config:
19
+ frozen = True
20
+ smart_union = True
21
+ extra = pydantic.Extra.allow
@@ -0,0 +1,21 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from .function_schema import FunctionSchema
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
+ import pydantic
8
+
9
+
10
+ class ToolInput(UniversalBaseModel):
11
+ type: typing.Optional[typing.Literal["function"]] = None
12
+ function: FunctionSchema
13
+
14
+ if IS_PYDANTIC_V2:
15
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
16
+ else:
17
+
18
+ class Config:
19
+ frozen = True
20
+ smart_union = True
21
+ extra = pydantic.Extra.allow
@@ -0,0 +1,21 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+ import pydantic
7
+
8
+
9
+ class ToolMessage(UniversalBaseModel):
10
+ content: str
11
+ role: typing.Optional[str] = None
12
+ tool_call_id: str
13
+
14
+ if IS_PYDANTIC_V2:
15
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
16
+ else:
17
+
18
+ class Config:
19
+ frozen = True
20
+ smart_union = True
21
+ extra = pydantic.Extra.allow
@@ -0,0 +1,41 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import datetime as dt
5
+ import typing
6
+ from .tool_return_message_status import ToolReturnMessageStatus
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ import pydantic
9
+
10
+
11
+ class ToolReturnMessage(UniversalBaseModel):
12
+ """
13
+ A message representing the return value of a tool call (generated by Letta executing the requested tool).
14
+
15
+ Attributes:
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
+ """
24
+
25
+ id: str
26
+ date: dt.datetime
27
+ message_type: typing.Literal["tool_return_message"] = "tool_return_message"
28
+ tool_return: str
29
+ status: ToolReturnMessageStatus
30
+ tool_call_id: str
31
+ stdout: typing.Optional[typing.List[str]] = None
32
+ stderr: typing.Optional[typing.List[str]] = None
33
+
34
+ if IS_PYDANTIC_V2:
35
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
36
+ else:
37
+
38
+ class Config:
39
+ frozen = True
40
+ smart_union = True
41
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ToolReturnMessageStatus = typing.Union[typing.Literal["success", "error"], typing.Any]
@@ -0,0 +1,10 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ToolRuleType = typing.Union[
6
+ typing.Literal[
7
+ "InitToolRule", "TerminalToolRule", "continue_loop", "conditional", "ToolRule", "require_parent_tools"
8
+ ],
9
+ typing.Any,
10
+ ]
@@ -0,0 +1,31 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import datetime as dt
5
+ import typing
6
+ from .letta_usage_statistics import LettaUsageStatistics
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ import pydantic
9
+
10
+
11
+ class UsageMessage(UniversalBaseModel):
12
+ """
13
+ A message representint the usage statistics for the agent interaction.
14
+
15
+ Attributes:
16
+ usage (LettaUsageStatistics): Usage statistics for the agent interaction.
17
+ """
18
+
19
+ id: str
20
+ date: dt.datetime
21
+ message_type: typing.Optional[typing.Literal["usage_message"]] = None
22
+ usage: LettaUsageStatistics
23
+
24
+ if IS_PYDANTIC_V2:
25
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
26
+ else:
27
+
28
+ class Config:
29
+ frozen = True
30
+ smart_union = True
31
+ extra = pydantic.Extra.allow
@@ -0,0 +1,21 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+ import pydantic
7
+
8
+
9
+ class UsageStatistics(UniversalBaseModel):
10
+ completion_tokens: typing.Optional[int] = None
11
+ prompt_tokens: typing.Optional[int] = None
12
+ total_tokens: typing.Optional[int] = None
13
+
14
+ if IS_PYDANTIC_V2:
15
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
16
+ else:
17
+
18
+ class Config:
19
+ frozen = True
20
+ smart_union = True
21
+ extra = pydantic.Extra.allow
letta/types/user.py ADDED
@@ -0,0 +1,57 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ import pydantic
6
+ import datetime as dt
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+
9
+
10
+ class User(UniversalBaseModel):
11
+ """
12
+ Representation of a user.
13
+
14
+ Parameters:
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
+ """
19
+
20
+ id: typing.Optional[str] = pydantic.Field(default=None)
21
+ """
22
+ The human-friendly ID of the User
23
+ """
24
+
25
+ organization_id: typing.Optional[str] = pydantic.Field(default=None)
26
+ """
27
+ The organization id of the user
28
+ """
29
+
30
+ name: str = pydantic.Field()
31
+ """
32
+ The name of the user.
33
+ """
34
+
35
+ created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
36
+ """
37
+ The creation date of the user.
38
+ """
39
+
40
+ updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
41
+ """
42
+ The update date of the user.
43
+ """
44
+
45
+ is_deleted: typing.Optional[bool] = pydantic.Field(default=None)
46
+ """
47
+ Whether this user is deleted or not.
48
+ """
49
+
50
+ if IS_PYDANTIC_V2:
51
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
52
+ else:
53
+
54
+ class Config:
55
+ frozen = True
56
+ smart_union = True
57
+ extra = pydantic.Extra.allow
@@ -0,0 +1,27 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import pydantic
5
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
6
+ import typing
7
+
8
+
9
+ class UserCreate(UniversalBaseModel):
10
+ name: str = pydantic.Field()
11
+ """
12
+ The name of the user.
13
+ """
14
+
15
+ organization_id: str = pydantic.Field()
16
+ """
17
+ The organization id of the user.
18
+ """
19
+
20
+ if IS_PYDANTIC_V2:
21
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
22
+ else:
23
+
24
+ class Config:
25
+ frozen = True
26
+ smart_union = True
27
+ extra = pydantic.Extra.allow
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ from .user_message_input_content import UserMessageInputContent
5
+ import typing
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
+ import pydantic
8
+
9
+
10
+ class UserMessageInput(UniversalBaseModel):
11
+ content: UserMessageInputContent
12
+ role: typing.Optional[str] = None
13
+ name: typing.Optional[str] = None
14
+
15
+ if IS_PYDANTIC_V2:
16
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
+ else:
18
+
19
+ class Config:
20
+ frozen = True
21
+ smart_union = True
22
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ UserMessageInputContent = typing.Union[str, typing.List[str]]
@@ -0,0 +1,32 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import datetime as dt
5
+ import typing
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
+ import pydantic
8
+
9
+
10
+ class UserMessageOutput(UniversalBaseModel):
11
+ """
12
+ A message sent by the user. Never streamed back on a response, only used for cursor pagination.
13
+
14
+ Attributes:
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
+ """
19
+
20
+ id: str
21
+ date: dt.datetime
22
+ message_type: typing.Literal["user_message"] = "user_message"
23
+ message: str
24
+
25
+ if IS_PYDANTIC_V2:
26
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
27
+ else:
28
+
29
+ class Config:
30
+ frozen = True
31
+ smart_union = True
32
+ extra = pydantic.Extra.allow