letta-client 0.1.6__py3-none-any.whl → 0.1.10__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 (216) hide show
  1. {letta → letta_client}/__init__.py +33 -27
  2. {letta → letta_client}/agents/__init__.py +40 -29
  3. {letta → letta_client}/agents/archival_memory/client.py +25 -25
  4. letta_client/agents/client.py +1328 -0
  5. {letta → letta_client}/agents/context/client.py +7 -7
  6. letta_client/agents/core_memory/client.py +1080 -0
  7. letta_client/agents/memory_variables/__init__.py +5 -0
  8. {letta/agents/memory → letta_client/agents/memory_variables}/client.py +43 -42
  9. letta_client/agents/memory_variables/types/__init__.py +5 -0
  10. letta/agents/types/agents_get_agent_variables_response.py → letta_client/agents/memory_variables/types/memory_variables_get_response.py +3 -3
  11. {letta → letta_client}/agents/messages/client.py +240 -25
  12. {letta → letta_client}/agents/messages/types/letta_streaming_response.py +21 -16
  13. {letta → letta_client}/agents/messages/types/messages_list_response_item.py +19 -14
  14. {letta → letta_client}/agents/recall_memory/client.py +7 -7
  15. {letta → letta_client}/agents/sources/client.py +7 -7
  16. letta_client/agents/templates/__init__.py +5 -0
  17. letta_client/agents/templates/client.py +578 -0
  18. letta_client/agents/templates/types/__init__.py +5 -0
  19. letta/agents/types/agents_migrate_response.py → letta_client/agents/templates/types/templates_migrate_response.py +3 -3
  20. {letta → letta_client}/agents/tools/client.py +19 -19
  21. letta_client/agents/types/__init__.py +33 -0
  22. letta_client/agents/types/agents_search_request_combinator.py +5 -0
  23. letta/agents/types/agents_search_deployed_agents_request_search_item.py → letta_client/agents/types/agents_search_request_search_item.py +17 -20
  24. letta/agents/types/agents_search_deployed_agents_request_search_item_name.py → letta_client/agents/types/agents_search_request_search_item_name.py +4 -6
  25. letta_client/agents/types/agents_search_request_search_item_name_operator.py +5 -0
  26. letta_client/agents/types/agents_search_request_search_item_order_by.py +22 -0
  27. letta_client/agents/types/agents_search_request_search_item_order_by_direction.py +5 -0
  28. letta_client/agents/types/agents_search_request_search_item_order_by_value.py +5 -0
  29. letta/agents/types/agents_search_deployed_agents_request_search_item_version.py → letta_client/agents/types/agents_search_request_search_item_version.py +2 -2
  30. {letta → letta_client}/blocks/client.py +39 -39
  31. {letta → letta_client}/client.py +10 -2
  32. {letta → letta_client}/core/__init__.py +4 -0
  33. {letta → letta_client}/core/client_wrapper.py +1 -1
  34. letta_client/core/unchecked_base_model.py +305 -0
  35. {letta → letta_client}/health/client.py +5 -5
  36. {letta → letta_client}/jobs/client.py +25 -25
  37. {letta → letta_client}/models/client.py +9 -9
  38. letta_client/providers/client.py +597 -0
  39. letta_client/runs/client.py +876 -0
  40. {letta → letta_client}/sources/client.py +49 -49
  41. {letta → letta_client}/sources/files/client.py +17 -17
  42. {letta → letta_client}/sources/passages/client.py +7 -7
  43. letta_client/tools/__init__.py +2 -0
  44. {letta → letta_client}/tools/client.py +101 -81
  45. {letta → letta_client}/types/__init__.py +8 -0
  46. {letta → letta_client}/types/action_model.py +2 -2
  47. {letta → letta_client}/types/action_parameters_model.py +2 -2
  48. {letta → letta_client}/types/action_response_model.py +2 -2
  49. {letta → letta_client}/types/agent_environment_variable.py +2 -7
  50. {letta → letta_client}/types/agent_state.py +5 -8
  51. letta_client/types/agent_type.py +7 -0
  52. {letta → letta_client}/types/app_auth_scheme.py +2 -2
  53. {letta → letta_client}/types/app_model.py +2 -2
  54. {letta → letta_client}/types/archival_memory_summary.py +2 -2
  55. {letta → letta_client}/types/assistant_file.py +2 -2
  56. {letta → letta_client}/types/assistant_message_input.py +2 -2
  57. {letta → letta_client}/types/assistant_message_output.py +2 -2
  58. {letta → letta_client}/types/auth_request.py +2 -2
  59. {letta → letta_client}/types/auth_response.py +2 -2
  60. {letta → letta_client}/types/auth_scheme_field.py +2 -2
  61. {letta → letta_client}/types/block.py +2 -7
  62. {letta → letta_client}/types/block_update.py +2 -2
  63. {letta → letta_client}/types/chat_completion_request.py +2 -2
  64. {letta → letta_client}/types/chat_completion_response.py +2 -2
  65. {letta → letta_client}/types/child_tool_rule.py +2 -2
  66. {letta → letta_client}/types/choice.py +2 -2
  67. {letta → letta_client}/types/conditional_tool_rule.py +2 -2
  68. {letta → letta_client}/types/conflict_error_body.py +2 -2
  69. {letta → letta_client}/types/context_window_overview.py +2 -2
  70. {letta → letta_client}/types/create_assistant_file_request.py +2 -2
  71. {letta → letta_client}/types/create_assistant_request.py +2 -2
  72. {letta → letta_client}/types/create_block.py +2 -2
  73. {letta → letta_client}/types/delete_assistant_file_response.py +2 -2
  74. {letta → letta_client}/types/delete_assistant_response.py +2 -2
  75. {letta → letta_client}/types/e_2_b_sandbox_config.py +2 -2
  76. {letta → letta_client}/types/embedding_config.py +2 -2
  77. {letta → letta_client}/types/file_metadata.py +2 -7
  78. {letta → letta_client}/types/function_call_input.py +2 -2
  79. {letta → letta_client}/types/function_call_output.py +2 -2
  80. {letta → letta_client}/types/function_schema.py +2 -2
  81. {letta → letta_client}/types/health.py +2 -2
  82. {letta → letta_client}/types/http_validation_error.py +2 -2
  83. {letta → letta_client}/types/init_tool_rule.py +2 -2
  84. {letta → letta_client}/types/internal_server_error_body.py +2 -2
  85. {letta → letta_client}/types/job.py +7 -6
  86. letta_client/types/job_type.py +5 -0
  87. {letta → letta_client}/types/letta_request.py +7 -2
  88. {letta → letta_client}/types/letta_response.py +2 -2
  89. {letta → letta_client}/types/letta_response_messages_item.py +19 -14
  90. {letta → letta_client}/types/letta_schemas_letta_message_tool_call.py +2 -2
  91. {letta → letta_client}/types/letta_schemas_message_message.py +2 -7
  92. {letta → letta_client}/types/letta_schemas_openai_chat_completion_request_tool.py +2 -2
  93. {letta → letta_client}/types/letta_schemas_openai_chat_completion_request_tool_call.py +2 -2
  94. {letta → letta_client}/types/letta_schemas_openai_chat_completion_request_tool_call_function.py +2 -2
  95. {letta → letta_client}/types/letta_schemas_openai_chat_completion_response_message.py +2 -2
  96. {letta → letta_client}/types/letta_schemas_openai_chat_completion_response_tool_call.py +2 -2
  97. {letta → letta_client}/types/letta_schemas_openai_chat_completions_tool_call_function.py +2 -2
  98. {letta → letta_client}/types/letta_schemas_openai_chat_completions_tool_call_input.py +2 -2
  99. {letta → letta_client}/types/letta_schemas_openai_chat_completions_tool_call_output.py +2 -2
  100. {letta → letta_client}/types/letta_schemas_tool_tool.py +9 -8
  101. {letta → letta_client}/types/letta_usage_statistics.py +2 -2
  102. {letta → letta_client}/types/llm_config.py +2 -2
  103. {letta → letta_client}/types/local_sandbox_config.py +2 -2
  104. {letta → letta_client}/types/log_prob_token.py +2 -2
  105. {letta → letta_client}/types/memory.py +2 -2
  106. {letta → letta_client}/types/message_content_log_prob.py +2 -2
  107. {letta → letta_client}/types/message_create.py +2 -2
  108. {letta → letta_client}/types/not_found_error_body.py +2 -2
  109. {letta → letta_client}/types/open_ai_assistant.py +2 -2
  110. {letta → letta_client}/types/organization.py +2 -2
  111. {letta → letta_client}/types/organization_create.py +2 -2
  112. {letta → letta_client}/types/passage.py +2 -7
  113. letta_client/types/provider.py +38 -0
  114. {letta → letta_client}/types/reasoning_message.py +2 -2
  115. {letta → letta_client}/types/recall_memory_summary.py +2 -2
  116. {letta → letta_client}/types/response_format.py +2 -2
  117. letta_client/types/run.py +77 -0
  118. {letta → letta_client}/types/sandbox_config.py +2 -7
  119. {letta → letta_client}/types/sandbox_config_create.py +2 -2
  120. {letta → letta_client}/types/sandbox_config_update.py +2 -2
  121. {letta → letta_client}/types/sandbox_environment_variable.py +2 -7
  122. {letta → letta_client}/types/sandbox_environment_variable_create.py +2 -2
  123. {letta → letta_client}/types/sandbox_environment_variable_update.py +2 -2
  124. {letta → letta_client}/types/source.py +2 -7
  125. {letta → letta_client}/types/system_message_input.py +2 -2
  126. {letta → letta_client}/types/system_message_output.py +2 -2
  127. {letta → letta_client}/types/terminal_tool_rule.py +2 -2
  128. {letta → letta_client}/types/tool_call_delta.py +2 -2
  129. {letta → letta_client}/types/tool_call_function_output.py +2 -2
  130. {letta → letta_client}/types/tool_call_message.py +2 -2
  131. {letta → letta_client}/types/tool_create.py +2 -2
  132. {letta → letta_client}/types/tool_function_choice.py +2 -2
  133. {letta → letta_client}/types/tool_input.py +2 -2
  134. {letta → letta_client}/types/tool_message.py +2 -2
  135. {letta → letta_client}/types/tool_return_message.py +2 -2
  136. letta_client/types/tool_type.py +5 -0
  137. {letta → letta_client}/types/usage_statistics.py +2 -2
  138. {letta → letta_client}/types/user.py +2 -7
  139. {letta → letta_client}/types/user_create.py +2 -7
  140. {letta → letta_client}/types/user_message_input.py +2 -2
  141. {letta → letta_client}/types/user_message_output.py +2 -2
  142. {letta → letta_client}/types/user_update.py +2 -7
  143. {letta → letta_client}/types/validation_error.py +2 -2
  144. {letta_client-0.1.6.dist-info → letta_client-0.1.10.dist-info}/METADATA +7 -7
  145. letta_client-0.1.10.dist-info/RECORD +204 -0
  146. letta/agents/client.py +0 -2644
  147. letta/agents/memory/__init__.py +0 -5
  148. letta/agents/memory/messages/client.py +0 -147
  149. letta/agents/memory_blocks/client.py +0 -364
  150. letta/agents/types/__init__.py +0 -47
  151. letta/agents/types/agents_search_deployed_agents_request_combinator.py +0 -5
  152. letta/agents/types/agents_search_deployed_agents_request_search_item_name_operator.py +0 -7
  153. letta/agents/types/agents_search_deployed_agents_request_search_item_order_by.py +0 -26
  154. letta/agents/types/agents_search_deployed_agents_request_search_item_order_by_direction.py +0 -5
  155. letta/agents/types/agents_search_deployed_agents_request_search_item_order_by_value.py +0 -7
  156. letta/types/agent_type.py +0 -8
  157. letta_client-0.1.6.dist-info/RECORD +0 -193
  158. {letta → letta_client}/agents/archival_memory/__init__.py +0 -0
  159. {letta → letta_client}/agents/context/__init__.py +0 -0
  160. {letta/agents/memory/messages → letta_client/agents/core_memory}/__init__.py +0 -0
  161. {letta → letta_client}/agents/messages/__init__.py +0 -0
  162. {letta → letta_client}/agents/messages/types/__init__.py +0 -0
  163. {letta → letta_client}/agents/messages/types/messages_list_response.py +0 -0
  164. {letta/agents/memory_blocks → letta_client/agents/recall_memory}/__init__.py +0 -0
  165. {letta/agents/recall_memory → letta_client/agents/sources}/__init__.py +0 -0
  166. {letta/agents/sources → letta_client/agents/tools}/__init__.py +0 -0
  167. {letta → letta_client}/agents/types/create_agent_request_tool_rules_item.py +0 -0
  168. {letta → letta_client}/agents/types/update_agent_tool_rules_item.py +0 -0
  169. {letta/agents/tools → letta_client/blocks}/__init__.py +0 -0
  170. {letta → letta_client}/core/api_error.py +0 -0
  171. {letta → letta_client}/core/datetime_utils.py +0 -0
  172. {letta → letta_client}/core/file.py +0 -0
  173. {letta → letta_client}/core/http_client.py +0 -0
  174. {letta → letta_client}/core/jsonable_encoder.py +0 -0
  175. {letta → letta_client}/core/pydantic_utilities.py +0 -0
  176. {letta → letta_client}/core/query_encoder.py +0 -0
  177. {letta → letta_client}/core/remove_none_from_dict.py +0 -0
  178. {letta → letta_client}/core/request_options.py +0 -0
  179. {letta → letta_client}/core/serialization.py +0 -0
  180. {letta → letta_client}/environment.py +0 -0
  181. {letta → letta_client}/errors/__init__.py +0 -0
  182. {letta → letta_client}/errors/conflict_error.py +0 -0
  183. {letta → letta_client}/errors/internal_server_error.py +0 -0
  184. {letta → letta_client}/errors/not_found_error.py +0 -0
  185. {letta → letta_client}/errors/unprocessable_entity_error.py +0 -0
  186. {letta/blocks → letta_client/health}/__init__.py +0 -0
  187. {letta/health → letta_client/jobs}/__init__.py +0 -0
  188. {letta/jobs → letta_client/models}/__init__.py +0 -0
  189. {letta/models → letta_client/providers}/__init__.py +0 -0
  190. {letta → letta_client}/py.typed +0 -0
  191. {letta/sources/files → letta_client/runs}/__init__.py +0 -0
  192. {letta → letta_client}/sources/__init__.py +0 -0
  193. {letta/sources/passages → letta_client/sources/files}/__init__.py +0 -0
  194. {letta/tools → letta_client/sources/passages}/__init__.py +0 -0
  195. {letta → letta_client}/types/agent_state_tool_rules_item.py +0 -0
  196. {letta → letta_client}/types/app_auth_scheme_auth_mode.py +0 -0
  197. {letta → letta_client}/types/chat_completion_request_function_call.py +0 -0
  198. {letta → letta_client}/types/chat_completion_request_messages_item.py +0 -0
  199. {letta → letta_client}/types/chat_completion_request_stop.py +0 -0
  200. {letta → letta_client}/types/chat_completion_request_tool_choice.py +0 -0
  201. {letta → letta_client}/types/embedding_config_embedding_endpoint_type.py +0 -0
  202. {letta → letta_client}/types/job_status.py +0 -0
  203. {letta → letta_client}/types/llm_config_model_endpoint_type.py +0 -0
  204. {letta → letta_client}/types/message_create_role.py +0 -0
  205. {letta → letta_client}/types/message_role.py +0 -0
  206. {letta → letta_client}/types/not_found_error_body_message.py +0 -0
  207. {letta → letta_client}/types/sandbox_config_create_config.py +0 -0
  208. {letta → letta_client}/types/sandbox_config_update_config.py +0 -0
  209. {letta → letta_client}/types/sandbox_type.py +0 -0
  210. {letta → letta_client}/types/tool_call_message_tool_call.py +0 -0
  211. {letta → letta_client}/types/tool_return_message_status.py +0 -0
  212. {letta → letta_client}/types/tool_rule_type.py +0 -0
  213. {letta → letta_client}/types/user_message_input_content.py +0 -0
  214. {letta → letta_client}/types/validation_error_loc_item.py +0 -0
  215. {letta → letta_client}/version.py +0 -0
  216. {letta_client-0.1.6.dist-info → letta_client-0.1.10.dist-info}/WHEEL +0 -0
@@ -5,7 +5,7 @@ from ..core.client_wrapper import SyncClientWrapper
5
5
  from ..core.request_options import RequestOptions
6
6
  from ..types.letta_schemas_tool_tool import LettaSchemasToolTool
7
7
  from ..core.jsonable_encoder import jsonable_encoder
8
- from ..core.pydantic_utilities import parse_obj_as
8
+ from ..core.unchecked_base_model import construct_type
9
9
  from ..errors.unprocessable_entity_error import UnprocessableEntityError
10
10
  from ..types.http_validation_error import HttpValidationError
11
11
  from json.decoder import JSONDecodeError
@@ -41,7 +41,7 @@ class ToolsClient:
41
41
 
42
42
  Examples
43
43
  --------
44
- from letta import Letta
44
+ from letta_client import Letta
45
45
 
46
46
  client = Letta(
47
47
  token="YOUR_TOKEN",
@@ -59,7 +59,7 @@ class ToolsClient:
59
59
  if 200 <= _response.status_code < 300:
60
60
  return typing.cast(
61
61
  LettaSchemasToolTool,
62
- parse_obj_as(
62
+ construct_type(
63
63
  type_=LettaSchemasToolTool, # type: ignore
64
64
  object_=_response.json(),
65
65
  ),
@@ -68,7 +68,7 @@ class ToolsClient:
68
68
  raise UnprocessableEntityError(
69
69
  typing.cast(
70
70
  HttpValidationError,
71
- parse_obj_as(
71
+ construct_type(
72
72
  type_=HttpValidationError, # type: ignore
73
73
  object_=_response.json(),
74
74
  ),
@@ -99,7 +99,7 @@ class ToolsClient:
99
99
 
100
100
  Examples
101
101
  --------
102
- from letta import Letta
102
+ from letta_client import Letta
103
103
 
104
104
  client = Letta(
105
105
  token="YOUR_TOKEN",
@@ -117,7 +117,7 @@ class ToolsClient:
117
117
  if 200 <= _response.status_code < 300:
118
118
  return typing.cast(
119
119
  typing.Optional[typing.Any],
120
- parse_obj_as(
120
+ construct_type(
121
121
  type_=typing.Optional[typing.Any], # type: ignore
122
122
  object_=_response.json(),
123
123
  ),
@@ -126,7 +126,7 @@ class ToolsClient:
126
126
  raise UnprocessableEntityError(
127
127
  typing.cast(
128
128
  HttpValidationError,
129
- parse_obj_as(
129
+ construct_type(
130
130
  type_=HttpValidationError, # type: ignore
131
131
  object_=_response.json(),
132
132
  ),
@@ -148,6 +148,7 @@ class ToolsClient:
148
148
  source_code: typing.Optional[str] = OMIT,
149
149
  source_type: typing.Optional[str] = OMIT,
150
150
  json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
151
+ return_char_limit: typing.Optional[int] = OMIT,
151
152
  request_options: typing.Optional[RequestOptions] = None,
152
153
  ) -> LettaSchemasToolTool:
153
154
  """
@@ -178,6 +179,9 @@ class ToolsClient:
178
179
  json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
179
180
  The JSON schema of the function (auto-generated from source_code if not provided)
180
181
 
182
+ return_char_limit : typing.Optional[int]
183
+ The maximum number of characters in the response.
184
+
181
185
  request_options : typing.Optional[RequestOptions]
182
186
  Request-specific configuration.
183
187
 
@@ -188,7 +192,7 @@ class ToolsClient:
188
192
 
189
193
  Examples
190
194
  --------
191
- from letta import Letta
195
+ from letta_client import Letta
192
196
 
193
197
  client = Letta(
194
198
  token="YOUR_TOKEN",
@@ -208,6 +212,7 @@ class ToolsClient:
208
212
  "source_code": source_code,
209
213
  "source_type": source_type,
210
214
  "json_schema": json_schema,
215
+ "return_char_limit": return_char_limit,
211
216
  },
212
217
  headers={
213
218
  "content-type": "application/json",
@@ -219,7 +224,7 @@ class ToolsClient:
219
224
  if 200 <= _response.status_code < 300:
220
225
  return typing.cast(
221
226
  LettaSchemasToolTool,
222
- parse_obj_as(
227
+ construct_type(
223
228
  type_=LettaSchemasToolTool, # type: ignore
224
229
  object_=_response.json(),
225
230
  ),
@@ -228,7 +233,7 @@ class ToolsClient:
228
233
  raise UnprocessableEntityError(
229
234
  typing.cast(
230
235
  HttpValidationError,
231
- parse_obj_as(
236
+ construct_type(
232
237
  type_=HttpValidationError, # type: ignore
233
238
  object_=_response.json(),
234
239
  ),
@@ -257,7 +262,7 @@ class ToolsClient:
257
262
 
258
263
  Examples
259
264
  --------
260
- from letta import Letta
265
+ from letta_client import Letta
261
266
 
262
267
  client = Letta(
263
268
  token="YOUR_TOKEN",
@@ -275,7 +280,7 @@ class ToolsClient:
275
280
  if 200 <= _response.status_code < 300:
276
281
  return typing.cast(
277
282
  str,
278
- parse_obj_as(
283
+ construct_type(
279
284
  type_=str, # type: ignore
280
285
  object_=_response.json(),
281
286
  ),
@@ -284,7 +289,7 @@ class ToolsClient:
284
289
  raise UnprocessableEntityError(
285
290
  typing.cast(
286
291
  HttpValidationError,
287
- parse_obj_as(
292
+ construct_type(
288
293
  type_=HttpValidationError, # type: ignore
289
294
  object_=_response.json(),
290
295
  ),
@@ -321,7 +326,7 @@ class ToolsClient:
321
326
 
322
327
  Examples
323
328
  --------
324
- from letta import Letta
329
+ from letta_client import Letta
325
330
 
326
331
  client = Letta(
327
332
  token="YOUR_TOKEN",
@@ -341,7 +346,7 @@ class ToolsClient:
341
346
  if 200 <= _response.status_code < 300:
342
347
  return typing.cast(
343
348
  typing.List[LettaSchemasToolTool],
344
- parse_obj_as(
349
+ construct_type(
345
350
  type_=typing.List[LettaSchemasToolTool], # type: ignore
346
351
  object_=_response.json(),
347
352
  ),
@@ -350,7 +355,7 @@ class ToolsClient:
350
355
  raise UnprocessableEntityError(
351
356
  typing.cast(
352
357
  HttpValidationError,
353
- parse_obj_as(
358
+ construct_type(
354
359
  type_=HttpValidationError, # type: ignore
355
360
  object_=_response.json(),
356
361
  ),
@@ -413,7 +418,7 @@ class ToolsClient:
413
418
 
414
419
  Examples
415
420
  --------
416
- from letta import Letta
421
+ from letta_client import Letta
417
422
 
418
423
  client = Letta(
419
424
  token="YOUR_TOKEN",
@@ -442,7 +447,7 @@ class ToolsClient:
442
447
  if 200 <= _response.status_code < 300:
443
448
  return typing.cast(
444
449
  LettaSchemasToolTool,
445
- parse_obj_as(
450
+ construct_type(
446
451
  type_=LettaSchemasToolTool, # type: ignore
447
452
  object_=_response.json(),
448
453
  ),
@@ -451,7 +456,7 @@ class ToolsClient:
451
456
  raise UnprocessableEntityError(
452
457
  typing.cast(
453
458
  HttpValidationError,
454
- parse_obj_as(
459
+ construct_type(
455
460
  type_=HttpValidationError, # type: ignore
456
461
  object_=_response.json(),
457
462
  ),
@@ -514,7 +519,7 @@ class ToolsClient:
514
519
 
515
520
  Examples
516
521
  --------
517
- from letta import Letta
522
+ from letta_client import Letta
518
523
 
519
524
  client = Letta(
520
525
  token="YOUR_TOKEN",
@@ -543,7 +548,7 @@ class ToolsClient:
543
548
  if 200 <= _response.status_code < 300:
544
549
  return typing.cast(
545
550
  LettaSchemasToolTool,
546
- parse_obj_as(
551
+ construct_type(
547
552
  type_=LettaSchemasToolTool, # type: ignore
548
553
  object_=_response.json(),
549
554
  ),
@@ -552,7 +557,7 @@ class ToolsClient:
552
557
  raise UnprocessableEntityError(
553
558
  typing.cast(
554
559
  HttpValidationError,
555
- parse_obj_as(
560
+ construct_type(
556
561
  type_=HttpValidationError, # type: ignore
557
562
  object_=_response.json(),
558
563
  ),
@@ -581,7 +586,7 @@ class ToolsClient:
581
586
 
582
587
  Examples
583
588
  --------
584
- from letta import Letta
589
+ from letta_client import Letta
585
590
 
586
591
  client = Letta(
587
592
  token="YOUR_TOKEN",
@@ -597,7 +602,7 @@ class ToolsClient:
597
602
  if 200 <= _response.status_code < 300:
598
603
  return typing.cast(
599
604
  typing.List[LettaSchemasToolTool],
600
- parse_obj_as(
605
+ construct_type(
601
606
  type_=typing.List[LettaSchemasToolTool], # type: ignore
602
607
  object_=_response.json(),
603
608
  ),
@@ -606,7 +611,7 @@ class ToolsClient:
606
611
  raise UnprocessableEntityError(
607
612
  typing.cast(
608
613
  HttpValidationError,
609
- parse_obj_as(
614
+ construct_type(
610
615
  type_=HttpValidationError, # type: ignore
611
616
  object_=_response.json(),
612
617
  ),
@@ -621,7 +626,8 @@ class ToolsClient:
621
626
  self,
622
627
  *,
623
628
  source_code: str,
624
- args: str,
629
+ args: typing.Dict[str, typing.Optional[typing.Any]],
630
+ env_vars: typing.Optional[typing.Dict[str, str]] = OMIT,
625
631
  name: typing.Optional[str] = OMIT,
626
632
  source_type: typing.Optional[str] = OMIT,
627
633
  request_options: typing.Optional[RequestOptions] = None,
@@ -634,8 +640,11 @@ class ToolsClient:
634
640
  source_code : str
635
641
  The source code of the function.
636
642
 
637
- args : str
638
- The arguments to pass to the tool (as stringified JSON).
643
+ args : typing.Dict[str, typing.Optional[typing.Any]]
644
+ The arguments to pass to the tool.
645
+
646
+ env_vars : typing.Optional[typing.Dict[str, str]]
647
+ The environment variables to pass to the tool.
639
648
 
640
649
  name : typing.Optional[str]
641
650
  The name of the tool to run.
@@ -653,14 +662,14 @@ class ToolsClient:
653
662
 
654
663
  Examples
655
664
  --------
656
- from letta import Letta
665
+ from letta_client import Letta
657
666
 
658
667
  client = Letta(
659
668
  token="YOUR_TOKEN",
660
669
  )
661
670
  client.tools.run_tool_from_source(
662
671
  source_code="source_code",
663
- args="args",
672
+ args={"key": "value"},
664
673
  )
665
674
  """
666
675
  _response = self._client_wrapper.httpx_client.request(
@@ -669,6 +678,7 @@ class ToolsClient:
669
678
  json={
670
679
  "source_code": source_code,
671
680
  "args": args,
681
+ "env_vars": env_vars,
672
682
  "name": name,
673
683
  "source_type": source_type,
674
684
  },
@@ -682,7 +692,7 @@ class ToolsClient:
682
692
  if 200 <= _response.status_code < 300:
683
693
  return typing.cast(
684
694
  ToolReturnMessage,
685
- parse_obj_as(
695
+ construct_type(
686
696
  type_=ToolReturnMessage, # type: ignore
687
697
  object_=_response.json(),
688
698
  ),
@@ -691,7 +701,7 @@ class ToolsClient:
691
701
  raise UnprocessableEntityError(
692
702
  typing.cast(
693
703
  HttpValidationError,
694
- parse_obj_as(
704
+ construct_type(
695
705
  type_=HttpValidationError, # type: ignore
696
706
  object_=_response.json(),
697
707
  ),
@@ -718,7 +728,7 @@ class ToolsClient:
718
728
 
719
729
  Examples
720
730
  --------
721
- from letta import Letta
731
+ from letta_client import Letta
722
732
 
723
733
  client = Letta(
724
734
  token="YOUR_TOKEN",
@@ -734,7 +744,7 @@ class ToolsClient:
734
744
  if 200 <= _response.status_code < 300:
735
745
  return typing.cast(
736
746
  typing.List[AppModel],
737
- parse_obj_as(
747
+ construct_type(
738
748
  type_=typing.List[AppModel], # type: ignore
739
749
  object_=_response.json(),
740
750
  ),
@@ -743,7 +753,7 @@ class ToolsClient:
743
753
  raise UnprocessableEntityError(
744
754
  typing.cast(
745
755
  HttpValidationError,
746
- parse_obj_as(
756
+ construct_type(
747
757
  type_=HttpValidationError, # type: ignore
748
758
  object_=_response.json(),
749
759
  ),
@@ -774,7 +784,7 @@ class ToolsClient:
774
784
 
775
785
  Examples
776
786
  --------
777
- from letta import Letta
787
+ from letta_client import Letta
778
788
 
779
789
  client = Letta(
780
790
  token="YOUR_TOKEN",
@@ -792,7 +802,7 @@ class ToolsClient:
792
802
  if 200 <= _response.status_code < 300:
793
803
  return typing.cast(
794
804
  typing.List[ActionModel],
795
- parse_obj_as(
805
+ construct_type(
796
806
  type_=typing.List[ActionModel], # type: ignore
797
807
  object_=_response.json(),
798
808
  ),
@@ -801,7 +811,7 @@ class ToolsClient:
801
811
  raise UnprocessableEntityError(
802
812
  typing.cast(
803
813
  HttpValidationError,
804
- parse_obj_as(
814
+ construct_type(
805
815
  type_=HttpValidationError, # type: ignore
806
816
  object_=_response.json(),
807
817
  ),
@@ -832,7 +842,7 @@ class ToolsClient:
832
842
 
833
843
  Examples
834
844
  --------
835
- from letta import Letta
845
+ from letta_client import Letta
836
846
 
837
847
  client = Letta(
838
848
  token="YOUR_TOKEN",
@@ -850,7 +860,7 @@ class ToolsClient:
850
860
  if 200 <= _response.status_code < 300:
851
861
  return typing.cast(
852
862
  LettaSchemasToolTool,
853
- parse_obj_as(
863
+ construct_type(
854
864
  type_=LettaSchemasToolTool, # type: ignore
855
865
  object_=_response.json(),
856
866
  ),
@@ -859,7 +869,7 @@ class ToolsClient:
859
869
  raise UnprocessableEntityError(
860
870
  typing.cast(
861
871
  HttpValidationError,
862
- parse_obj_as(
872
+ construct_type(
863
873
  type_=HttpValidationError, # type: ignore
864
874
  object_=_response.json(),
865
875
  ),
@@ -897,7 +907,7 @@ class AsyncToolsClient:
897
907
  --------
898
908
  import asyncio
899
909
 
900
- from letta import AsyncLetta
910
+ from letta_client import AsyncLetta
901
911
 
902
912
  client = AsyncLetta(
903
913
  token="YOUR_TOKEN",
@@ -921,7 +931,7 @@ class AsyncToolsClient:
921
931
  if 200 <= _response.status_code < 300:
922
932
  return typing.cast(
923
933
  LettaSchemasToolTool,
924
- parse_obj_as(
934
+ construct_type(
925
935
  type_=LettaSchemasToolTool, # type: ignore
926
936
  object_=_response.json(),
927
937
  ),
@@ -930,7 +940,7 @@ class AsyncToolsClient:
930
940
  raise UnprocessableEntityError(
931
941
  typing.cast(
932
942
  HttpValidationError,
933
- parse_obj_as(
943
+ construct_type(
934
944
  type_=HttpValidationError, # type: ignore
935
945
  object_=_response.json(),
936
946
  ),
@@ -963,7 +973,7 @@ class AsyncToolsClient:
963
973
  --------
964
974
  import asyncio
965
975
 
966
- from letta import AsyncLetta
976
+ from letta_client import AsyncLetta
967
977
 
968
978
  client = AsyncLetta(
969
979
  token="YOUR_TOKEN",
@@ -987,7 +997,7 @@ class AsyncToolsClient:
987
997
  if 200 <= _response.status_code < 300:
988
998
  return typing.cast(
989
999
  typing.Optional[typing.Any],
990
- parse_obj_as(
1000
+ construct_type(
991
1001
  type_=typing.Optional[typing.Any], # type: ignore
992
1002
  object_=_response.json(),
993
1003
  ),
@@ -996,7 +1006,7 @@ class AsyncToolsClient:
996
1006
  raise UnprocessableEntityError(
997
1007
  typing.cast(
998
1008
  HttpValidationError,
999
- parse_obj_as(
1009
+ construct_type(
1000
1010
  type_=HttpValidationError, # type: ignore
1001
1011
  object_=_response.json(),
1002
1012
  ),
@@ -1018,6 +1028,7 @@ class AsyncToolsClient:
1018
1028
  source_code: typing.Optional[str] = OMIT,
1019
1029
  source_type: typing.Optional[str] = OMIT,
1020
1030
  json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1031
+ return_char_limit: typing.Optional[int] = OMIT,
1021
1032
  request_options: typing.Optional[RequestOptions] = None,
1022
1033
  ) -> LettaSchemasToolTool:
1023
1034
  """
@@ -1048,6 +1059,9 @@ class AsyncToolsClient:
1048
1059
  json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
1049
1060
  The JSON schema of the function (auto-generated from source_code if not provided)
1050
1061
 
1062
+ return_char_limit : typing.Optional[int]
1063
+ The maximum number of characters in the response.
1064
+
1051
1065
  request_options : typing.Optional[RequestOptions]
1052
1066
  Request-specific configuration.
1053
1067
 
@@ -1060,7 +1074,7 @@ class AsyncToolsClient:
1060
1074
  --------
1061
1075
  import asyncio
1062
1076
 
1063
- from letta import AsyncLetta
1077
+ from letta_client import AsyncLetta
1064
1078
 
1065
1079
  client = AsyncLetta(
1066
1080
  token="YOUR_TOKEN",
@@ -1086,6 +1100,7 @@ class AsyncToolsClient:
1086
1100
  "source_code": source_code,
1087
1101
  "source_type": source_type,
1088
1102
  "json_schema": json_schema,
1103
+ "return_char_limit": return_char_limit,
1089
1104
  },
1090
1105
  headers={
1091
1106
  "content-type": "application/json",
@@ -1097,7 +1112,7 @@ class AsyncToolsClient:
1097
1112
  if 200 <= _response.status_code < 300:
1098
1113
  return typing.cast(
1099
1114
  LettaSchemasToolTool,
1100
- parse_obj_as(
1115
+ construct_type(
1101
1116
  type_=LettaSchemasToolTool, # type: ignore
1102
1117
  object_=_response.json(),
1103
1118
  ),
@@ -1106,7 +1121,7 @@ class AsyncToolsClient:
1106
1121
  raise UnprocessableEntityError(
1107
1122
  typing.cast(
1108
1123
  HttpValidationError,
1109
- parse_obj_as(
1124
+ construct_type(
1110
1125
  type_=HttpValidationError, # type: ignore
1111
1126
  object_=_response.json(),
1112
1127
  ),
@@ -1137,7 +1152,7 @@ class AsyncToolsClient:
1137
1152
  --------
1138
1153
  import asyncio
1139
1154
 
1140
- from letta import AsyncLetta
1155
+ from letta_client import AsyncLetta
1141
1156
 
1142
1157
  client = AsyncLetta(
1143
1158
  token="YOUR_TOKEN",
@@ -1161,7 +1176,7 @@ class AsyncToolsClient:
1161
1176
  if 200 <= _response.status_code < 300:
1162
1177
  return typing.cast(
1163
1178
  str,
1164
- parse_obj_as(
1179
+ construct_type(
1165
1180
  type_=str, # type: ignore
1166
1181
  object_=_response.json(),
1167
1182
  ),
@@ -1170,7 +1185,7 @@ class AsyncToolsClient:
1170
1185
  raise UnprocessableEntityError(
1171
1186
  typing.cast(
1172
1187
  HttpValidationError,
1173
- parse_obj_as(
1188
+ construct_type(
1174
1189
  type_=HttpValidationError, # type: ignore
1175
1190
  object_=_response.json(),
1176
1191
  ),
@@ -1209,7 +1224,7 @@ class AsyncToolsClient:
1209
1224
  --------
1210
1225
  import asyncio
1211
1226
 
1212
- from letta import AsyncLetta
1227
+ from letta_client import AsyncLetta
1213
1228
 
1214
1229
  client = AsyncLetta(
1215
1230
  token="YOUR_TOKEN",
@@ -1235,7 +1250,7 @@ class AsyncToolsClient:
1235
1250
  if 200 <= _response.status_code < 300:
1236
1251
  return typing.cast(
1237
1252
  typing.List[LettaSchemasToolTool],
1238
- parse_obj_as(
1253
+ construct_type(
1239
1254
  type_=typing.List[LettaSchemasToolTool], # type: ignore
1240
1255
  object_=_response.json(),
1241
1256
  ),
@@ -1244,7 +1259,7 @@ class AsyncToolsClient:
1244
1259
  raise UnprocessableEntityError(
1245
1260
  typing.cast(
1246
1261
  HttpValidationError,
1247
- parse_obj_as(
1262
+ construct_type(
1248
1263
  type_=HttpValidationError, # type: ignore
1249
1264
  object_=_response.json(),
1250
1265
  ),
@@ -1309,7 +1324,7 @@ class AsyncToolsClient:
1309
1324
  --------
1310
1325
  import asyncio
1311
1326
 
1312
- from letta import AsyncLetta
1327
+ from letta_client import AsyncLetta
1313
1328
 
1314
1329
  client = AsyncLetta(
1315
1330
  token="YOUR_TOKEN",
@@ -1344,7 +1359,7 @@ class AsyncToolsClient:
1344
1359
  if 200 <= _response.status_code < 300:
1345
1360
  return typing.cast(
1346
1361
  LettaSchemasToolTool,
1347
- parse_obj_as(
1362
+ construct_type(
1348
1363
  type_=LettaSchemasToolTool, # type: ignore
1349
1364
  object_=_response.json(),
1350
1365
  ),
@@ -1353,7 +1368,7 @@ class AsyncToolsClient:
1353
1368
  raise UnprocessableEntityError(
1354
1369
  typing.cast(
1355
1370
  HttpValidationError,
1356
- parse_obj_as(
1371
+ construct_type(
1357
1372
  type_=HttpValidationError, # type: ignore
1358
1373
  object_=_response.json(),
1359
1374
  ),
@@ -1418,7 +1433,7 @@ class AsyncToolsClient:
1418
1433
  --------
1419
1434
  import asyncio
1420
1435
 
1421
- from letta import AsyncLetta
1436
+ from letta_client import AsyncLetta
1422
1437
 
1423
1438
  client = AsyncLetta(
1424
1439
  token="YOUR_TOKEN",
@@ -1453,7 +1468,7 @@ class AsyncToolsClient:
1453
1468
  if 200 <= _response.status_code < 300:
1454
1469
  return typing.cast(
1455
1470
  LettaSchemasToolTool,
1456
- parse_obj_as(
1471
+ construct_type(
1457
1472
  type_=LettaSchemasToolTool, # type: ignore
1458
1473
  object_=_response.json(),
1459
1474
  ),
@@ -1462,7 +1477,7 @@ class AsyncToolsClient:
1462
1477
  raise UnprocessableEntityError(
1463
1478
  typing.cast(
1464
1479
  HttpValidationError,
1465
- parse_obj_as(
1480
+ construct_type(
1466
1481
  type_=HttpValidationError, # type: ignore
1467
1482
  object_=_response.json(),
1468
1483
  ),
@@ -1493,7 +1508,7 @@ class AsyncToolsClient:
1493
1508
  --------
1494
1509
  import asyncio
1495
1510
 
1496
- from letta import AsyncLetta
1511
+ from letta_client import AsyncLetta
1497
1512
 
1498
1513
  client = AsyncLetta(
1499
1514
  token="YOUR_TOKEN",
@@ -1515,7 +1530,7 @@ class AsyncToolsClient:
1515
1530
  if 200 <= _response.status_code < 300:
1516
1531
  return typing.cast(
1517
1532
  typing.List[LettaSchemasToolTool],
1518
- parse_obj_as(
1533
+ construct_type(
1519
1534
  type_=typing.List[LettaSchemasToolTool], # type: ignore
1520
1535
  object_=_response.json(),
1521
1536
  ),
@@ -1524,7 +1539,7 @@ class AsyncToolsClient:
1524
1539
  raise UnprocessableEntityError(
1525
1540
  typing.cast(
1526
1541
  HttpValidationError,
1527
- parse_obj_as(
1542
+ construct_type(
1528
1543
  type_=HttpValidationError, # type: ignore
1529
1544
  object_=_response.json(),
1530
1545
  ),
@@ -1539,7 +1554,8 @@ class AsyncToolsClient:
1539
1554
  self,
1540
1555
  *,
1541
1556
  source_code: str,
1542
- args: str,
1557
+ args: typing.Dict[str, typing.Optional[typing.Any]],
1558
+ env_vars: typing.Optional[typing.Dict[str, str]] = OMIT,
1543
1559
  name: typing.Optional[str] = OMIT,
1544
1560
  source_type: typing.Optional[str] = OMIT,
1545
1561
  request_options: typing.Optional[RequestOptions] = None,
@@ -1552,8 +1568,11 @@ class AsyncToolsClient:
1552
1568
  source_code : str
1553
1569
  The source code of the function.
1554
1570
 
1555
- args : str
1556
- The arguments to pass to the tool (as stringified JSON).
1571
+ args : typing.Dict[str, typing.Optional[typing.Any]]
1572
+ The arguments to pass to the tool.
1573
+
1574
+ env_vars : typing.Optional[typing.Dict[str, str]]
1575
+ The environment variables to pass to the tool.
1557
1576
 
1558
1577
  name : typing.Optional[str]
1559
1578
  The name of the tool to run.
@@ -1573,7 +1592,7 @@ class AsyncToolsClient:
1573
1592
  --------
1574
1593
  import asyncio
1575
1594
 
1576
- from letta import AsyncLetta
1595
+ from letta_client import AsyncLetta
1577
1596
 
1578
1597
  client = AsyncLetta(
1579
1598
  token="YOUR_TOKEN",
@@ -1583,7 +1602,7 @@ class AsyncToolsClient:
1583
1602
  async def main() -> None:
1584
1603
  await client.tools.run_tool_from_source(
1585
1604
  source_code="source_code",
1586
- args="args",
1605
+ args={"key": "value"},
1587
1606
  )
1588
1607
 
1589
1608
 
@@ -1595,6 +1614,7 @@ class AsyncToolsClient:
1595
1614
  json={
1596
1615
  "source_code": source_code,
1597
1616
  "args": args,
1617
+ "env_vars": env_vars,
1598
1618
  "name": name,
1599
1619
  "source_type": source_type,
1600
1620
  },
@@ -1608,7 +1628,7 @@ class AsyncToolsClient:
1608
1628
  if 200 <= _response.status_code < 300:
1609
1629
  return typing.cast(
1610
1630
  ToolReturnMessage,
1611
- parse_obj_as(
1631
+ construct_type(
1612
1632
  type_=ToolReturnMessage, # type: ignore
1613
1633
  object_=_response.json(),
1614
1634
  ),
@@ -1617,7 +1637,7 @@ class AsyncToolsClient:
1617
1637
  raise UnprocessableEntityError(
1618
1638
  typing.cast(
1619
1639
  HttpValidationError,
1620
- parse_obj_as(
1640
+ construct_type(
1621
1641
  type_=HttpValidationError, # type: ignore
1622
1642
  object_=_response.json(),
1623
1643
  ),
@@ -1648,7 +1668,7 @@ class AsyncToolsClient:
1648
1668
  --------
1649
1669
  import asyncio
1650
1670
 
1651
- from letta import AsyncLetta
1671
+ from letta_client import AsyncLetta
1652
1672
 
1653
1673
  client = AsyncLetta(
1654
1674
  token="YOUR_TOKEN",
@@ -1670,7 +1690,7 @@ class AsyncToolsClient:
1670
1690
  if 200 <= _response.status_code < 300:
1671
1691
  return typing.cast(
1672
1692
  typing.List[AppModel],
1673
- parse_obj_as(
1693
+ construct_type(
1674
1694
  type_=typing.List[AppModel], # type: ignore
1675
1695
  object_=_response.json(),
1676
1696
  ),
@@ -1679,7 +1699,7 @@ class AsyncToolsClient:
1679
1699
  raise UnprocessableEntityError(
1680
1700
  typing.cast(
1681
1701
  HttpValidationError,
1682
- parse_obj_as(
1702
+ construct_type(
1683
1703
  type_=HttpValidationError, # type: ignore
1684
1704
  object_=_response.json(),
1685
1705
  ),
@@ -1712,7 +1732,7 @@ class AsyncToolsClient:
1712
1732
  --------
1713
1733
  import asyncio
1714
1734
 
1715
- from letta import AsyncLetta
1735
+ from letta_client import AsyncLetta
1716
1736
 
1717
1737
  client = AsyncLetta(
1718
1738
  token="YOUR_TOKEN",
@@ -1736,7 +1756,7 @@ class AsyncToolsClient:
1736
1756
  if 200 <= _response.status_code < 300:
1737
1757
  return typing.cast(
1738
1758
  typing.List[ActionModel],
1739
- parse_obj_as(
1759
+ construct_type(
1740
1760
  type_=typing.List[ActionModel], # type: ignore
1741
1761
  object_=_response.json(),
1742
1762
  ),
@@ -1745,7 +1765,7 @@ class AsyncToolsClient:
1745
1765
  raise UnprocessableEntityError(
1746
1766
  typing.cast(
1747
1767
  HttpValidationError,
1748
- parse_obj_as(
1768
+ construct_type(
1749
1769
  type_=HttpValidationError, # type: ignore
1750
1770
  object_=_response.json(),
1751
1771
  ),
@@ -1778,7 +1798,7 @@ class AsyncToolsClient:
1778
1798
  --------
1779
1799
  import asyncio
1780
1800
 
1781
- from letta import AsyncLetta
1801
+ from letta_client import AsyncLetta
1782
1802
 
1783
1803
  client = AsyncLetta(
1784
1804
  token="YOUR_TOKEN",
@@ -1802,7 +1822,7 @@ class AsyncToolsClient:
1802
1822
  if 200 <= _response.status_code < 300:
1803
1823
  return typing.cast(
1804
1824
  LettaSchemasToolTool,
1805
- parse_obj_as(
1825
+ construct_type(
1806
1826
  type_=LettaSchemasToolTool, # type: ignore
1807
1827
  object_=_response.json(),
1808
1828
  ),
@@ -1811,7 +1831,7 @@ class AsyncToolsClient:
1811
1831
  raise UnprocessableEntityError(
1812
1832
  typing.cast(
1813
1833
  HttpValidationError,
1814
- parse_obj_as(
1834
+ construct_type(
1815
1835
  type_=HttpValidationError, # type: ignore
1816
1836
  object_=_response.json(),
1817
1837
  ),