letta-client 0.1.6__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.

Potentially problematic release.


This version of letta-client might be problematic. Click here for more details.

Files changed (153) hide show
  1. letta/__init__.py +28 -27
  2. letta/agents/__init__.py +40 -29
  3. letta/agents/archival_memory/client.py +17 -17
  4. letta/agents/client.py +405 -1721
  5. letta/agents/context/client.py +5 -5
  6. letta/agents/core_memory/client.py +1080 -0
  7. letta/agents/memory_variables/__init__.py +5 -0
  8. letta/agents/{memory → memory_variables}/client.py +41 -40
  9. letta/agents/memory_variables/types/__init__.py +5 -0
  10. letta/agents/{types/agents_get_agent_variables_response.py → memory_variables/types/memory_variables_get_response.py} +3 -3
  11. letta/agents/messages/client.py +232 -17
  12. letta/agents/messages/types/letta_streaming_response.py +21 -16
  13. letta/agents/messages/types/messages_list_response_item.py +19 -14
  14. letta/agents/recall_memory/client.py +5 -5
  15. letta/agents/sources/client.py +5 -5
  16. letta/agents/templates/__init__.py +5 -0
  17. letta/agents/templates/client.py +578 -0
  18. letta/agents/templates/types/__init__.py +5 -0
  19. letta/agents/{types/agents_migrate_response.py → templates/types/templates_migrate_response.py} +3 -3
  20. letta/agents/tools/client.py +13 -13
  21. letta/agents/types/__init__.py +23 -37
  22. letta/agents/types/agents_search_request_combinator.py +5 -0
  23. letta/agents/types/{agents_search_deployed_agents_request_search_item.py → agents_search_request_search_item.py} +17 -20
  24. letta/agents/types/{agents_search_deployed_agents_request_search_item_name.py → agents_search_request_search_item_name.py} +4 -6
  25. letta/agents/types/agents_search_request_search_item_name_operator.py +5 -0
  26. letta/agents/types/agents_search_request_search_item_order_by.py +22 -0
  27. letta/agents/types/agents_search_request_search_item_order_by_direction.py +5 -0
  28. letta/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 → agents_search_request_search_item_version.py} +2 -2
  30. letta/blocks/client.py +25 -25
  31. letta/client.py +4 -0
  32. letta/core/__init__.py +4 -0
  33. letta/core/client_wrapper.py +1 -1
  34. letta/core/unchecked_base_model.py +305 -0
  35. letta/health/client.py +3 -3
  36. letta/jobs/client.py +17 -17
  37. letta/models/client.py +5 -5
  38. letta/providers/client.py +597 -0
  39. letta/sources/client.py +33 -33
  40. letta/sources/files/client.py +11 -11
  41. letta/sources/passages/client.py +5 -5
  42. letta/tools/client.py +77 -57
  43. letta/types/__init__.py +4 -0
  44. letta/types/action_model.py +2 -2
  45. letta/types/action_parameters_model.py +2 -2
  46. letta/types/action_response_model.py +2 -2
  47. letta/types/agent_environment_variable.py +2 -7
  48. letta/types/agent_state.py +5 -8
  49. letta/types/agent_type.py +1 -2
  50. letta/types/app_auth_scheme.py +2 -2
  51. letta/types/app_model.py +2 -2
  52. letta/types/archival_memory_summary.py +2 -2
  53. letta/types/assistant_file.py +2 -2
  54. letta/types/assistant_message_input.py +2 -2
  55. letta/types/assistant_message_output.py +2 -2
  56. letta/types/auth_request.py +2 -2
  57. letta/types/auth_response.py +2 -2
  58. letta/types/auth_scheme_field.py +2 -2
  59. letta/types/block.py +2 -7
  60. letta/types/block_update.py +2 -2
  61. letta/types/chat_completion_request.py +2 -2
  62. letta/types/chat_completion_response.py +2 -2
  63. letta/types/child_tool_rule.py +2 -2
  64. letta/types/choice.py +2 -2
  65. letta/types/conditional_tool_rule.py +2 -2
  66. letta/types/conflict_error_body.py +2 -2
  67. letta/types/context_window_overview.py +2 -2
  68. letta/types/create_assistant_file_request.py +2 -2
  69. letta/types/create_assistant_request.py +2 -2
  70. letta/types/create_block.py +2 -2
  71. letta/types/delete_assistant_file_response.py +2 -2
  72. letta/types/delete_assistant_response.py +2 -2
  73. letta/types/e_2_b_sandbox_config.py +2 -2
  74. letta/types/embedding_config.py +2 -2
  75. letta/types/file_metadata.py +2 -7
  76. letta/types/function_call_input.py +2 -2
  77. letta/types/function_call_output.py +2 -2
  78. letta/types/function_schema.py +2 -2
  79. letta/types/health.py +2 -2
  80. letta/types/http_validation_error.py +2 -2
  81. letta/types/init_tool_rule.py +2 -2
  82. letta/types/internal_server_error_body.py +2 -2
  83. letta/types/job.py +2 -7
  84. letta/types/letta_request.py +7 -2
  85. letta/types/letta_response.py +2 -2
  86. letta/types/letta_response_messages_item.py +19 -14
  87. letta/types/letta_schemas_letta_message_tool_call.py +2 -2
  88. letta/types/letta_schemas_message_message.py +2 -7
  89. letta/types/letta_schemas_openai_chat_completion_request_tool.py +2 -2
  90. letta/types/letta_schemas_openai_chat_completion_request_tool_call.py +2 -2
  91. letta/types/letta_schemas_openai_chat_completion_request_tool_call_function.py +2 -2
  92. letta/types/letta_schemas_openai_chat_completion_response_message.py +2 -2
  93. letta/types/letta_schemas_openai_chat_completion_response_tool_call.py +2 -2
  94. letta/types/letta_schemas_openai_chat_completions_tool_call_function.py +2 -2
  95. letta/types/letta_schemas_openai_chat_completions_tool_call_input.py +2 -2
  96. letta/types/letta_schemas_openai_chat_completions_tool_call_output.py +2 -2
  97. letta/types/letta_schemas_tool_tool.py +9 -8
  98. letta/types/letta_usage_statistics.py +2 -2
  99. letta/types/llm_config.py +2 -2
  100. letta/types/local_sandbox_config.py +2 -2
  101. letta/types/log_prob_token.py +2 -2
  102. letta/types/memory.py +2 -2
  103. letta/types/message_content_log_prob.py +2 -2
  104. letta/types/message_create.py +2 -2
  105. letta/types/not_found_error_body.py +2 -2
  106. letta/types/open_ai_assistant.py +2 -2
  107. letta/types/organization.py +2 -2
  108. letta/types/organization_create.py +2 -2
  109. letta/types/passage.py +2 -7
  110. letta/types/provider.py +38 -0
  111. letta/types/reasoning_message.py +2 -2
  112. letta/types/recall_memory_summary.py +2 -2
  113. letta/types/response_format.py +2 -2
  114. letta/types/sandbox_config.py +2 -7
  115. letta/types/sandbox_config_create.py +2 -2
  116. letta/types/sandbox_config_update.py +2 -2
  117. letta/types/sandbox_environment_variable.py +2 -7
  118. letta/types/sandbox_environment_variable_create.py +2 -2
  119. letta/types/sandbox_environment_variable_update.py +2 -2
  120. letta/types/source.py +2 -7
  121. letta/types/system_message_input.py +2 -2
  122. letta/types/system_message_output.py +2 -2
  123. letta/types/terminal_tool_rule.py +2 -2
  124. letta/types/tool_call_delta.py +2 -2
  125. letta/types/tool_call_function_output.py +2 -2
  126. letta/types/tool_call_message.py +2 -2
  127. letta/types/tool_create.py +2 -2
  128. letta/types/tool_function_choice.py +2 -2
  129. letta/types/tool_input.py +2 -2
  130. letta/types/tool_message.py +2 -2
  131. letta/types/tool_return_message.py +2 -2
  132. letta/types/tool_type.py +5 -0
  133. letta/types/usage_statistics.py +2 -2
  134. letta/types/user.py +2 -7
  135. letta/types/user_create.py +2 -7
  136. letta/types/user_message_input.py +2 -2
  137. letta/types/user_message_output.py +2 -2
  138. letta/types/user_update.py +2 -7
  139. letta/types/validation_error.py +2 -2
  140. {letta_client-0.1.6.dist-info → letta_client-0.1.9.dist-info}/METADATA +1 -1
  141. letta_client-0.1.9.dist-info/RECORD +200 -0
  142. letta/agents/memory/__init__.py +0 -5
  143. letta/agents/memory/messages/client.py +0 -147
  144. letta/agents/memory_blocks/client.py +0 -364
  145. letta/agents/types/agents_search_deployed_agents_request_combinator.py +0 -5
  146. letta/agents/types/agents_search_deployed_agents_request_search_item_name_operator.py +0 -7
  147. letta/agents/types/agents_search_deployed_agents_request_search_item_order_by.py +0 -26
  148. letta/agents/types/agents_search_deployed_agents_request_search_item_order_by_direction.py +0 -5
  149. letta/agents/types/agents_search_deployed_agents_request_search_item_order_by_value.py +0 -7
  150. letta_client-0.1.6.dist-info/RECORD +0 -193
  151. /letta/agents/{memory/messages → core_memory}/__init__.py +0 -0
  152. /letta/{agents/memory_blocks → providers}/__init__.py +0 -0
  153. {letta_client-0.1.6.dist-info → letta_client-0.1.9.dist-info}/WHEEL +0 -0
letta/tools/client.py CHANGED
@@ -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
@@ -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
  ),
@@ -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
 
@@ -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
  ),
@@ -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
  ),
@@ -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
  ),
@@ -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
  ),
@@ -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
  ),
@@ -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, str],
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, str]
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.
@@ -660,7 +669,7 @@ class ToolsClient:
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
  ),
@@ -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
  ),
@@ -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
  ),
@@ -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
  ),
@@ -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
  ),
@@ -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
 
@@ -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
  ),
@@ -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
  ),
@@ -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
  ),
@@ -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
  ),
@@ -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
  ),
@@ -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, str],
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, str]
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.
@@ -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
  ),
@@ -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
  ),
@@ -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
  ),
@@ -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
  ),
letta/types/__init__.py CHANGED
@@ -88,6 +88,7 @@ from .open_ai_assistant import OpenAiAssistant
88
88
  from .organization import Organization
89
89
  from .organization_create import OrganizationCreate
90
90
  from .passage import Passage
91
+ from .provider import Provider
91
92
  from .reasoning_message import ReasoningMessage
92
93
  from .recall_memory_summary import RecallMemorySummary
93
94
  from .response_format import ResponseFormat
@@ -115,6 +116,7 @@ from .tool_message import ToolMessage
115
116
  from .tool_return_message import ToolReturnMessage
116
117
  from .tool_return_message_status import ToolReturnMessageStatus
117
118
  from .tool_rule_type import ToolRuleType
119
+ from .tool_type import ToolType
118
120
  from .usage_statistics import UsageStatistics
119
121
  from .user import User
120
122
  from .user_create import UserCreate
@@ -210,6 +212,7 @@ __all__ = [
210
212
  "Organization",
211
213
  "OrganizationCreate",
212
214
  "Passage",
215
+ "Provider",
213
216
  "ReasoningMessage",
214
217
  "RecallMemorySummary",
215
218
  "ResponseFormat",
@@ -237,6 +240,7 @@ __all__ = [
237
240
  "ToolReturnMessage",
238
241
  "ToolReturnMessageStatus",
239
242
  "ToolRuleType",
243
+ "ToolType",
240
244
  "UsageStatistics",
241
245
  "User",
242
246
  "UserCreate",
@@ -1,6 +1,6 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
3
+ from ..core.unchecked_base_model import UncheckedBaseModel
4
4
  import typing
5
5
  from .action_parameters_model import ActionParametersModel
6
6
  from .action_response_model import ActionResponseModel
@@ -10,7 +10,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
10
10
  import pydantic
11
11
 
12
12
 
13
- class ActionModel(UniversalBaseModel):
13
+ class ActionModel(UncheckedBaseModel):
14
14
  """
15
15
  Action data model.
16
16
  """
@@ -1,12 +1,12 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
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 ActionParametersModel(UniversalBaseModel):
9
+ class ActionParametersModel(UncheckedBaseModel):
10
10
  """
11
11
  Action parameter data models.
12
12
  """
@@ -1,12 +1,12 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
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 ActionResponseModel(UniversalBaseModel):
9
+ class ActionResponseModel(UncheckedBaseModel):
10
10
  """
11
11
  Action response data model.
12
12
  """
@@ -1,13 +1,13 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from ..core.pydantic_utilities import UniversalBaseModel
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 AgentEnvironmentVariable(UniversalBaseModel):
10
+ class AgentEnvironmentVariable(UncheckedBaseModel):
11
11
  created_by_id: typing.Optional[str] = pydantic.Field(default=None)
12
12
  """
13
13
  The id of the user that made this object.
@@ -48,11 +48,6 @@ class AgentEnvironmentVariable(UniversalBaseModel):
48
48
  An optional description of the environment variable.
49
49
  """
50
50
 
51
- organization_id: typing.Optional[str] = pydantic.Field(default=None)
52
- """
53
- The ID of the organization this environment variable belongs to.
54
- """
55
-
56
51
  agent_id: str = pydantic.Field()
57
52
  """
58
53
  The ID of the agent this environment variable belongs to.