@letta-ai/letta-client 1.6.1 → 1.6.3

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 (72) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/LICENSE +1 -1
  3. package/package.json +1 -1
  4. package/resources/agents/agents.d.mts +167 -11
  5. package/resources/agents/agents.d.mts.map +1 -1
  6. package/resources/agents/agents.d.ts +167 -11
  7. package/resources/agents/agents.d.ts.map +1 -1
  8. package/resources/agents/agents.js.map +1 -1
  9. package/resources/agents/agents.mjs.map +1 -1
  10. package/resources/agents/messages.d.mts +173 -1
  11. package/resources/agents/messages.d.mts.map +1 -1
  12. package/resources/agents/messages.d.ts +173 -1
  13. package/resources/agents/messages.d.ts.map +1 -1
  14. package/resources/batches/batches.d.mts +29 -0
  15. package/resources/batches/batches.d.mts.map +1 -1
  16. package/resources/batches/batches.d.ts +29 -0
  17. package/resources/batches/batches.d.ts.map +1 -1
  18. package/resources/batches/batches.js.map +1 -1
  19. package/resources/batches/batches.mjs.map +1 -1
  20. package/resources/blocks/blocks.d.mts +1 -1
  21. package/resources/blocks/blocks.d.ts +1 -1
  22. package/resources/folders/files.d.mts +87 -1
  23. package/resources/folders/files.d.mts.map +1 -1
  24. package/resources/folders/files.d.ts +87 -1
  25. package/resources/folders/files.d.ts.map +1 -1
  26. package/resources/folders/files.js +7 -0
  27. package/resources/folders/files.js.map +1 -1
  28. package/resources/folders/files.mjs +7 -0
  29. package/resources/folders/files.mjs.map +1 -1
  30. package/resources/folders/folders.d.mts +2 -2
  31. package/resources/folders/folders.d.mts.map +1 -1
  32. package/resources/folders/folders.d.ts +2 -2
  33. package/resources/folders/folders.d.ts.map +1 -1
  34. package/resources/folders/folders.js.map +1 -1
  35. package/resources/folders/folders.mjs.map +1 -1
  36. package/resources/folders/index.d.mts +1 -1
  37. package/resources/folders/index.d.mts.map +1 -1
  38. package/resources/folders/index.d.ts +1 -1
  39. package/resources/folders/index.d.ts.map +1 -1
  40. package/resources/folders/index.js.map +1 -1
  41. package/resources/folders/index.mjs.map +1 -1
  42. package/resources/groups/messages.d.mts +58 -0
  43. package/resources/groups/messages.d.mts.map +1 -1
  44. package/resources/groups/messages.d.ts +58 -0
  45. package/resources/groups/messages.d.ts.map +1 -1
  46. package/resources/models/models.d.mts +3 -3
  47. package/resources/models/models.d.mts.map +1 -1
  48. package/resources/models/models.d.ts +3 -3
  49. package/resources/models/models.d.ts.map +1 -1
  50. package/resources/models/models.js.map +1 -1
  51. package/resources/models/models.mjs.map +1 -1
  52. package/resources/steps/steps.d.mts +4 -0
  53. package/resources/steps/steps.d.mts.map +1 -1
  54. package/resources/steps/steps.d.ts +4 -0
  55. package/resources/steps/steps.d.ts.map +1 -1
  56. package/resources/steps/steps.js.map +1 -1
  57. package/resources/steps/steps.mjs.map +1 -1
  58. package/src/resources/agents/agents.ts +222 -6
  59. package/src/resources/agents/messages.ts +192 -0
  60. package/src/resources/batches/batches.ts +31 -0
  61. package/src/resources/blocks/blocks.ts +1 -1
  62. package/src/resources/folders/files.ts +114 -0
  63. package/src/resources/folders/folders.ts +4 -0
  64. package/src/resources/folders/index.ts +2 -0
  65. package/src/resources/groups/messages.ts +62 -0
  66. package/src/resources/models/models.ts +6 -3
  67. package/src/resources/steps/steps.ts +5 -0
  68. package/src/version.ts +1 -1
  69. package/version.d.mts +1 -1
  70. package/version.d.ts +1 -1
  71. package/version.js +1 -1
  72. package/version.mjs +1 -1
@@ -10,6 +10,18 @@ import { multipartFormRequestOptions } from '../../internal/uploads';
10
10
  import { path } from '../../internal/utils/path';
11
11
 
12
12
  export class Files extends APIResource {
13
+ /**
14
+ * Retrieve a file from a folder by ID.
15
+ */
16
+ retrieve(
17
+ fileID: string,
18
+ params: FileRetrieveParams,
19
+ options?: RequestOptions,
20
+ ): APIPromise<FileRetrieveResponse> {
21
+ const { folder_id, ...query } = params;
22
+ return this._client.get(path`/v1/folders/${folder_id}/files/${fileID}`, { query, ...options });
23
+ }
24
+
13
25
  /**
14
26
  * List paginated files associated with a data folder.
15
27
  */
@@ -53,6 +65,94 @@ export class Files extends APIResource {
53
65
 
54
66
  export type FileListResponsesArrayPage = ArrayPage<FileListResponse>;
55
67
 
68
+ /**
69
+ * Representation of a single FileMetadata
70
+ */
71
+ export interface FileRetrieveResponse {
72
+ /**
73
+ * The human-friendly ID of the File
74
+ */
75
+ id: string;
76
+
77
+ /**
78
+ * @deprecated Deprecated: Use `folder_id` field instead. The unique identifier of
79
+ * the source associated with the document.
80
+ */
81
+ source_id: string;
82
+
83
+ /**
84
+ * Number of chunks that have been embedded.
85
+ */
86
+ chunks_embedded?: number | null;
87
+
88
+ /**
89
+ * Optional full-text content of the file; only populated on demand due to its
90
+ * size.
91
+ */
92
+ content?: string | null;
93
+
94
+ /**
95
+ * The creation date of the file.
96
+ */
97
+ created_at?: string | null;
98
+
99
+ /**
100
+ * Optional error message if the file failed processing.
101
+ */
102
+ error_message?: string | null;
103
+
104
+ /**
105
+ * The creation date of the file.
106
+ */
107
+ file_creation_date?: string | null;
108
+
109
+ /**
110
+ * The last modified date of the file.
111
+ */
112
+ file_last_modified_date?: string | null;
113
+
114
+ /**
115
+ * The name of the file.
116
+ */
117
+ file_name?: string | null;
118
+
119
+ /**
120
+ * The path to the file.
121
+ */
122
+ file_path?: string | null;
123
+
124
+ /**
125
+ * The size of the file in bytes.
126
+ */
127
+ file_size?: number | null;
128
+
129
+ /**
130
+ * The type of the file (MIME type).
131
+ */
132
+ file_type?: string | null;
133
+
134
+ /**
135
+ * The original name of the file as uploaded.
136
+ */
137
+ original_file_name?: string | null;
138
+
139
+ /**
140
+ * The current processing status of the file (e.g. pending, parsing, embedding,
141
+ * completed, error).
142
+ */
143
+ processing_status?: 'pending' | 'parsing' | 'embedding' | 'completed' | 'error';
144
+
145
+ /**
146
+ * Total number of chunks for the file.
147
+ */
148
+ total_chunks?: number | null;
149
+
150
+ /**
151
+ * The update date of the file.
152
+ */
153
+ updated_at?: string | null;
154
+ }
155
+
56
156
  /**
57
157
  * Representation of a single FileMetadata
58
158
  */
@@ -229,6 +329,18 @@ export interface FileUploadResponse {
229
329
  updated_at?: string | null;
230
330
  }
231
331
 
332
+ export interface FileRetrieveParams {
333
+ /**
334
+ * Path param: The ID of the source in the format 'source-<uuid4>'
335
+ */
336
+ folder_id: string;
337
+
338
+ /**
339
+ * Query param: Whether to include full file content
340
+ */
341
+ include_content?: boolean;
342
+ }
343
+
232
344
  export interface FileListParams extends ArrayPageParams {
233
345
  /**
234
346
  * Whether to include full file content
@@ -262,9 +374,11 @@ export interface FileUploadParams {
262
374
 
263
375
  export declare namespace Files {
264
376
  export {
377
+ type FileRetrieveResponse as FileRetrieveResponse,
265
378
  type FileListResponse as FileListResponse,
266
379
  type FileUploadResponse as FileUploadResponse,
267
380
  type FileListResponsesArrayPage as FileListResponsesArrayPage,
381
+ type FileRetrieveParams as FileRetrieveParams,
268
382
  type FileListParams as FileListParams,
269
383
  type FileDeleteParams as FileDeleteParams,
270
384
  type FileUploadParams as FileUploadParams,
@@ -9,6 +9,8 @@ import {
9
9
  FileListParams,
10
10
  FileListResponse,
11
11
  FileListResponsesArrayPage,
12
+ FileRetrieveParams,
13
+ FileRetrieveResponse,
12
14
  FileUploadParams,
13
15
  FileUploadResponse,
14
16
  Files,
@@ -207,9 +209,11 @@ export declare namespace Folders {
207
209
 
208
210
  export {
209
211
  Files as Files,
212
+ type FileRetrieveResponse as FileRetrieveResponse,
210
213
  type FileListResponse as FileListResponse,
211
214
  type FileUploadResponse as FileUploadResponse,
212
215
  type FileListResponsesArrayPage as FileListResponsesArrayPage,
216
+ type FileRetrieveParams as FileRetrieveParams,
213
217
  type FileListParams as FileListParams,
214
218
  type FileDeleteParams as FileDeleteParams,
215
219
  type FileUploadParams as FileUploadParams,
@@ -3,8 +3,10 @@
3
3
  export { Agents, type AgentListResponse, type AgentListParams } from './agents';
4
4
  export {
5
5
  Files,
6
+ type FileRetrieveResponse,
6
7
  type FileListResponse,
7
8
  type FileUploadResponse,
9
+ type FileRetrieveParams,
8
10
  type FileListParams,
9
11
  type FileDeleteParams,
10
12
  type FileUploadParams,
@@ -116,6 +116,13 @@ export interface MessageCreateParams {
116
116
  */
117
117
  assistant_message_tool_name?: string;
118
118
 
119
+ /**
120
+ * Client-side tools that the agent can call. When the agent calls a client-side
121
+ * tool, execution pauses and returns control to the client to execute the tool and
122
+ * provide the result via a ToolReturn.
123
+ */
124
+ client_tools?: Array<MessageCreateParams.ClientTool> | null;
125
+
119
126
  /**
120
127
  * @deprecated If set to True, enables reasoning before responses or tool calls
121
128
  * from the agent.
@@ -165,6 +172,30 @@ export interface MessageCreateParams {
165
172
  }
166
173
 
167
174
  export namespace MessageCreateParams {
175
+ /**
176
+ * Schema for a client-side tool passed in the request.
177
+ *
178
+ * Client-side tools are executed by the client, not the server. When the agent
179
+ * calls a client-side tool, execution pauses and returns control to the client to
180
+ * execute the tool and provide the result.
181
+ */
182
+ export interface ClientTool {
183
+ /**
184
+ * The name of the tool function
185
+ */
186
+ name: string;
187
+
188
+ /**
189
+ * Description of what the tool does
190
+ */
191
+ description?: string | null;
192
+
193
+ /**
194
+ * JSON Schema for the function parameters
195
+ */
196
+ parameters?: { [key: string]: unknown } | null;
197
+ }
198
+
168
199
  /**
169
200
  * The style of reasoning content returned by the OpenAI Responses API
170
201
  */
@@ -321,6 +352,13 @@ export interface MessageStreamParams {
321
352
  */
322
353
  background?: boolean;
323
354
 
355
+ /**
356
+ * Client-side tools that the agent can call. When the agent calls a client-side
357
+ * tool, execution pauses and returns control to the client to execute the tool and
358
+ * provide the result via a ToolReturn.
359
+ */
360
+ client_tools?: Array<MessageStreamParams.ClientTool> | null;
361
+
324
362
  /**
325
363
  * @deprecated If set to True, enables reasoning before responses or tool calls
326
364
  * from the agent.
@@ -388,6 +426,30 @@ export interface MessageStreamParams {
388
426
  }
389
427
 
390
428
  export namespace MessageStreamParams {
429
+ /**
430
+ * Schema for a client-side tool passed in the request.
431
+ *
432
+ * Client-side tools are executed by the client, not the server. When the agent
433
+ * calls a client-side tool, execution pauses and returns control to the client to
434
+ * execute the tool and provide the result.
435
+ */
436
+ export interface ClientTool {
437
+ /**
438
+ * The name of the tool function
439
+ */
440
+ name: string;
441
+
442
+ /**
443
+ * Description of what the tool does
444
+ */
445
+ description?: string | null;
446
+
447
+ /**
448
+ * JSON Schema for the function parameters
449
+ */
450
+ parameters?: { [key: string]: unknown } | null;
451
+ }
452
+
391
453
  /**
392
454
  * The style of reasoning content returned by the OpenAI Responses API
393
455
  */
@@ -240,7 +240,8 @@ export interface LlmConfig {
240
240
  | 'together'
241
241
  | 'bedrock'
242
242
  | 'deepseek'
243
- | 'xai';
243
+ | 'xai'
244
+ | 'zai';
244
245
 
245
246
  /**
246
247
  * The framework compatibility type for the model.
@@ -396,7 +397,8 @@ export interface Model {
396
397
  | 'together'
397
398
  | 'bedrock'
398
399
  | 'deepseek'
399
- | 'xai';
400
+ | 'xai'
401
+ | 'zai';
400
402
 
401
403
  /**
402
404
  * The actual model name used by the provider
@@ -538,7 +540,8 @@ export type ProviderType =
538
540
  | 'openai'
539
541
  | 'together'
540
542
  | 'vllm'
541
- | 'xai';
543
+ | 'xai'
544
+ | 'zai';
542
545
 
543
546
  export type ModelListResponse = Array<Model>;
544
547
 
@@ -187,6 +187,11 @@ export interface Step {
187
187
  */
188
188
  provider_name?: string | null;
189
189
 
190
+ /**
191
+ * The API request log ID from cloud-api for correlating steps with API requests.
192
+ */
193
+ request_id?: string | null;
194
+
190
195
  /**
191
196
  * The unique identifier of the run that this step belongs to. Only included for
192
197
  * async calls.
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.6.1'; // x-release-please-version
1
+ export const VERSION = '1.6.3'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.6.1";
1
+ export declare const VERSION = "1.6.3";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.6.1";
1
+ export declare const VERSION = "1.6.3";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.6.1'; // x-release-please-version
4
+ exports.VERSION = '1.6.3'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.6.1'; // x-release-please-version
1
+ export const VERSION = '1.6.3'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map