letta-client 0.1.52__py3-none-any.whl → 0.1.54__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

letta_client/__init__.py CHANGED
@@ -334,6 +334,8 @@ from .agents import (
334
334
  AgentsSearchResponseAgentsItemToolRulesItemTwo,
335
335
  AgentsSearchResponseAgentsItemToolRulesItemTwoType,
336
336
  AgentsSearchResponseAgentsItemToolsItem,
337
+ AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema,
338
+ AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem,
337
339
  AgentsSearchResponseAgentsItemToolsItemCreatedById,
338
340
  AgentsSearchResponseAgentsItemToolsItemCreatedByIdItem,
339
341
  AgentsSearchResponseAgentsItemToolsItemDescription,
@@ -506,6 +508,8 @@ from .templates import (
506
508
  TemplatesCreateAgentsResponseAgentsItemToolRulesItemTwo,
507
509
  TemplatesCreateAgentsResponseAgentsItemToolRulesItemTwoType,
508
510
  TemplatesCreateAgentsResponseAgentsItemToolsItem,
511
+ TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema,
512
+ TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem,
509
513
  TemplatesCreateAgentsResponseAgentsItemToolsItemCreatedById,
510
514
  TemplatesCreateAgentsResponseAgentsItemToolsItemCreatedByIdItem,
511
515
  TemplatesCreateAgentsResponseAgentsItemToolsItemDescription,
@@ -689,6 +693,8 @@ __all__ = [
689
693
  "AgentsSearchResponseAgentsItemToolRulesItemTwo",
690
694
  "AgentsSearchResponseAgentsItemToolRulesItemTwoType",
691
695
  "AgentsSearchResponseAgentsItemToolsItem",
696
+ "AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema",
697
+ "AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem",
692
698
  "AgentsSearchResponseAgentsItemToolsItemCreatedById",
693
699
  "AgentsSearchResponseAgentsItemToolsItemCreatedByIdItem",
694
700
  "AgentsSearchResponseAgentsItemToolsItemDescription",
@@ -999,6 +1005,8 @@ __all__ = [
999
1005
  "TemplatesCreateAgentsResponseAgentsItemToolRulesItemTwo",
1000
1006
  "TemplatesCreateAgentsResponseAgentsItemToolRulesItemTwoType",
1001
1007
  "TemplatesCreateAgentsResponseAgentsItemToolsItem",
1008
+ "TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema",
1009
+ "TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem",
1002
1010
  "TemplatesCreateAgentsResponseAgentsItemToolsItemCreatedById",
1003
1011
  "TemplatesCreateAgentsResponseAgentsItemToolsItemCreatedByIdItem",
1004
1012
  "TemplatesCreateAgentsResponseAgentsItemToolsItemDescription",
@@ -153,6 +153,8 @@ from .types import (
153
153
  AgentsSearchResponseAgentsItemToolRulesItemTwo,
154
154
  AgentsSearchResponseAgentsItemToolRulesItemTwoType,
155
155
  AgentsSearchResponseAgentsItemToolsItem,
156
+ AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema,
157
+ AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem,
156
158
  AgentsSearchResponseAgentsItemToolsItemCreatedById,
157
159
  AgentsSearchResponseAgentsItemToolsItemCreatedByIdItem,
158
160
  AgentsSearchResponseAgentsItemToolsItemDescription,
@@ -333,6 +335,8 @@ __all__ = [
333
335
  "AgentsSearchResponseAgentsItemToolRulesItemTwo",
334
336
  "AgentsSearchResponseAgentsItemToolRulesItemTwoType",
335
337
  "AgentsSearchResponseAgentsItemToolsItem",
338
+ "AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema",
339
+ "AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem",
336
340
  "AgentsSearchResponseAgentsItemToolsItemCreatedById",
337
341
  "AgentsSearchResponseAgentsItemToolsItemCreatedByIdItem",
338
342
  "AgentsSearchResponseAgentsItemToolsItemDescription",
@@ -366,6 +366,12 @@ from .agents_search_response_agents_item_tool_rules_item_two_type import (
366
366
  AgentsSearchResponseAgentsItemToolRulesItemTwoType,
367
367
  )
368
368
  from .agents_search_response_agents_item_tools_item import AgentsSearchResponseAgentsItemToolsItem
369
+ from .agents_search_response_agents_item_tools_item_args_json_schema import (
370
+ AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema,
371
+ )
372
+ from .agents_search_response_agents_item_tools_item_args_json_schema_item import (
373
+ AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem,
374
+ )
369
375
  from .agents_search_response_agents_item_tools_item_created_by_id import (
370
376
  AgentsSearchResponseAgentsItemToolsItemCreatedById,
371
377
  )
@@ -563,6 +569,8 @@ __all__ = [
563
569
  "AgentsSearchResponseAgentsItemToolRulesItemTwo",
564
570
  "AgentsSearchResponseAgentsItemToolRulesItemTwoType",
565
571
  "AgentsSearchResponseAgentsItemToolsItem",
572
+ "AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema",
573
+ "AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem",
566
574
  "AgentsSearchResponseAgentsItemToolsItemCreatedById",
567
575
  "AgentsSearchResponseAgentsItemToolsItemCreatedByIdItem",
568
576
  "AgentsSearchResponseAgentsItemToolsItemDescription",
@@ -13,6 +13,9 @@ from .agents_search_response_agents_item_tools_item_organization_id import (
13
13
  from .agents_search_response_agents_item_tools_item_name import AgentsSearchResponseAgentsItemToolsItemName
14
14
  from .agents_search_response_agents_item_tools_item_source_code import AgentsSearchResponseAgentsItemToolsItemSourceCode
15
15
  from .agents_search_response_agents_item_tools_item_json_schema import AgentsSearchResponseAgentsItemToolsItemJsonSchema
16
+ from .agents_search_response_agents_item_tools_item_args_json_schema import (
17
+ AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema,
18
+ )
16
19
  from .agents_search_response_agents_item_tools_item_created_by_id import (
17
20
  AgentsSearchResponseAgentsItemToolsItemCreatedById,
18
21
  )
@@ -33,6 +36,7 @@ class AgentsSearchResponseAgentsItemToolsItem(UncheckedBaseModel):
33
36
  tags: typing.Optional[typing.List[str]] = None
34
37
  source_code: typing.Optional[AgentsSearchResponseAgentsItemToolsItemSourceCode] = None
35
38
  json_schema: typing.Optional[AgentsSearchResponseAgentsItemToolsItemJsonSchema] = None
39
+ args_json_schema: typing.Optional[AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema] = None
36
40
  return_char_limit: typing.Optional[float] = None
37
41
  created_by_id: typing.Optional[AgentsSearchResponseAgentsItemToolsItemCreatedById] = None
38
42
  last_updated_by_id: typing.Optional[AgentsSearchResponseAgentsItemToolsItemLastUpdatedById] = None
@@ -0,0 +1,12 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from .agents_search_response_agents_item_tools_item_args_json_schema_item import (
5
+ AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem,
6
+ )
7
+
8
+ AgentsSearchResponseAgentsItemToolsItemArgsJsonSchema = typing.Union[
9
+ typing.Optional[typing.Any],
10
+ typing.Optional[str],
11
+ typing.List[typing.Optional[AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem]],
12
+ ]
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ AgentsSearchResponseAgentsItemToolsItemArgsJsonSchemaItem = typing.Union[
6
+ typing.Optional[typing.Any], typing.Optional[str]
7
+ ]
letta_client/client.py CHANGED
@@ -1,6 +1,8 @@
1
1
  import inspect
2
2
  import typing
3
+ from pydantic import BaseModel, Field, model_validator
3
4
  from textwrap import dedent
5
+ from abc import abstractmethod
4
6
 
5
7
  from .base_client import AsyncLettaBase, LettaBase
6
8
  from .core.request_options import RequestOptions
@@ -25,12 +27,113 @@ class AsyncLetta(AsyncLettaBase):
25
27
  self.tools = ToolsClient(client_wrapper=self._client_wrapper)
26
28
 
27
29
 
30
+ class BaseTool(Tool):
31
+ name: str = Field(..., description="The name of the function.")
32
+ args_schema: typing.Optional[typing.Type[BaseModel]] = Field(default=None, description="The schema for validating the tool's arguments.")
33
+
34
+ @abstractmethod
35
+ def run(self, *args, **kwargs) -> typing.Any:
36
+ """
37
+ Execute the tool with the provided arguments.
38
+
39
+ Parameters
40
+ ----------
41
+ self
42
+ The instance of the tool
43
+ *args
44
+ Positional arguments to pass to the tool.
45
+ **kwargs
46
+ Keyword arguments to pass to the tool.
47
+
48
+ Returns
49
+ -------
50
+ typing.Any
51
+ The result of executing the tool.
52
+ """
53
+ pass
54
+
55
+
56
+ @model_validator(mode="after")
57
+ def no_self_in_run_source(self) -> "BaseTool":
58
+ """
59
+ Validate that the provided implementation does not reference `self` in the
60
+ `run` method implementation.
61
+
62
+ This check is performed after the model is created, so `self` is guaranteed
63
+ to be set.
64
+
65
+ If `self` is found in the source code of the `run` method, a `ValueError` is
66
+ raised with a message pointing to the line and value of the offending code.
67
+ """
68
+ source_code = self.get_source_code()
69
+ if "self." in source_code:
70
+ raise_on_line, line_value = None, None
71
+ for i, line in enumerate(source_code.splitlines()):
72
+ if "self." in line:
73
+ raise_on_line, line_value = i+1, line
74
+ break;
75
+ raise ValueError(
76
+ f"Detected reference to 'self' in line {raise_on_line} of implementation, " +
77
+ f"which is not allowed:\n\n{line_value}\n\n" +
78
+ f"Please pass in the arguments directly to run() instead.")
79
+ return self
80
+
81
+
82
+ def get_source_code(self) -> str:
83
+ """
84
+ Get the source code of the `run` method, which will be executed in an agent step.
85
+
86
+ Returns
87
+ -------
88
+ str
89
+ The source code of the tool.
90
+ """
91
+ source_code = dedent(inspect.getsource(self.run))
92
+
93
+ # replace tool name
94
+ source_code = source_code.replace("def run", f"def {self.name}")
95
+
96
+ # remove self, handling several cases
97
+ source_code_lines = source_code.splitlines()
98
+ if "self" in source_code_lines[0]:
99
+ # def run(self, ...): or def run (self,): or def run(self):
100
+ source_code_lines[0] = source_code_lines[0].replace("self, ", "").replace("self,", "").replace("self", "")
101
+ else:
102
+ maybe_line_to_delete = None
103
+ for i, line in enumerate(source_code_lines):
104
+ if line.strip() == "self" or line.strip() == "self,":
105
+ # def run(
106
+ # self,
107
+ # ...
108
+ # ):
109
+ maybe_line_to_delete = i
110
+ break
111
+ elif line.strip().startswith("self"):
112
+ # def run(
113
+ # self, ...
114
+ # ):
115
+ source_code_lines[i] = line.replace("self, ", "").replace("self,", "").replace("self", "")
116
+ break
117
+ if maybe_line_to_delete is not None:
118
+ del source_code_lines[maybe_line_to_delete]
119
+ if maybe_line_to_delete == 1 and source_code_lines[0].strip()[-1] == "(" and source_code_lines[1].strip()[0] == ")":
120
+ # def run(
121
+ # self
122
+ # ):
123
+ source_code_lines[0] = source_code_lines[0].strip() + source_code_lines[1].strip()
124
+ del source_code_lines[1]
125
+
126
+ source_code = "\n".join(source_code_lines)
127
+ return source_code
128
+
129
+
28
130
  class ToolsClient(ToolsClientBase):
29
131
 
30
132
  def create_from_function(
31
133
  self,
32
134
  *,
33
135
  func: typing.Callable,
136
+ args_schema: typing.Optional[typing.Type[BaseModel]] = OMIT,
34
137
  description: typing.Optional[str] = OMIT,
35
138
  tags: typing.Optional[typing.Sequence[str]] = OMIT,
36
139
  source_type: typing.Optional[str] = OMIT,
@@ -40,9 +143,72 @@ class ToolsClient(ToolsClientBase):
40
143
  return_char_limit: typing.Optional[int] = OMIT,
41
144
  request_options: typing.Optional[RequestOptions] = None,
42
145
  ) -> Tool:
146
+ """
147
+ Create a new tool from a callable
148
+
149
+ Parameters
150
+ ----------
151
+ func : typing.Callable
152
+ The callable to create the tool from.
153
+
154
+ args_schema : typing.Optional[typing.Type[BaseModel]]
155
+ The arguments schema of the function, as a Pydantic model.
156
+
157
+ description : typing.Optional[str]
158
+ The description of the tool.
159
+
160
+ tags : typing.Optional[typing.Sequence[str]]
161
+ Metadata tags.
162
+
163
+ source_type : typing.Optional[str]
164
+ The source type of the function.
165
+
166
+ json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
167
+ The JSON schema of the function (auto-generated from source_code if not provided)
168
+
169
+ return_char_limit : typing.Optional[int]
170
+ The maximum number of characters in the response.
171
+
172
+ request_options : typing.Optional[RequestOptions]
173
+ Request-specific configuration.
174
+
175
+ Returns
176
+ -------
177
+ Tool
178
+ Successful Response
179
+
180
+ Examples
181
+ --------
182
+ from letta_client import Letta
183
+
184
+ client = Letta(
185
+ token="YOUR_TOKEN",
186
+ )
187
+
188
+ def add_two_numbers(a: int, b: int) -> int:
189
+ return a + b
190
+
191
+ client.tools.create_from_function(
192
+ func=add_two_numbers,
193
+ )
194
+
195
+ class InventoryEntryData(BaseModel):
196
+ data: InventoryEntry
197
+ quantity_change: int
198
+
199
+ def manage_inventory(data: InventoryEntry, quantity_change: int) -> bool:
200
+ pass
201
+
202
+ client.tools.create_from_function(
203
+ func=manage_inventory,
204
+ args_schema=InventoryEntryData,
205
+ )
206
+ """
43
207
  source_code = dedent(inspect.getsource(func))
208
+ args_json_schema = args_schema.model_json_schema() if args_schema and args_schema != OMIT else None
44
209
  return self.create(
45
210
  source_code=source_code,
211
+ args_json_schema=args_json_schema,
46
212
  description=description,
47
213
  tags=tags,
48
214
  source_type=source_type,
@@ -51,10 +217,12 @@ class ToolsClient(ToolsClientBase):
51
217
  request_options=request_options,
52
218
  )
53
219
 
220
+
54
221
  def upsert_from_function(
55
222
  self,
56
223
  *,
57
224
  func: typing.Callable,
225
+ args_schema: typing.Optional[typing.Type[BaseModel]] = OMIT,
58
226
  description: typing.Optional[str] = OMIT,
59
227
  tags: typing.Optional[typing.Sequence[str]] = OMIT,
60
228
  source_type: typing.Optional[str] = OMIT,
@@ -64,9 +232,72 @@ class ToolsClient(ToolsClientBase):
64
232
  return_char_limit: typing.Optional[int] = OMIT,
65
233
  request_options: typing.Optional[RequestOptions] = None,
66
234
  ) -> Tool:
235
+ """
236
+ Create or update a tool from a callable
237
+
238
+ Parameters
239
+ ----------
240
+ func : typing.Callable
241
+ The callable to create or update the tool from.
242
+
243
+ args_schema : typing.Optional[typing.Type[BaseModel]]
244
+ The arguments schema of the function, as a Pydantic model.
245
+
246
+ description : typing.Optional[str]
247
+ The description of the tool.
248
+
249
+ tags : typing.Optional[typing.Sequence[str]]
250
+ Metadata tags.
251
+
252
+ source_type : typing.Optional[str]
253
+ The source type of the function.
254
+
255
+ json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
256
+ The JSON schema of the function (auto-generated from source_code if not provided)
257
+
258
+ return_char_limit : typing.Optional[int]
259
+ The maximum number of characters in the response.
260
+
261
+ request_options : typing.Optional[RequestOptions]
262
+ Request-specific configuration.
263
+
264
+ Returns
265
+ -------
266
+ Tool
267
+ Successful Response
268
+
269
+ Examples
270
+ --------
271
+ from letta_client import Letta
272
+
273
+ client = Letta(
274
+ token="YOUR_TOKEN",
275
+ )
276
+
277
+ def add_two_numbers(a: int, b: int) -> int:
278
+ return a + b
279
+
280
+ client.tools.upsert_from_function(
281
+ func=add_two_numbers,
282
+ )
283
+
284
+ class InventoryEntryData(BaseModel):
285
+ data: InventoryEntry
286
+ quantity_change: int
287
+
288
+ def manage_inventory(data: InventoryEntry, quantity_change: int) -> bool:
289
+ pass
290
+
291
+ client.tools.upsert_from_function(
292
+ func=manage_inventory,
293
+ args_schema=InventoryEntryData,
294
+ )
295
+ """
67
296
  source_code = dedent(inspect.getsource(func))
297
+ args_json_schema = args_schema.model_json_schema() if args_schema and args_schema != OMIT else None
68
298
  return self.upsert(
69
299
  source_code=source_code,
300
+ args_json_schema=args_json_schema,
70
301
  description=description,
71
302
  tags=tags,
72
303
  source_type=source_type,
@@ -74,3 +305,78 @@ class ToolsClient(ToolsClientBase):
74
305
  return_char_limit=return_char_limit,
75
306
  request_options=request_options,
76
307
  )
308
+
309
+ def add(
310
+ self,
311
+ *,
312
+ tool: BaseTool,
313
+ request_options: typing.Optional[RequestOptions] = None,
314
+ ) -> Tool:
315
+ """
316
+ Add a tool to Letta from a custom Tool class
317
+
318
+ Parameters
319
+ ----------
320
+ tool : BaseTool
321
+ The tool object to be added.
322
+
323
+ request_options : typing.Optional[RequestOptions]
324
+ Request-specific configuration.
325
+
326
+ Returns
327
+ -------
328
+ Tool
329
+ Successful Response
330
+
331
+ Examples
332
+ --------
333
+ from letta_client import Letta
334
+
335
+ client = Letta(
336
+ token="YOUR_TOKEN",
337
+ )
338
+
339
+ class InventoryItem(BaseModel):
340
+ sku: str # Unique product identifier
341
+ name: str # Product name
342
+ price: float # Current price
343
+ category: str # Product category (e.g., "Electronics", "Clothing")
344
+
345
+ class InventoryEntry(BaseModel):
346
+ timestamp: int # Unix timestamp of the transaction
347
+ item: InventoryItem # The product being updated
348
+ transaction_id: str # Unique identifier for this inventory update
349
+
350
+ class InventoryEntryData(BaseModel):
351
+ data: InventoryEntry
352
+ quantity_change: int # Change in quantity (positive for additions, negative for removals)
353
+
354
+ class ManageInventoryTool(BaseTool):
355
+ name: str = "manage_inventory"
356
+ args_schema: Type[BaseModel] = InventoryEntryData
357
+ description: str = "Update inventory catalogue with a new data entry"
358
+ tags: List[str] = ["inventory", "shop"]
359
+
360
+ def run(self, data: InventoryEntry, quantity_change: int) -> bool:
361
+ '''
362
+ Implementation of the manage_inventory tool
363
+ '''
364
+ print(f"Updated inventory for {data.item.name} with a quantity change of {quantity_change}")
365
+ return True
366
+
367
+ client.tools.add(
368
+ tool=ManageInventoryTool()
369
+ )
370
+ """
371
+ source_code = tool.get_source_code()
372
+ args_json_schema = tool.args_schema.model_json_schema() if tool.args_schema else None
373
+ return self.upsert(
374
+ source_code=source_code,
375
+ args_json_schema=args_json_schema or OMIT,
376
+ description=tool.description or OMIT,
377
+ tags=tool.tags or OMIT,
378
+ source_type=tool.source_type or OMIT,
379
+ json_schema=tool.json_schema or OMIT,
380
+ return_char_limit=tool.return_char_limit or OMIT,
381
+ request_options=request_options,
382
+ )
@@ -16,7 +16,7 @@ class BaseClientWrapper:
16
16
  headers: typing.Dict[str, str] = {
17
17
  "X-Fern-Language": "Python",
18
18
  "X-Fern-SDK-Name": "letta-client",
19
- "X-Fern-SDK-Version": "0.1.52",
19
+ "X-Fern-SDK-Version": "0.1.54",
20
20
  }
21
21
  if self.token is not None:
22
22
  headers["Authorization"] = f"Bearer {self.token}"
@@ -13,6 +13,7 @@ from ..core.jsonable_encoder import jsonable_encoder
13
13
  from ..types.message_role import MessageRole
14
14
  from ..types.letta_message_union import LettaMessageUnion
15
15
  from ..types.usage_statistics import UsageStatistics
16
+ from ..types.step import Step
16
17
  from ..core.client_wrapper import AsyncClientWrapper
17
18
 
18
19
 
@@ -395,6 +396,99 @@ class RunsClient:
395
396
  raise ApiError(status_code=_response.status_code, body=_response.text)
396
397
  raise ApiError(status_code=_response.status_code, body=_response_json)
397
398
 
399
+ def list_run_steps(
400
+ self,
401
+ run_id: str,
402
+ *,
403
+ before: typing.Optional[str] = None,
404
+ after: typing.Optional[str] = None,
405
+ limit: typing.Optional[int] = None,
406
+ order: typing.Optional[str] = None,
407
+ request_options: typing.Optional[RequestOptions] = None,
408
+ ) -> typing.List[Step]:
409
+ """
410
+ Get messages associated with a run with filtering options.
411
+
412
+ Args:
413
+ run_id: ID of the run
414
+ before: A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
415
+ after: A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
416
+ limit: Maximum number of steps to return
417
+ order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
418
+
419
+ Returns:
420
+ A list of steps associated with the run.
421
+
422
+ Parameters
423
+ ----------
424
+ run_id : str
425
+
426
+ before : typing.Optional[str]
427
+ Cursor for pagination
428
+
429
+ after : typing.Optional[str]
430
+ Cursor for pagination
431
+
432
+ limit : typing.Optional[int]
433
+ Maximum number of messages to return
434
+
435
+ order : typing.Optional[str]
436
+ Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
437
+
438
+ request_options : typing.Optional[RequestOptions]
439
+ Request-specific configuration.
440
+
441
+ Returns
442
+ -------
443
+ typing.List[Step]
444
+ Successful Response
445
+
446
+ Examples
447
+ --------
448
+ from letta_client import Letta
449
+
450
+ client = Letta(
451
+ token="YOUR_TOKEN",
452
+ )
453
+ client.runs.list_run_steps(
454
+ run_id="run_id",
455
+ )
456
+ """
457
+ _response = self._client_wrapper.httpx_client.request(
458
+ f"v1/runs/{jsonable_encoder(run_id)}/steps",
459
+ method="GET",
460
+ params={
461
+ "before": before,
462
+ "after": after,
463
+ "limit": limit,
464
+ "order": order,
465
+ },
466
+ request_options=request_options,
467
+ )
468
+ try:
469
+ if 200 <= _response.status_code < 300:
470
+ return typing.cast(
471
+ typing.List[Step],
472
+ construct_type(
473
+ type_=typing.List[Step], # type: ignore
474
+ object_=_response.json(),
475
+ ),
476
+ )
477
+ if _response.status_code == 422:
478
+ raise UnprocessableEntityError(
479
+ typing.cast(
480
+ HttpValidationError,
481
+ construct_type(
482
+ type_=HttpValidationError, # type: ignore
483
+ object_=_response.json(),
484
+ ),
485
+ )
486
+ )
487
+ _response_json = _response.json()
488
+ except JSONDecodeError:
489
+ raise ApiError(status_code=_response.status_code, body=_response.text)
490
+ raise ApiError(status_code=_response.status_code, body=_response_json)
491
+
398
492
 
399
493
  class AsyncRunsClient:
400
494
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -822,3 +916,104 @@ class AsyncRunsClient:
822
916
  except JSONDecodeError:
823
917
  raise ApiError(status_code=_response.status_code, body=_response.text)
824
918
  raise ApiError(status_code=_response.status_code, body=_response_json)
919
+
920
+ async def list_run_steps(
921
+ self,
922
+ run_id: str,
923
+ *,
924
+ before: typing.Optional[str] = None,
925
+ after: typing.Optional[str] = None,
926
+ limit: typing.Optional[int] = None,
927
+ order: typing.Optional[str] = None,
928
+ request_options: typing.Optional[RequestOptions] = None,
929
+ ) -> typing.List[Step]:
930
+ """
931
+ Get messages associated with a run with filtering options.
932
+
933
+ Args:
934
+ run_id: ID of the run
935
+ before: A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
936
+ after: A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
937
+ limit: Maximum number of steps to return
938
+ order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
939
+
940
+ Returns:
941
+ A list of steps associated with the run.
942
+
943
+ Parameters
944
+ ----------
945
+ run_id : str
946
+
947
+ before : typing.Optional[str]
948
+ Cursor for pagination
949
+
950
+ after : typing.Optional[str]
951
+ Cursor for pagination
952
+
953
+ limit : typing.Optional[int]
954
+ Maximum number of messages to return
955
+
956
+ order : typing.Optional[str]
957
+ Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
958
+
959
+ request_options : typing.Optional[RequestOptions]
960
+ Request-specific configuration.
961
+
962
+ Returns
963
+ -------
964
+ typing.List[Step]
965
+ Successful Response
966
+
967
+ Examples
968
+ --------
969
+ import asyncio
970
+
971
+ from letta_client import AsyncLetta
972
+
973
+ client = AsyncLetta(
974
+ token="YOUR_TOKEN",
975
+ )
976
+
977
+
978
+ async def main() -> None:
979
+ await client.runs.list_run_steps(
980
+ run_id="run_id",
981
+ )
982
+
983
+
984
+ asyncio.run(main())
985
+ """
986
+ _response = await self._client_wrapper.httpx_client.request(
987
+ f"v1/runs/{jsonable_encoder(run_id)}/steps",
988
+ method="GET",
989
+ params={
990
+ "before": before,
991
+ "after": after,
992
+ "limit": limit,
993
+ "order": order,
994
+ },
995
+ request_options=request_options,
996
+ )
997
+ try:
998
+ if 200 <= _response.status_code < 300:
999
+ return typing.cast(
1000
+ typing.List[Step],
1001
+ construct_type(
1002
+ type_=typing.List[Step], # type: ignore
1003
+ object_=_response.json(),
1004
+ ),
1005
+ )
1006
+ if _response.status_code == 422:
1007
+ raise UnprocessableEntityError(
1008
+ typing.cast(
1009
+ HttpValidationError,
1010
+ construct_type(
1011
+ type_=HttpValidationError, # type: ignore
1012
+ object_=_response.json(),
1013
+ ),
1014
+ )
1015
+ )
1016
+ _response_json = _response.json()
1017
+ except JSONDecodeError:
1018
+ raise ApiError(status_code=_response.status_code, body=_response.text)
1019
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -148,6 +148,8 @@ from .types import (
148
148
  TemplatesCreateAgentsResponseAgentsItemToolRulesItemTwo,
149
149
  TemplatesCreateAgentsResponseAgentsItemToolRulesItemTwoType,
150
150
  TemplatesCreateAgentsResponseAgentsItemToolsItem,
151
+ TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema,
152
+ TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem,
151
153
  TemplatesCreateAgentsResponseAgentsItemToolsItemCreatedById,
152
154
  TemplatesCreateAgentsResponseAgentsItemToolsItemCreatedByIdItem,
153
155
  TemplatesCreateAgentsResponseAgentsItemToolsItemDescription,
@@ -317,6 +319,8 @@ __all__ = [
317
319
  "TemplatesCreateAgentsResponseAgentsItemToolRulesItemTwo",
318
320
  "TemplatesCreateAgentsResponseAgentsItemToolRulesItemTwoType",
319
321
  "TemplatesCreateAgentsResponseAgentsItemToolsItem",
322
+ "TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema",
323
+ "TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem",
320
324
  "TemplatesCreateAgentsResponseAgentsItemToolsItemCreatedById",
321
325
  "TemplatesCreateAgentsResponseAgentsItemToolsItemCreatedByIdItem",
322
326
  "TemplatesCreateAgentsResponseAgentsItemToolsItemDescription",
@@ -415,6 +415,12 @@ from .templates_create_agents_response_agents_item_tool_rules_item_two_type impo
415
415
  TemplatesCreateAgentsResponseAgentsItemToolRulesItemTwoType,
416
416
  )
417
417
  from .templates_create_agents_response_agents_item_tools_item import TemplatesCreateAgentsResponseAgentsItemToolsItem
418
+ from .templates_create_agents_response_agents_item_tools_item_args_json_schema import (
419
+ TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema,
420
+ )
421
+ from .templates_create_agents_response_agents_item_tools_item_args_json_schema_item import (
422
+ TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem,
423
+ )
418
424
  from .templates_create_agents_response_agents_item_tools_item_created_by_id import (
419
425
  TemplatesCreateAgentsResponseAgentsItemToolsItemCreatedById,
420
426
  )
@@ -619,6 +625,8 @@ __all__ = [
619
625
  "TemplatesCreateAgentsResponseAgentsItemToolRulesItemTwo",
620
626
  "TemplatesCreateAgentsResponseAgentsItemToolRulesItemTwoType",
621
627
  "TemplatesCreateAgentsResponseAgentsItemToolsItem",
628
+ "TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema",
629
+ "TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem",
622
630
  "TemplatesCreateAgentsResponseAgentsItemToolsItemCreatedById",
623
631
  "TemplatesCreateAgentsResponseAgentsItemToolsItemCreatedByIdItem",
624
632
  "TemplatesCreateAgentsResponseAgentsItemToolsItemDescription",
@@ -23,6 +23,9 @@ from .templates_create_agents_response_agents_item_tools_item_source_code import
23
23
  from .templates_create_agents_response_agents_item_tools_item_json_schema import (
24
24
  TemplatesCreateAgentsResponseAgentsItemToolsItemJsonSchema,
25
25
  )
26
+ from .templates_create_agents_response_agents_item_tools_item_args_json_schema import (
27
+ TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema,
28
+ )
26
29
  from .templates_create_agents_response_agents_item_tools_item_created_by_id import (
27
30
  TemplatesCreateAgentsResponseAgentsItemToolsItemCreatedById,
28
31
  )
@@ -43,6 +46,7 @@ class TemplatesCreateAgentsResponseAgentsItemToolsItem(UncheckedBaseModel):
43
46
  tags: typing.Optional[typing.List[str]] = None
44
47
  source_code: typing.Optional[TemplatesCreateAgentsResponseAgentsItemToolsItemSourceCode] = None
45
48
  json_schema: typing.Optional[TemplatesCreateAgentsResponseAgentsItemToolsItemJsonSchema] = None
49
+ args_json_schema: typing.Optional[TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema] = None
46
50
  return_char_limit: typing.Optional[float] = None
47
51
  created_by_id: typing.Optional[TemplatesCreateAgentsResponseAgentsItemToolsItemCreatedById] = None
48
52
  last_updated_by_id: typing.Optional[TemplatesCreateAgentsResponseAgentsItemToolsItemLastUpdatedById] = None
@@ -0,0 +1,12 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from .templates_create_agents_response_agents_item_tools_item_args_json_schema_item import (
5
+ TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem,
6
+ )
7
+
8
+ TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchema = typing.Union[
9
+ typing.Optional[typing.Any],
10
+ typing.Optional[str],
11
+ typing.List[typing.Optional[TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem]],
12
+ ]
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ TemplatesCreateAgentsResponseAgentsItemToolsItemArgsJsonSchemaItem = typing.Union[
6
+ typing.Optional[typing.Any], typing.Optional[str]
7
+ ]
@@ -146,6 +146,7 @@ class ToolsClient:
146
146
  source_code: typing.Optional[str] = OMIT,
147
147
  source_type: typing.Optional[str] = OMIT,
148
148
  json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
149
+ args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
149
150
  return_char_limit: typing.Optional[int] = OMIT,
150
151
  request_options: typing.Optional[RequestOptions] = None,
151
152
  ) -> Tool:
@@ -171,6 +172,9 @@ class ToolsClient:
171
172
  json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
172
173
  The JSON schema of the function (auto-generated from source_code if not provided)
173
174
 
175
+ args_json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
176
+ The args JSON schema of the function.
177
+
174
178
  return_char_limit : typing.Optional[int]
175
179
  The maximum number of characters in the response.
176
180
 
@@ -202,6 +206,7 @@ class ToolsClient:
202
206
  "source_code": source_code,
203
207
  "source_type": source_type,
204
208
  "json_schema": json_schema,
209
+ "args_json_schema": args_json_schema,
205
210
  "return_char_limit": return_char_limit,
206
211
  },
207
212
  headers={
@@ -312,6 +317,7 @@ class ToolsClient:
312
317
  tags: typing.Optional[typing.Sequence[str]] = OMIT,
313
318
  source_type: typing.Optional[str] = OMIT,
314
319
  json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
320
+ args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
315
321
  return_char_limit: typing.Optional[int] = OMIT,
316
322
  request_options: typing.Optional[RequestOptions] = None,
317
323
  ) -> Tool:
@@ -335,6 +341,9 @@ class ToolsClient:
335
341
  json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
336
342
  The JSON schema of the function (auto-generated from source_code if not provided)
337
343
 
344
+ args_json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
345
+ The args JSON schema of the function.
346
+
338
347
  return_char_limit : typing.Optional[int]
339
348
  The maximum number of characters in the response.
340
349
 
@@ -366,6 +375,7 @@ class ToolsClient:
366
375
  "source_code": source_code,
367
376
  "source_type": source_type,
368
377
  "json_schema": json_schema,
378
+ "args_json_schema": args_json_schema,
369
379
  "return_char_limit": return_char_limit,
370
380
  },
371
381
  request_options=request_options,
@@ -403,6 +413,7 @@ class ToolsClient:
403
413
  tags: typing.Optional[typing.Sequence[str]] = OMIT,
404
414
  source_type: typing.Optional[str] = OMIT,
405
415
  json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
416
+ args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
406
417
  return_char_limit: typing.Optional[int] = OMIT,
407
418
  request_options: typing.Optional[RequestOptions] = None,
408
419
  ) -> Tool:
@@ -426,6 +437,9 @@ class ToolsClient:
426
437
  json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
427
438
  The JSON schema of the function (auto-generated from source_code if not provided)
428
439
 
440
+ args_json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
441
+ The args JSON schema of the function.
442
+
429
443
  return_char_limit : typing.Optional[int]
430
444
  The maximum number of characters in the response.
431
445
 
@@ -457,6 +471,7 @@ class ToolsClient:
457
471
  "source_code": source_code,
458
472
  "source_type": source_type,
459
473
  "json_schema": json_schema,
474
+ "args_json_schema": args_json_schema,
460
475
  "return_char_limit": return_char_limit,
461
476
  },
462
477
  request_options=request_options,
@@ -546,6 +561,7 @@ class ToolsClient:
546
561
  env_vars: typing.Optional[typing.Dict[str, str]] = OMIT,
547
562
  name: typing.Optional[str] = OMIT,
548
563
  source_type: typing.Optional[str] = OMIT,
564
+ args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
549
565
  request_options: typing.Optional[RequestOptions] = None,
550
566
  ) -> ToolReturnMessage:
551
567
  """
@@ -568,6 +584,9 @@ class ToolsClient:
568
584
  source_type : typing.Optional[str]
569
585
  The type of the source code.
570
586
 
587
+ args_json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
588
+ The args JSON schema of the function.
589
+
571
590
  request_options : typing.Optional[RequestOptions]
572
591
  Request-specific configuration.
573
592
 
@@ -597,6 +616,7 @@ class ToolsClient:
597
616
  "env_vars": env_vars,
598
617
  "name": name,
599
618
  "source_type": source_type,
619
+ "args_json_schema": args_json_schema,
600
620
  },
601
621
  headers={
602
622
  "content-type": "application/json",
@@ -940,6 +960,7 @@ class AsyncToolsClient:
940
960
  source_code: typing.Optional[str] = OMIT,
941
961
  source_type: typing.Optional[str] = OMIT,
942
962
  json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
963
+ args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
943
964
  return_char_limit: typing.Optional[int] = OMIT,
944
965
  request_options: typing.Optional[RequestOptions] = None,
945
966
  ) -> Tool:
@@ -965,6 +986,9 @@ class AsyncToolsClient:
965
986
  json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
966
987
  The JSON schema of the function (auto-generated from source_code if not provided)
967
988
 
989
+ args_json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
990
+ The args JSON schema of the function.
991
+
968
992
  return_char_limit : typing.Optional[int]
969
993
  The maximum number of characters in the response.
970
994
 
@@ -1004,6 +1028,7 @@ class AsyncToolsClient:
1004
1028
  "source_code": source_code,
1005
1029
  "source_type": source_type,
1006
1030
  "json_schema": json_schema,
1031
+ "args_json_schema": args_json_schema,
1007
1032
  "return_char_limit": return_char_limit,
1008
1033
  },
1009
1034
  headers={
@@ -1122,6 +1147,7 @@ class AsyncToolsClient:
1122
1147
  tags: typing.Optional[typing.Sequence[str]] = OMIT,
1123
1148
  source_type: typing.Optional[str] = OMIT,
1124
1149
  json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1150
+ args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1125
1151
  return_char_limit: typing.Optional[int] = OMIT,
1126
1152
  request_options: typing.Optional[RequestOptions] = None,
1127
1153
  ) -> Tool:
@@ -1145,6 +1171,9 @@ class AsyncToolsClient:
1145
1171
  json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
1146
1172
  The JSON schema of the function (auto-generated from source_code if not provided)
1147
1173
 
1174
+ args_json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
1175
+ The args JSON schema of the function.
1176
+
1148
1177
  return_char_limit : typing.Optional[int]
1149
1178
  The maximum number of characters in the response.
1150
1179
 
@@ -1184,6 +1213,7 @@ class AsyncToolsClient:
1184
1213
  "source_code": source_code,
1185
1214
  "source_type": source_type,
1186
1215
  "json_schema": json_schema,
1216
+ "args_json_schema": args_json_schema,
1187
1217
  "return_char_limit": return_char_limit,
1188
1218
  },
1189
1219
  request_options=request_options,
@@ -1221,6 +1251,7 @@ class AsyncToolsClient:
1221
1251
  tags: typing.Optional[typing.Sequence[str]] = OMIT,
1222
1252
  source_type: typing.Optional[str] = OMIT,
1223
1253
  json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1254
+ args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1224
1255
  return_char_limit: typing.Optional[int] = OMIT,
1225
1256
  request_options: typing.Optional[RequestOptions] = None,
1226
1257
  ) -> Tool:
@@ -1244,6 +1275,9 @@ class AsyncToolsClient:
1244
1275
  json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
1245
1276
  The JSON schema of the function (auto-generated from source_code if not provided)
1246
1277
 
1278
+ args_json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
1279
+ The args JSON schema of the function.
1280
+
1247
1281
  return_char_limit : typing.Optional[int]
1248
1282
  The maximum number of characters in the response.
1249
1283
 
@@ -1283,6 +1317,7 @@ class AsyncToolsClient:
1283
1317
  "source_code": source_code,
1284
1318
  "source_type": source_type,
1285
1319
  "json_schema": json_schema,
1320
+ "args_json_schema": args_json_schema,
1286
1321
  "return_char_limit": return_char_limit,
1287
1322
  },
1288
1323
  request_options=request_options,
@@ -1380,6 +1415,7 @@ class AsyncToolsClient:
1380
1415
  env_vars: typing.Optional[typing.Dict[str, str]] = OMIT,
1381
1416
  name: typing.Optional[str] = OMIT,
1382
1417
  source_type: typing.Optional[str] = OMIT,
1418
+ args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
1383
1419
  request_options: typing.Optional[RequestOptions] = None,
1384
1420
  ) -> ToolReturnMessage:
1385
1421
  """
@@ -1402,6 +1438,9 @@ class AsyncToolsClient:
1402
1438
  source_type : typing.Optional[str]
1403
1439
  The type of the source code.
1404
1440
 
1441
+ args_json_schema : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
1442
+ The args JSON schema of the function.
1443
+
1405
1444
  request_options : typing.Optional[RequestOptions]
1406
1445
  Request-specific configuration.
1407
1446
 
@@ -1439,6 +1478,7 @@ class AsyncToolsClient:
1439
1478
  "env_vars": env_vars,
1440
1479
  "name": name,
1441
1480
  "source_type": source_type,
1481
+ "args_json_schema": args_json_schema,
1442
1482
  },
1443
1483
  headers={
1444
1484
  "content-type": "application/json",
@@ -12,6 +12,8 @@ CompletionCreateParamsNonStreamingModel = typing.Union[
12
12
  typing.Literal["o1-preview-2024-09-12"],
13
13
  typing.Literal["o1-mini"],
14
14
  typing.Literal["o1-mini-2024-09-12"],
15
+ typing.Literal["gpt-4.5-preview"],
16
+ typing.Literal["gpt-4.5-preview-2025-02-27"],
15
17
  typing.Literal["gpt-4o"],
16
18
  typing.Literal["gpt-4o-2024-11-20"],
17
19
  typing.Literal["gpt-4o-2024-08-06"],
@@ -12,6 +12,8 @@ CompletionCreateParamsStreamingModel = typing.Union[
12
12
  typing.Literal["o1-preview-2024-09-12"],
13
13
  typing.Literal["o1-mini"],
14
14
  typing.Literal["o1-mini-2024-09-12"],
15
+ typing.Literal["gpt-4.5-preview"],
16
+ typing.Literal["gpt-4.5-preview-2025-02-27"],
15
17
  typing.Literal["gpt-4o"],
16
18
  typing.Literal["gpt-4o-2024-11-20"],
17
19
  typing.Literal["gpt-4o-2024-08-06"],
@@ -59,6 +59,11 @@ class Tool(UncheckedBaseModel):
59
59
  The JSON schema of the function.
60
60
  """
61
61
 
62
+ args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
63
+ """
64
+ The args JSON schema of the function.
65
+ """
66
+
62
67
  return_char_limit: typing.Optional[int] = pydantic.Field(default=None)
63
68
  """
64
69
  The maximum number of characters in the response.
@@ -32,6 +32,11 @@ class ToolCreate(UncheckedBaseModel):
32
32
  The JSON schema of the function (auto-generated from source_code if not provided)
33
33
  """
34
34
 
35
+ args_json_schema: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
36
+ """
37
+ The args JSON schema of the function.
38
+ """
39
+
35
40
  return_char_limit: typing.Optional[int] = pydantic.Field(default=None)
36
41
  """
37
42
  The maximum number of characters in the response.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-client
3
- Version: 0.1.52
3
+ Version: 0.1.54
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers
@@ -1,5 +1,5 @@
1
- letta_client/__init__.py,sha256=bd8FHq-fZVf_PugqTtSZUPZoogZxcftmnDUhSK6rF54,55988
2
- letta_client/agents/__init__.py,sha256=KCn7wjwmY7PBtXQYfiFQPNtwPz5dPBB4A6V6V242U6w,22136
1
+ letta_client/__init__.py,sha256=gE-ZEiBn_82WiGeafvXwxQh49hjm0E16DPA5jB6s7L4,56520
2
+ letta_client/agents/__init__.py,sha256=dsO71a7KQVSsJkkd31kf6RwxZOeJzjhvJZRQBS7Mlws,22384
3
3
  letta_client/agents/blocks/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
4
4
  letta_client/agents/blocks/client.py,sha256=u5zvutxoH_DqfSLWhRtNSRBC9_ezQDx682cxkxDz3JA,23822
5
5
  letta_client/agents/client.py,sha256=YUFtT3ZBHyvUcK-IbAchSbYRJprGB9aR2eedNdI6r3g,73961
@@ -27,7 +27,7 @@ letta_client/agents/templates/types/templates_create_response.py,sha256=kKjkyjv3
27
27
  letta_client/agents/templates/types/templates_migrate_response.py,sha256=7N4JtAaiao-LrNdi72K7XB01uXJVkczaKYIJIMf0QYs,577
28
28
  letta_client/agents/tools/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
29
29
  letta_client/agents/tools/client.py,sha256=xZMRZhG8mI_h8_QqgI4lXh3FieRCLeoPwdtB56GB-XU,12685
30
- letta_client/agents/types/__init__.py,sha256=gEoXVmTXkszsd8VQa4faCWJpfv34XfKVrfTeKUJ7GDQ,35122
30
+ letta_client/agents/types/__init__.py,sha256=ZdlN4-20jl5QwidG5buunNvAR4dEJJiWNIV78WUvP1s,35535
31
31
  letta_client/agents/types/agents_search_request_search_item.py,sha256=9wZPvTP5ESFOhdF9YqdYwv4h_fEFF9TWbGtDO9xkrzA,494
32
32
  letta_client/agents/types/agents_search_request_search_item_field.py,sha256=06cbjgIRD2GL7Ck7ZYxLVNbrKP9HLHNOCi9DSPspATQ,692
33
33
  letta_client/agents/types/agents_search_request_search_item_one.py,sha256=ECWv-hDZen6AomM01zmRsOz0PlXVEwIwLHjid9yko9o,779
@@ -179,7 +179,9 @@ letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_too
179
179
  letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_tool_name_type.py,sha256=GqfaX_dRy4SiycejwBrxeAIx_dIVkbBXNt7aHxOEWNE,219
180
180
  letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_two.py,sha256=Q9tgiBxc7VlcuSyVGMs3CWzySOATi7sY6MbJGTX5ITU,816
181
181
  letta_client/agents/types/agents_search_response_agents_item_tool_rules_item_two_type.py,sha256=CyzuePl8LWsZY9Gv0W2eUOyfySzeP3mIpJ6ZkQY9GrQ,210
182
- letta_client/agents/types/agents_search_response_agents_item_tools_item.py,sha256=WmuypLAyH_I5HOVUfI3mp-Pg_-_7qBwCz2c2tdn_GlI,2670
182
+ letta_client/agents/types/agents_search_response_agents_item_tools_item.py,sha256=QxkYgQMxJlM-w11cM-dsywNjokoGNZx3YHdIyHpLBHU,2909
183
+ letta_client/agents/types/agents_search_response_agents_item_tools_item_args_json_schema.py,sha256=F5F6PybWw4A3N-JRdB_hO3LqxhyID4GDskY86PEBjAc,452
184
+ letta_client/agents/types/agents_search_response_agents_item_tools_item_args_json_schema_item.py,sha256=ZFyimyzbgEiMyspLV48oP2N2IfoYj09pMORG1V34tdU,210
183
185
  letta_client/agents/types/agents_search_response_agents_item_tools_item_created_by_id.py,sha256=AIpZrJ-JMYVyACTANXK_0xUK9clUmO0Q_z7ZYshAEDM,407
184
186
  letta_client/agents/types/agents_search_response_agents_item_tools_item_created_by_id_item.py,sha256=qxVxvRJzl77B1QHpnZa_Jtrn0uq3kVwTbm7FJYZ-Yak,177
185
187
  letta_client/agents/types/agents_search_response_agents_item_tools_item_description.py,sha256=a_CWZf55COj6fZ79Yi2W7MHEciC12I51J2yzFuaYUO0,405
@@ -204,10 +206,10 @@ letta_client/agents/types/update_agent_tool_rules_item.py,sha256=gCA9oFxIWEcbVV5
204
206
  letta_client/base_client.py,sha256=ZD62gkVcq-3piS6Az6L9yM9vD1kssEdtK3c0pHoRWMI,8395
205
207
  letta_client/blocks/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
206
208
  letta_client/blocks/client.py,sha256=AeQQ-IdYhV-zqLTt3PTrJOtJ6XtBZcXNC108Y5EogVU,29178
207
- letta_client/client.py,sha256=y2cXN0ApFul2Lz-fVh5TbeYbQ8oUjnXcwJ6wUczEf2c,2457
209
+ letta_client/client.py,sha256=xdSrD4IkWokZHujowd1r7zESBoVgKGNvo6RqgZ3f0Fg,12808
208
210
  letta_client/core/__init__.py,sha256=OKbX2aCZXgHCDUsCouqv-OiX32xA6eFFCKIUH9M5Vzk,1591
209
211
  letta_client/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
210
- letta_client/core/client_wrapper.py,sha256=ZPc7atU7jWOmovWkIFEF9Y6-j0YTsetvH0Od-DczE8c,1997
212
+ letta_client/core/client_wrapper.py,sha256=jIg6jkb0yX5-JmMNEd_l26MVdszs6wxY2UDbBauoiZM,1997
211
213
  letta_client/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
212
214
  letta_client/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
213
215
  letta_client/core/http_client.py,sha256=siUQ6UV0ARZALlxubqWSSAAPC9B4VW8y6MGlHStfaeo,19552
@@ -236,7 +238,7 @@ letta_client/providers/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAK
236
238
  letta_client/providers/client.py,sha256=RLpTHd9iQ5wlZqYEG4cF8YsDCdaQZ0odCFprukauCuc,18228
237
239
  letta_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
238
240
  letta_client/runs/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
239
- letta_client/runs/client.py,sha256=F4yTdhwAA20Ftjr9UZ9tU7wc209n1RNVdJkw42eiBqY,27330
241
+ letta_client/runs/client.py,sha256=fu6RNu6qkG5kOkT7rfIjeuHp_REW5ZGxNwzFqTmhb-o,34546
240
242
  letta_client/sources/__init__.py,sha256=kswgCv4UdkSVk1Y4tsMM1HadOwvhh_Fr96VTSMV4Umc,128
241
243
  letta_client/sources/client.py,sha256=GbMg3ZR0JufGPOfYiptr9yDWKJ0FgT6zLD_k6fET0zs,28223
242
244
  letta_client/sources/files/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
@@ -247,9 +249,9 @@ letta_client/steps/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_p
247
249
  letta_client/steps/client.py,sha256=nHd4ZxYeaVgYf9ZewBCLc58DZ38LoW97W-xbc2oOL_0,10900
248
250
  letta_client/tag/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
249
251
  letta_client/tag/client.py,sha256=TBAotdb0e2_x2pANF4dOE1qmWY3GIgb7nOhvN7iZ3_4,5183
250
- letta_client/templates/__init__.py,sha256=Ws3fkjWNdtC8J6O-kCo6VP7Y56svceHltvNolA0MuHM,23969
252
+ letta_client/templates/__init__.py,sha256=67hjKjA8ZYiqjIAHObdIQLVgtbMX7kb6RNaxOUkeQBw,24253
251
253
  letta_client/templates/client.py,sha256=CpU_STVhjt1Rto-COOBdX8Pw2GmgU7E1KgOnj92YLIg,6732
252
- letta_client/templates/types/__init__.py,sha256=tccRzwq41aUcw--4C1R8mfLmKpcSA0AK2M8NomrkEBs,39212
254
+ letta_client/templates/types/__init__.py,sha256=LGDzJg0Gv_Ewfq8plfFOvaD6K2cRLi21mii9xcS01NE,39681
253
255
  letta_client/templates/types/templates_create_agents_response.py,sha256=UNMZSUckqoug1sq-gqC7luO392eItxxy0NNdUL0CRfQ,725
254
256
  letta_client/templates/types/templates_create_agents_response_agents_item.py,sha256=xaEfez_Y4tIlVnCUXrtY9VgQ2XjodS0ua-9trsO9IJQ,5203
255
257
  letta_client/templates/types/templates_create_agents_response_agents_item_agent_type.py,sha256=667uXDfYpS48UZIiSpjdgY4xDcApSpW5viyc3T4eKjo,240
@@ -396,7 +398,9 @@ letta_client/templates/types/templates_create_agents_response_agents_item_tool_r
396
398
  letta_client/templates/types/templates_create_agents_response_agents_item_tool_rules_item_tool_name_type.py,sha256=PmfYArJ1VnR-o6BgPe6HT1ZyVuwoyleqvZj2tBiLuck,228
397
399
  letta_client/templates/types/templates_create_agents_response_agents_item_tool_rules_item_two.py,sha256=92ghfbOGPJorpWmRVqRjHj1iOewt04ayYYU4MHUsBaQ,853
398
400
  letta_client/templates/types/templates_create_agents_response_agents_item_tool_rules_item_two_type.py,sha256=v7ZgUb4BFSSQAYNTCNynDjJDykDZBI0ci-zh_cXp7gQ,219
399
- letta_client/templates/types/templates_create_agents_response_agents_item_tools_item.py,sha256=m_RGwjNhFI4smamFoOjBlZOR_zHfFrbkovQDZlKxK-k,2976
401
+ letta_client/templates/types/templates_create_agents_response_agents_item_tools_item.py,sha256=0tu_RyBhprIz8jjg0VgOeJk2IIz3sXpaRIWIxbK8meE,3243
402
+ letta_client/templates/types/templates_create_agents_response_agents_item_tools_item_args_json_schema.py,sha256=hkJC_gLl79RPZ02qgaiio9LEB_9b3mjpSAbLQ0V_y5c,489
403
+ letta_client/templates/types/templates_create_agents_response_agents_item_tools_item_args_json_schema_item.py,sha256=efURZILuxsz38tA_wUfX7WNyJn15AbHiQGbaR_6kDCI,219
400
404
  letta_client/templates/types/templates_create_agents_response_agents_item_tools_item_created_by_id.py,sha256=ZPuSHSH3WKPMiUprp8z6exaedH7Tuusf_7xzw6FBhhw,453
401
405
  letta_client/templates/types/templates_create_agents_response_agents_item_tools_item_created_by_id_item.py,sha256=YwDQDSCvSutUZ6CHkhGUt5gsOcMNn_k6r81J9o4HjuQ,186
402
406
  letta_client/templates/types/templates_create_agents_response_agents_item_tools_item_description.py,sha256=KGY0Vf9y5mZ8zr-NO7d6erjJMKxdKvLc2y0WQUOyuvg,451
@@ -417,7 +421,7 @@ letta_client/templates/types/templates_create_agents_response_agents_item_tools_
417
421
  letta_client/templates/types/templates_create_agents_response_agents_item_updated_at.py,sha256=Md7WfCTT1_AGvyd24EeWzUibPvnrun9rhyxqCLeAURg,439
418
422
  letta_client/templates/types/templates_create_agents_response_agents_item_updated_at_item.py,sha256=T3rYnv5m_cBAEPBnEjUkkHJLYtFZfXNMbb7a9FrIwKY,175
419
423
  letta_client/tools/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
420
- letta_client/tools/client.py,sha256=nv4PKwwlBsyGYm9B_3okgaiNFbbMYfZ53bzeoaAhVfU,53219
424
+ letta_client/tools/client.py,sha256=Oyds2HAtLITB0vGiSjAgJhv2EhJP_7JHj9X7zCAgJDk,55555
421
425
  letta_client/types/__init__.py,sha256=CHSYpc-2xTVN0WDFZQ_eQZrSyJ1029q5TXvAfVc5-Ug,15395
422
426
  letta_client/types/action_model.py,sha256=y1e2XMv3skFaNJIBdYoBKgiORzGh05aOVvu-qVR9uHg,1240
423
427
  letta_client/types/action_parameters_model.py,sha256=LgKf5aPZG3-OHGxFdXiSokIDgce8c02xPYIAY05VgW8,828
@@ -471,7 +475,7 @@ letta_client/types/completion_create_params_non_streaming.py,sha256=LxdYCY3Do6YG
471
475
  letta_client/types/completion_create_params_non_streaming_function_call.py,sha256=6iCjgXwsXnflllhfDDKtHRyxzKqtLcX6-HVr7AXlyUM,329
472
476
  letta_client/types/completion_create_params_non_streaming_messages_item.py,sha256=pKMxLh1XFgMl7LqcjKJmdeKYTCwlr3FLFPTuvaLf3D0,883
473
477
  letta_client/types/completion_create_params_non_streaming_modalities_item.py,sha256=BuyCf2nTCWVhishXFk3CsQphnPwNXj-kBdPMjkb8X10,189
474
- letta_client/types/completion_create_params_non_streaming_model.py,sha256=woKkqfEHdGBT4POjJO426eNkpjpebZLyckawJTWIC4U,1723
478
+ letta_client/types/completion_create_params_non_streaming_model.py,sha256=JQMvA_rMtJU-R4CUF_XZ3DusXAJlsKyQFXmSNlzX25E,1812
475
479
  letta_client/types/completion_create_params_non_streaming_reasoning_effort.py,sha256=f1hBX3qksGoGC6O2W5qHblCQXtoZiEhiN8LUy1Rv9Ig,198
476
480
  letta_client/types/completion_create_params_non_streaming_response_format.py,sha256=SLx41c9nW0xPHx5nRacWvFZ9IkkJOGwVvKUqIPRh0Pk,407
477
481
  letta_client/types/completion_create_params_non_streaming_service_tier.py,sha256=Tfw62WLF3WSHWZy8VOVXal1INDQNtZhoB8DSA0btJ0g,188
@@ -481,7 +485,7 @@ letta_client/types/completion_create_params_streaming.py,sha256=QquZF4KsKjhTsRM8
481
485
  letta_client/types/completion_create_params_streaming_function_call.py,sha256=cxsVe0wAIKPAsndL5vB_BCTy6oSxFph7qB1c1LWmeDw,326
482
486
  letta_client/types/completion_create_params_streaming_messages_item.py,sha256=S4E0fe3LgVyetb2PEqhGNxqMj5kgQx4q6Qk2bvvu2Ok,880
483
487
  letta_client/types/completion_create_params_streaming_modalities_item.py,sha256=o9ZU7r22WrE6z-BSJ72LJXHtVRIpK499WArVgY-ODgI,186
484
- letta_client/types/completion_create_params_streaming_model.py,sha256=Zk3iKIO6l_Z4TkVf25JFrfi2Di97IjW-sYymfBse0qI,1720
488
+ letta_client/types/completion_create_params_streaming_model.py,sha256=lh78LBkczh6p5by0FOpPkRh8-PbM4-dkZzlCmC7cDCc,1809
485
489
  letta_client/types/completion_create_params_streaming_reasoning_effort.py,sha256=4-JFyaD92zia-kN7bPyCWwf_AMDnG2xUXWx8GQU1EFE,195
486
490
  letta_client/types/completion_create_params_streaming_response_format.py,sha256=ES9DPjMIOAhVUK1V5wlZ4lrtBdDhDjD3de5BKQ7Nkss,404
487
491
  letta_client/types/completion_create_params_streaming_service_tier.py,sha256=chHakgbKOYCMtxdtGmP85rcjGkyOqt2S_JJ9SabSd-o,185
@@ -564,12 +568,12 @@ letta_client/types/system_message.py,sha256=DUIgPbL_ya49sGN15DIEGO2t8OQ4pseHvbMc
564
568
  letta_client/types/system_message_content.py,sha256=9VvwCUKMkNidcMUaPmuj6-WhzeJoEZCNvyn3oH-LR70,185
565
569
  letta_client/types/terminal_tool_rule.py,sha256=82a7AnohOqCFBSOt7OwsKeh7gHgq8KTlgojxlm3t76E,863
566
570
  letta_client/types/text_content.py,sha256=Z8UL4Sqqq2qClKU_nCgR9XFCj3dwYyhZMmvnnz1F0AE,670
567
- letta_client/types/tool.py,sha256=0D7w3mGizkqczT92dnueu_LGJg-9gDkO0PS5cnLnynQ,2335
571
+ letta_client/types/tool.py,sha256=xXKWpxfzUtw7OjLcjnil6GeFiVrFvk9gtaYHWUM-7AU,2510
568
572
  letta_client/types/tool_call.py,sha256=EKGAFwzoa6zMTpOkG55hWzFn_AgPrbLXSOu5M84x8WU,594
569
573
  letta_client/types/tool_call_delta.py,sha256=wGeZwJ9pwYHD5-f4Unf5-vJqefK40eHw9i0w3bCjRoE,671
570
574
  letta_client/types/tool_call_message.py,sha256=PQEYtLzNMmqc86q7kqjEuALvJ4HdAC_8ODIYjArsoco,1096
571
575
  letta_client/types/tool_call_message_tool_call.py,sha256=twtq5-vZIeh1nShqm8iTCN9YFtY7LUIL-bFYuUfhF1o,219
572
- letta_client/types/tool_create.py,sha256=OHG0RqVSLi7O_C_vhbo-1AN5FPCy-JTbDc0a88_Z5XE,1347
576
+ letta_client/types/tool_create.py,sha256=VSMd23Kkd77SPbLv2oRHEzXqR2Eexc0ervjxXYLHiqc,1522
573
577
  letta_client/types/tool_return_message.py,sha256=hQ-17bvNGoSaCow4AvWSGLTa80fKuXP2bxXGNUXuX0w,1591
574
578
  letta_client/types/tool_return_message_status.py,sha256=FvFOMaG9mnmgnHi2UBQVQQMtHFabbWnQnHTxGUDgVl0,167
575
579
  letta_client/types/tool_type.py,sha256=Br4Lk5nEsc8wcWP1leTqGPaYnNVWo4xMmoAksUTVqOA,271
@@ -586,6 +590,6 @@ letta_client/voice/__init__.py,sha256=ZrZEuXIukVGhsfM-i0dIFfqjeSOBMPeEgDva7Vvnip
586
590
  letta_client/voice/client.py,sha256=j3feSlNzeTVFXE7RUKEHGeMl_w0TJFBRUI3pXpLpUEI,6148
587
591
  letta_client/voice/types/__init__.py,sha256=hBLJcrom99DkDxxsVRU2ni8kPx6SsCy8gtAJvNOz26w,199
588
592
  letta_client/voice/types/create_voice_chat_completions_request.py,sha256=K4__83rXRCshfdobyAmH-5fUDJQ_PeSQetTUeC4Abk0,381
589
- letta_client-0.1.52.dist-info/METADATA,sha256=RxD7qudjGqemxw-YrcnK5PPjhd7oNyHHl-WdCm7eLTk,4942
590
- letta_client-0.1.52.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
591
- letta_client-0.1.52.dist-info/RECORD,,
593
+ letta_client-0.1.54.dist-info/METADATA,sha256=bW_vwYxfAnY-_zb45lt9yg3s6H2EPpIUYK77NsOpqxo,4942
594
+ letta_client-0.1.54.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
595
+ letta_client-0.1.54.dist-info/RECORD,,