@letta-ai/letta-client 1.0.0-alpha.17 → 1.0.0-alpha.19
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.
- package/CHANGELOG.md +35 -0
- package/README.md +5 -15
- package/client.d.mts +20 -20
- package/client.d.mts.map +1 -1
- package/client.d.ts +20 -20
- package/client.d.ts.map +1 -1
- package/client.js +29 -23
- package/client.js.map +1 -1
- package/client.mjs +29 -23
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents/agents.d.mts +319 -935
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +319 -935
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js +12 -4
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +12 -4
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/archives.d.mts +31 -0
- package/resources/agents/archives.d.mts.map +1 -0
- package/resources/agents/archives.d.ts +31 -0
- package/resources/agents/archives.d.ts.map +1 -0
- package/resources/agents/archives.js +24 -0
- package/resources/agents/archives.js.map +1 -0
- package/resources/agents/archives.mjs +20 -0
- package/resources/agents/archives.mjs.map +1 -0
- package/resources/agents/folders.d.mts +1 -1
- package/resources/agents/folders.d.mts.map +1 -1
- package/resources/agents/folders.d.ts +1 -1
- package/resources/agents/folders.d.ts.map +1 -1
- package/resources/agents/identities.d.mts +31 -0
- package/resources/agents/identities.d.mts.map +1 -0
- package/resources/agents/identities.d.ts +31 -0
- package/resources/agents/identities.d.ts.map +1 -0
- package/resources/agents/identities.js +24 -0
- package/resources/agents/identities.js.map +1 -0
- package/resources/agents/identities.mjs +20 -0
- package/resources/agents/identities.mjs.map +1 -0
- package/resources/agents/index.d.mts +4 -2
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +4 -2
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js +5 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs +2 -0
- package/resources/agents/index.mjs.map +1 -1
- package/resources/agents/messages.d.mts +244 -284
- package/resources/agents/messages.d.mts.map +1 -1
- package/resources/agents/messages.d.ts +244 -284
- package/resources/agents/messages.d.ts.map +1 -1
- package/resources/agents/messages.js.map +1 -1
- package/resources/agents/messages.mjs.map +1 -1
- package/resources/archives/archives.d.mts +111 -0
- package/resources/archives/archives.d.mts.map +1 -0
- package/resources/archives/archives.d.ts +111 -0
- package/resources/archives/archives.d.ts.map +1 -0
- package/resources/archives/archives.js +50 -0
- package/resources/archives/archives.js.map +1 -0
- package/resources/archives/archives.mjs +45 -0
- package/resources/archives/archives.mjs.map +1 -0
- package/resources/archives/index.d.mts +3 -0
- package/resources/archives/index.d.mts.map +1 -0
- package/resources/archives/index.d.ts +3 -0
- package/resources/archives/index.d.ts.map +1 -0
- package/resources/archives/index.js +9 -0
- package/resources/archives/index.js.map +1 -0
- package/resources/archives/index.mjs +4 -0
- package/resources/archives/index.mjs.map +1 -0
- package/resources/archives/passages.d.mts +112 -0
- package/resources/archives/passages.d.mts.map +1 -0
- package/resources/archives/passages.d.ts +112 -0
- package/resources/archives/passages.d.ts.map +1 -0
- package/resources/archives/passages.js +32 -0
- package/resources/archives/passages.js.map +1 -0
- package/resources/archives/passages.mjs +28 -0
- package/resources/archives/passages.mjs.map +1 -0
- package/resources/archives.d.mts +1 -106
- package/resources/archives.d.mts.map +1 -1
- package/resources/archives.d.ts +1 -106
- package/resources/archives.d.ts.map +1 -1
- package/resources/archives.js +2 -38
- package/resources/archives.js.map +1 -1
- package/resources/archives.mjs +1 -36
- package/resources/archives.mjs.map +1 -1
- package/resources/batches/messages.d.mts +3 -3
- package/resources/batches/messages.d.mts.map +1 -1
- package/resources/batches/messages.d.ts +3 -3
- package/resources/batches/messages.d.ts.map +1 -1
- package/resources/batches/messages.js.map +1 -1
- package/resources/batches/messages.mjs.map +1 -1
- package/resources/groups/messages.d.mts +3 -3
- package/resources/groups/messages.d.mts.map +1 -1
- package/resources/groups/messages.d.ts +3 -3
- package/resources/groups/messages.d.ts.map +1 -1
- package/resources/groups/messages.js +4 -1
- package/resources/groups/messages.js.map +1 -1
- package/resources/groups/messages.mjs +4 -1
- package/resources/groups/messages.mjs.map +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/runs/messages.d.mts +3 -3
- package/resources/runs/messages.d.mts.map +1 -1
- package/resources/runs/messages.d.ts +3 -3
- package/resources/runs/messages.d.ts.map +1 -1
- package/resources/runs/messages.js +4 -1
- package/resources/runs/messages.js.map +1 -1
- package/resources/runs/messages.mjs +4 -1
- package/resources/runs/messages.mjs.map +1 -1
- package/resources/steps/steps.d.mts +1 -1
- package/resources/steps/steps.d.mts.map +1 -1
- package/resources/steps/steps.d.ts +1 -1
- package/resources/steps/steps.d.ts.map +1 -1
- package/src/client.ts +156 -130
- package/src/resources/agents/agents.ts +721 -1527
- package/src/resources/agents/archives.ts +51 -0
- package/src/resources/agents/folders.ts +1 -1
- package/src/resources/agents/identities.ts +51 -0
- package/src/resources/agents/index.ts +28 -3
- package/src/resources/agents/messages.ts +377 -424
- package/src/resources/archives/archives.ts +165 -0
- package/src/resources/archives/index.ts +17 -0
- package/src/resources/archives/passages.ts +149 -0
- package/src/resources/archives.ts +1 -150
- package/src/resources/batches/messages.ts +4 -4
- package/src/resources/groups/messages.ts +7 -8
- package/src/resources/index.ts +11 -1
- package/src/resources/runs/messages.ts +7 -8
- package/src/resources/steps/steps.ts +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -11,7 +11,7 @@ export declare class Messages extends APIResource {
|
|
|
11
11
|
/**
|
|
12
12
|
* Retrieve message history for an agent.
|
|
13
13
|
*/
|
|
14
|
-
list(agentID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<
|
|
14
|
+
list(agentID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesArrayPage, Message>;
|
|
15
15
|
/**
|
|
16
16
|
* Cancel runs associated with an agent. If run_ids are passed in, cancel those in
|
|
17
17
|
* particular.
|
|
@@ -66,9 +66,9 @@ export declare class Messages extends APIResource {
|
|
|
66
66
|
*/
|
|
67
67
|
summarize(agentID: string, options?: RequestOptions): APIPromise<void>;
|
|
68
68
|
}
|
|
69
|
-
export type
|
|
69
|
+
export type MessagesArrayPage = ArrayPage<Message>;
|
|
70
70
|
export type RunsArrayPage = ArrayPage<Run>;
|
|
71
|
-
export type
|
|
71
|
+
export type InternalMessagesObjectPage = ObjectPage<InternalMessage>;
|
|
72
72
|
/**
|
|
73
73
|
* Input to approve or deny a tool call request
|
|
74
74
|
*/
|
|
@@ -80,7 +80,7 @@ export interface ApprovalCreate {
|
|
|
80
80
|
/**
|
|
81
81
|
* The list of approval responses
|
|
82
82
|
*/
|
|
83
|
-
approvals?: Array<
|
|
83
|
+
approvals?: Array<ApprovalReturn | ToolReturn> | null;
|
|
84
84
|
/**
|
|
85
85
|
* @deprecated Whether the tool has been approved
|
|
86
86
|
*/
|
|
@@ -98,26 +98,6 @@ export interface ApprovalCreate {
|
|
|
98
98
|
*/
|
|
99
99
|
type?: 'approval';
|
|
100
100
|
}
|
|
101
|
-
export declare namespace ApprovalCreate {
|
|
102
|
-
interface ApprovalReturn {
|
|
103
|
-
/**
|
|
104
|
-
* Whether the tool has been approved
|
|
105
|
-
*/
|
|
106
|
-
approve: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* The ID of the tool call that corresponds to this approval
|
|
109
|
-
*/
|
|
110
|
-
tool_call_id: string;
|
|
111
|
-
/**
|
|
112
|
-
* An optional explanation for the provided approval status
|
|
113
|
-
*/
|
|
114
|
-
reason?: string | null;
|
|
115
|
-
/**
|
|
116
|
-
* The message type to be created.
|
|
117
|
-
*/
|
|
118
|
-
type?: 'approval';
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
101
|
/**
|
|
122
102
|
* A message representing a request for approval to call a tool (generated by the
|
|
123
103
|
* LLM to trigger tool execution).
|
|
@@ -170,7 +150,7 @@ export interface ApprovalResponseMessage {
|
|
|
170
150
|
/**
|
|
171
151
|
* The list of approval responses
|
|
172
152
|
*/
|
|
173
|
-
approvals?: Array<
|
|
153
|
+
approvals?: Array<ApprovalReturn | ToolReturn> | null;
|
|
174
154
|
/**
|
|
175
155
|
* @deprecated Whether the tool has been approved
|
|
176
156
|
*/
|
|
@@ -191,25 +171,23 @@ export interface ApprovalResponseMessage {
|
|
|
191
171
|
seq_id?: number | null;
|
|
192
172
|
step_id?: string | null;
|
|
193
173
|
}
|
|
194
|
-
export
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
type?: 'approval';
|
|
212
|
-
}
|
|
174
|
+
export interface ApprovalReturn {
|
|
175
|
+
/**
|
|
176
|
+
* Whether the tool has been approved
|
|
177
|
+
*/
|
|
178
|
+
approve: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* The ID of the tool call that corresponds to this approval
|
|
181
|
+
*/
|
|
182
|
+
tool_call_id: string;
|
|
183
|
+
/**
|
|
184
|
+
* An optional explanation for the provided approval status
|
|
185
|
+
*/
|
|
186
|
+
reason?: string | null;
|
|
187
|
+
/**
|
|
188
|
+
* The message type to be created.
|
|
189
|
+
*/
|
|
190
|
+
type?: 'approval';
|
|
213
191
|
}
|
|
214
192
|
/**
|
|
215
193
|
* A message sent by the LLM in response to user input. Used in the LLM context.
|
|
@@ -350,6 +328,220 @@ export declare namespace ImageContent {
|
|
|
350
328
|
type?: 'letta';
|
|
351
329
|
}
|
|
352
330
|
}
|
|
331
|
+
/**
|
|
332
|
+
* Letta's internal representation of a message. Includes methods to convert to/from LLM provider formats.
|
|
333
|
+
*
|
|
334
|
+
* Attributes:
|
|
335
|
+
* id (str): The unique identifier of the message.
|
|
336
|
+
* role (MessageRole): The role of the participant.
|
|
337
|
+
* text (str): The text of the message.
|
|
338
|
+
* user_id (str): The unique identifier of the user.
|
|
339
|
+
* agent_id (str): The unique identifier of the agent.
|
|
340
|
+
* model (str): The model used to make the function call.
|
|
341
|
+
* name (str): The name of the participant.
|
|
342
|
+
* created_at (datetime): The time the message was created.
|
|
343
|
+
* tool_calls (List[OpenAIToolCall,]): The list of tool calls requested.
|
|
344
|
+
* tool_call_id (str): The id of the tool call.
|
|
345
|
+
* step_id (str): The id of the step that this message was created in.
|
|
346
|
+
* otid (str): The offline threading id associated with this message.
|
|
347
|
+
* tool_returns (List[ToolReturn]): The list of tool returns requested.
|
|
348
|
+
* group_id (str): The multi-agent group that the message was sent in.
|
|
349
|
+
* sender_id (str): The id of the sender of the message, can be an identity id or agent id.
|
|
350
|
+
*
|
|
351
|
+
* t
|
|
352
|
+
*/
|
|
353
|
+
export interface InternalMessage {
|
|
354
|
+
/**
|
|
355
|
+
* The human-friendly ID of the Message
|
|
356
|
+
*/
|
|
357
|
+
id: string;
|
|
358
|
+
/**
|
|
359
|
+
* The role of the participant.
|
|
360
|
+
*/
|
|
361
|
+
role: MessageRole;
|
|
362
|
+
/**
|
|
363
|
+
* The unique identifier of the agent.
|
|
364
|
+
*/
|
|
365
|
+
agent_id?: string | null;
|
|
366
|
+
/**
|
|
367
|
+
* The id of the approval request if this message is associated with a tool call
|
|
368
|
+
* request.
|
|
369
|
+
*/
|
|
370
|
+
approval_request_id?: string | null;
|
|
371
|
+
/**
|
|
372
|
+
* The list of approvals for this message.
|
|
373
|
+
*/
|
|
374
|
+
approvals?: Array<ApprovalReturn | InternalMessage.LettaSchemasMessageToolReturn> | null;
|
|
375
|
+
/**
|
|
376
|
+
* Whether tool call is approved.
|
|
377
|
+
*/
|
|
378
|
+
approve?: boolean | null;
|
|
379
|
+
/**
|
|
380
|
+
* The id of the LLMBatchItem that this message is associated with
|
|
381
|
+
*/
|
|
382
|
+
batch_item_id?: string | null;
|
|
383
|
+
/**
|
|
384
|
+
* The content of the message.
|
|
385
|
+
*/
|
|
386
|
+
content?: Array<TextContent | ImageContent | ToolCallContent | ToolReturnContent | ReasoningContent | RedactedReasoningContent | OmittedReasoningContent | InternalMessage.SummarizedReasoningContent> | null;
|
|
387
|
+
/**
|
|
388
|
+
* The timestamp when the object was created.
|
|
389
|
+
*/
|
|
390
|
+
created_at?: string;
|
|
391
|
+
/**
|
|
392
|
+
* The id of the user that made this object.
|
|
393
|
+
*/
|
|
394
|
+
created_by_id?: string | null;
|
|
395
|
+
/**
|
|
396
|
+
* The reason the tool call request was denied.
|
|
397
|
+
*/
|
|
398
|
+
denial_reason?: string | null;
|
|
399
|
+
/**
|
|
400
|
+
* The multi-agent group that the message was sent in
|
|
401
|
+
*/
|
|
402
|
+
group_id?: string | null;
|
|
403
|
+
/**
|
|
404
|
+
* Whether this message is part of an error step. Used only for debugging purposes.
|
|
405
|
+
*/
|
|
406
|
+
is_err?: boolean | null;
|
|
407
|
+
/**
|
|
408
|
+
* The id of the user that made this object.
|
|
409
|
+
*/
|
|
410
|
+
last_updated_by_id?: string | null;
|
|
411
|
+
/**
|
|
412
|
+
* The model used to make the function call.
|
|
413
|
+
*/
|
|
414
|
+
model?: string | null;
|
|
415
|
+
/**
|
|
416
|
+
* For role user/assistant: the (optional) name of the participant. For role
|
|
417
|
+
* tool/function: the name of the function called.
|
|
418
|
+
*/
|
|
419
|
+
name?: string | null;
|
|
420
|
+
/**
|
|
421
|
+
* The offline threading id associated with this message
|
|
422
|
+
*/
|
|
423
|
+
otid?: string | null;
|
|
424
|
+
/**
|
|
425
|
+
* The id of the run that this message was created in.
|
|
426
|
+
*/
|
|
427
|
+
run_id?: string | null;
|
|
428
|
+
/**
|
|
429
|
+
* The id of the sender of the message, can be an identity id or agent id
|
|
430
|
+
*/
|
|
431
|
+
sender_id?: string | null;
|
|
432
|
+
/**
|
|
433
|
+
* The id of the step that this message was created in.
|
|
434
|
+
*/
|
|
435
|
+
step_id?: string | null;
|
|
436
|
+
/**
|
|
437
|
+
* The ID of the tool call. Only applicable for role tool.
|
|
438
|
+
*/
|
|
439
|
+
tool_call_id?: string | null;
|
|
440
|
+
/**
|
|
441
|
+
* The list of tool calls requested. Only applicable for role assistant.
|
|
442
|
+
*/
|
|
443
|
+
tool_calls?: Array<InternalMessage.ToolCall> | null;
|
|
444
|
+
/**
|
|
445
|
+
* Tool execution return information for prior tool calls
|
|
446
|
+
*/
|
|
447
|
+
tool_returns?: Array<InternalMessage.ToolReturn> | null;
|
|
448
|
+
/**
|
|
449
|
+
* The timestamp when the object was last updated.
|
|
450
|
+
*/
|
|
451
|
+
updated_at?: string | null;
|
|
452
|
+
}
|
|
453
|
+
export declare namespace InternalMessage {
|
|
454
|
+
interface LettaSchemasMessageToolReturn {
|
|
455
|
+
/**
|
|
456
|
+
* The status of the tool call
|
|
457
|
+
*/
|
|
458
|
+
status: 'success' | 'error';
|
|
459
|
+
/**
|
|
460
|
+
* The function response string
|
|
461
|
+
*/
|
|
462
|
+
func_response?: string | null;
|
|
463
|
+
/**
|
|
464
|
+
* Captured stderr from the tool invocation
|
|
465
|
+
*/
|
|
466
|
+
stderr?: Array<string> | null;
|
|
467
|
+
/**
|
|
468
|
+
* Captured stdout (e.g. prints, logs) from the tool invocation
|
|
469
|
+
*/
|
|
470
|
+
stdout?: Array<string> | null;
|
|
471
|
+
/**
|
|
472
|
+
* The ID for the tool call
|
|
473
|
+
*/
|
|
474
|
+
tool_call_id?: unknown;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* The style of reasoning content returned by the OpenAI Responses API
|
|
478
|
+
*/
|
|
479
|
+
interface SummarizedReasoningContent {
|
|
480
|
+
/**
|
|
481
|
+
* The unique identifier for this reasoning step.
|
|
482
|
+
*/
|
|
483
|
+
id: string;
|
|
484
|
+
/**
|
|
485
|
+
* Summaries of the reasoning content.
|
|
486
|
+
*/
|
|
487
|
+
summary: Array<SummarizedReasoningContent.Summary>;
|
|
488
|
+
/**
|
|
489
|
+
* The encrypted reasoning content.
|
|
490
|
+
*/
|
|
491
|
+
encrypted_content?: string;
|
|
492
|
+
/**
|
|
493
|
+
* Indicates this is a summarized reasoning step.
|
|
494
|
+
*/
|
|
495
|
+
type?: 'summarized_reasoning';
|
|
496
|
+
}
|
|
497
|
+
namespace SummarizedReasoningContent {
|
|
498
|
+
interface Summary {
|
|
499
|
+
/**
|
|
500
|
+
* The index of the summary part.
|
|
501
|
+
*/
|
|
502
|
+
index: number;
|
|
503
|
+
/**
|
|
504
|
+
* The text of the summary part.
|
|
505
|
+
*/
|
|
506
|
+
text: string;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
interface ToolCall {
|
|
510
|
+
id: string;
|
|
511
|
+
function: ToolCall.Function;
|
|
512
|
+
type: 'function';
|
|
513
|
+
[k: string]: unknown;
|
|
514
|
+
}
|
|
515
|
+
namespace ToolCall {
|
|
516
|
+
interface Function {
|
|
517
|
+
arguments: string;
|
|
518
|
+
name: string;
|
|
519
|
+
[k: string]: unknown;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
interface ToolReturn {
|
|
523
|
+
/**
|
|
524
|
+
* The status of the tool call
|
|
525
|
+
*/
|
|
526
|
+
status: 'success' | 'error';
|
|
527
|
+
/**
|
|
528
|
+
* The function response string
|
|
529
|
+
*/
|
|
530
|
+
func_response?: string | null;
|
|
531
|
+
/**
|
|
532
|
+
* Captured stderr from the tool invocation
|
|
533
|
+
*/
|
|
534
|
+
stderr?: Array<string> | null;
|
|
535
|
+
/**
|
|
536
|
+
* Captured stdout (e.g. prints, logs) from the tool invocation
|
|
537
|
+
*/
|
|
538
|
+
stdout?: Array<string> | null;
|
|
539
|
+
/**
|
|
540
|
+
* The ID for the tool call
|
|
541
|
+
*/
|
|
542
|
+
tool_call_id?: unknown;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
353
545
|
/**
|
|
354
546
|
* Status of the job.
|
|
355
547
|
*/
|
|
@@ -369,15 +561,6 @@ export interface LettaAssistantMessageContentUnion {
|
|
|
369
561
|
*/
|
|
370
562
|
type?: 'text';
|
|
371
563
|
}
|
|
372
|
-
/**
|
|
373
|
-
* A message generated by the system. Never streamed back on a response, only used
|
|
374
|
-
* for cursor pagination.
|
|
375
|
-
*
|
|
376
|
-
* Args: id (str): The ID of the message date (datetime): The date the message was
|
|
377
|
-
* created in ISO format name (Optional[str]): The name of the sender of the
|
|
378
|
-
* message content (str): The message content sent by the system
|
|
379
|
-
*/
|
|
380
|
-
export type LettaMessageUnion = SystemMessage | UserMessage | ReasoningMessage | HiddenReasoningMessage | ToolCallMessage | ToolsAPI.ToolReturnMessage | AssistantMessage | ApprovalRequestMessage | ApprovalResponseMessage | SummaryMessage | EventMessage;
|
|
381
564
|
export interface LettaRequest {
|
|
382
565
|
/**
|
|
383
566
|
* @deprecated The name of the message argument in the designated message tool.
|
|
@@ -468,7 +651,7 @@ export interface LettaResponse {
|
|
|
468
651
|
/**
|
|
469
652
|
* The messages returned by the agent.
|
|
470
653
|
*/
|
|
471
|
-
messages: Array<
|
|
654
|
+
messages: Array<Message>;
|
|
472
655
|
/**
|
|
473
656
|
* The stop reason from Letta indicating why agent loop stopped execution.
|
|
474
657
|
*/
|
|
@@ -679,237 +862,14 @@ export declare namespace LettaStreamingResponse {
|
|
|
679
862
|
}
|
|
680
863
|
export type LettaUserMessageContentUnion = TextContent | ImageContent;
|
|
681
864
|
/**
|
|
682
|
-
*
|
|
683
|
-
*
|
|
684
|
-
* Attributes:
|
|
685
|
-
* id (str): The unique identifier of the message.
|
|
686
|
-
* role (MessageRole): The role of the participant.
|
|
687
|
-
* text (str): The text of the message.
|
|
688
|
-
* user_id (str): The unique identifier of the user.
|
|
689
|
-
* agent_id (str): The unique identifier of the agent.
|
|
690
|
-
* model (str): The model used to make the function call.
|
|
691
|
-
* name (str): The name of the participant.
|
|
692
|
-
* created_at (datetime): The time the message was created.
|
|
693
|
-
* tool_calls (List[OpenAIToolCall,]): The list of tool calls requested.
|
|
694
|
-
* tool_call_id (str): The id of the tool call.
|
|
695
|
-
* step_id (str): The id of the step that this message was created in.
|
|
696
|
-
* otid (str): The offline threading id associated with this message.
|
|
697
|
-
* tool_returns (List[ToolReturn]): The list of tool returns requested.
|
|
698
|
-
* group_id (str): The multi-agent group that the message was sent in.
|
|
699
|
-
* sender_id (str): The id of the sender of the message, can be an identity id or agent id.
|
|
865
|
+
* A message generated by the system. Never streamed back on a response, only used
|
|
866
|
+
* for cursor pagination.
|
|
700
867
|
*
|
|
701
|
-
*
|
|
868
|
+
* Args: id (str): The ID of the message date (datetime): The date the message was
|
|
869
|
+
* created in ISO format name (Optional[str]): The name of the sender of the
|
|
870
|
+
* message content (str): The message content sent by the system
|
|
702
871
|
*/
|
|
703
|
-
export
|
|
704
|
-
/**
|
|
705
|
-
* The human-friendly ID of the Message
|
|
706
|
-
*/
|
|
707
|
-
id: string;
|
|
708
|
-
/**
|
|
709
|
-
* The role of the participant.
|
|
710
|
-
*/
|
|
711
|
-
role: MessageRole;
|
|
712
|
-
/**
|
|
713
|
-
* The unique identifier of the agent.
|
|
714
|
-
*/
|
|
715
|
-
agent_id?: string | null;
|
|
716
|
-
/**
|
|
717
|
-
* The id of the approval request if this message is associated with a tool call
|
|
718
|
-
* request.
|
|
719
|
-
*/
|
|
720
|
-
approval_request_id?: string | null;
|
|
721
|
-
/**
|
|
722
|
-
* The list of approvals for this message.
|
|
723
|
-
*/
|
|
724
|
-
approvals?: Array<Message.ApprovalReturn | Message.LettaSchemasMessageToolReturn> | null;
|
|
725
|
-
/**
|
|
726
|
-
* Whether tool call is approved.
|
|
727
|
-
*/
|
|
728
|
-
approve?: boolean | null;
|
|
729
|
-
/**
|
|
730
|
-
* The id of the LLMBatchItem that this message is associated with
|
|
731
|
-
*/
|
|
732
|
-
batch_item_id?: string | null;
|
|
733
|
-
/**
|
|
734
|
-
* The content of the message.
|
|
735
|
-
*/
|
|
736
|
-
content?: Array<TextContent | ImageContent | ToolCallContent | ToolReturnContent | ReasoningContent | RedactedReasoningContent | OmittedReasoningContent | Message.SummarizedReasoningContent> | null;
|
|
737
|
-
/**
|
|
738
|
-
* The timestamp when the object was created.
|
|
739
|
-
*/
|
|
740
|
-
created_at?: string;
|
|
741
|
-
/**
|
|
742
|
-
* The id of the user that made this object.
|
|
743
|
-
*/
|
|
744
|
-
created_by_id?: string | null;
|
|
745
|
-
/**
|
|
746
|
-
* The reason the tool call request was denied.
|
|
747
|
-
*/
|
|
748
|
-
denial_reason?: string | null;
|
|
749
|
-
/**
|
|
750
|
-
* The multi-agent group that the message was sent in
|
|
751
|
-
*/
|
|
752
|
-
group_id?: string | null;
|
|
753
|
-
/**
|
|
754
|
-
* Whether this message is part of an error step. Used only for debugging purposes.
|
|
755
|
-
*/
|
|
756
|
-
is_err?: boolean | null;
|
|
757
|
-
/**
|
|
758
|
-
* The id of the user that made this object.
|
|
759
|
-
*/
|
|
760
|
-
last_updated_by_id?: string | null;
|
|
761
|
-
/**
|
|
762
|
-
* The model used to make the function call.
|
|
763
|
-
*/
|
|
764
|
-
model?: string | null;
|
|
765
|
-
/**
|
|
766
|
-
* For role user/assistant: the (optional) name of the participant. For role
|
|
767
|
-
* tool/function: the name of the function called.
|
|
768
|
-
*/
|
|
769
|
-
name?: string | null;
|
|
770
|
-
/**
|
|
771
|
-
* The offline threading id associated with this message
|
|
772
|
-
*/
|
|
773
|
-
otid?: string | null;
|
|
774
|
-
/**
|
|
775
|
-
* The id of the run that this message was created in.
|
|
776
|
-
*/
|
|
777
|
-
run_id?: string | null;
|
|
778
|
-
/**
|
|
779
|
-
* The id of the sender of the message, can be an identity id or agent id
|
|
780
|
-
*/
|
|
781
|
-
sender_id?: string | null;
|
|
782
|
-
/**
|
|
783
|
-
* The id of the step that this message was created in.
|
|
784
|
-
*/
|
|
785
|
-
step_id?: string | null;
|
|
786
|
-
/**
|
|
787
|
-
* The ID of the tool call. Only applicable for role tool.
|
|
788
|
-
*/
|
|
789
|
-
tool_call_id?: string | null;
|
|
790
|
-
/**
|
|
791
|
-
* The list of tool calls requested. Only applicable for role assistant.
|
|
792
|
-
*/
|
|
793
|
-
tool_calls?: Array<Message.ToolCall> | null;
|
|
794
|
-
/**
|
|
795
|
-
* Tool execution return information for prior tool calls
|
|
796
|
-
*/
|
|
797
|
-
tool_returns?: Array<Message.ToolReturn> | null;
|
|
798
|
-
/**
|
|
799
|
-
* The timestamp when the object was last updated.
|
|
800
|
-
*/
|
|
801
|
-
updated_at?: string | null;
|
|
802
|
-
}
|
|
803
|
-
export declare namespace Message {
|
|
804
|
-
interface ApprovalReturn {
|
|
805
|
-
/**
|
|
806
|
-
* Whether the tool has been approved
|
|
807
|
-
*/
|
|
808
|
-
approve: boolean;
|
|
809
|
-
/**
|
|
810
|
-
* The ID of the tool call that corresponds to this approval
|
|
811
|
-
*/
|
|
812
|
-
tool_call_id: string;
|
|
813
|
-
/**
|
|
814
|
-
* An optional explanation for the provided approval status
|
|
815
|
-
*/
|
|
816
|
-
reason?: string | null;
|
|
817
|
-
/**
|
|
818
|
-
* The message type to be created.
|
|
819
|
-
*/
|
|
820
|
-
type?: 'approval';
|
|
821
|
-
}
|
|
822
|
-
interface LettaSchemasMessageToolReturn {
|
|
823
|
-
/**
|
|
824
|
-
* The status of the tool call
|
|
825
|
-
*/
|
|
826
|
-
status: 'success' | 'error';
|
|
827
|
-
/**
|
|
828
|
-
* The function response string
|
|
829
|
-
*/
|
|
830
|
-
func_response?: string | null;
|
|
831
|
-
/**
|
|
832
|
-
* Captured stderr from the tool invocation
|
|
833
|
-
*/
|
|
834
|
-
stderr?: Array<string> | null;
|
|
835
|
-
/**
|
|
836
|
-
* Captured stdout (e.g. prints, logs) from the tool invocation
|
|
837
|
-
*/
|
|
838
|
-
stdout?: Array<string> | null;
|
|
839
|
-
/**
|
|
840
|
-
* The ID for the tool call
|
|
841
|
-
*/
|
|
842
|
-
tool_call_id?: unknown;
|
|
843
|
-
}
|
|
844
|
-
/**
|
|
845
|
-
* The style of reasoning content returned by the OpenAI Responses API
|
|
846
|
-
*/
|
|
847
|
-
interface SummarizedReasoningContent {
|
|
848
|
-
/**
|
|
849
|
-
* The unique identifier for this reasoning step.
|
|
850
|
-
*/
|
|
851
|
-
id: string;
|
|
852
|
-
/**
|
|
853
|
-
* Summaries of the reasoning content.
|
|
854
|
-
*/
|
|
855
|
-
summary: Array<SummarizedReasoningContent.Summary>;
|
|
856
|
-
/**
|
|
857
|
-
* The encrypted reasoning content.
|
|
858
|
-
*/
|
|
859
|
-
encrypted_content?: string;
|
|
860
|
-
/**
|
|
861
|
-
* Indicates this is a summarized reasoning step.
|
|
862
|
-
*/
|
|
863
|
-
type?: 'summarized_reasoning';
|
|
864
|
-
}
|
|
865
|
-
namespace SummarizedReasoningContent {
|
|
866
|
-
interface Summary {
|
|
867
|
-
/**
|
|
868
|
-
* The index of the summary part.
|
|
869
|
-
*/
|
|
870
|
-
index: number;
|
|
871
|
-
/**
|
|
872
|
-
* The text of the summary part.
|
|
873
|
-
*/
|
|
874
|
-
text: string;
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
interface ToolCall {
|
|
878
|
-
id: string;
|
|
879
|
-
function: ToolCall.Function;
|
|
880
|
-
type: 'function';
|
|
881
|
-
[k: string]: unknown;
|
|
882
|
-
}
|
|
883
|
-
namespace ToolCall {
|
|
884
|
-
interface Function {
|
|
885
|
-
arguments: string;
|
|
886
|
-
name: string;
|
|
887
|
-
[k: string]: unknown;
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
interface ToolReturn {
|
|
891
|
-
/**
|
|
892
|
-
* The status of the tool call
|
|
893
|
-
*/
|
|
894
|
-
status: 'success' | 'error';
|
|
895
|
-
/**
|
|
896
|
-
* The function response string
|
|
897
|
-
*/
|
|
898
|
-
func_response?: string | null;
|
|
899
|
-
/**
|
|
900
|
-
* Captured stderr from the tool invocation
|
|
901
|
-
*/
|
|
902
|
-
stderr?: Array<string> | null;
|
|
903
|
-
/**
|
|
904
|
-
* Captured stdout (e.g. prints, logs) from the tool invocation
|
|
905
|
-
*/
|
|
906
|
-
stdout?: Array<string> | null;
|
|
907
|
-
/**
|
|
908
|
-
* The ID for the tool call
|
|
909
|
-
*/
|
|
910
|
-
tool_call_id?: unknown;
|
|
911
|
-
}
|
|
912
|
-
}
|
|
872
|
+
export type Message = SystemMessage | UserMessage | ReasoningMessage | HiddenReasoningMessage | ToolCallMessage | ToolsAPI.ToolReturnMessage | AssistantMessage | ApprovalRequestMessage | ApprovalResponseMessage | SummaryMessage | EventMessage;
|
|
913
873
|
export type MessageRole = 'assistant' | 'user' | 'tool' | 'function' | 'system' | 'approval';
|
|
914
874
|
export type MessageType = 'system_message' | 'user_message' | 'assistant_message' | 'reasoning_message' | 'hidden_reasoning_message' | 'tool_call_message' | 'tool_return_message' | 'approval_request_message' | 'approval_response_message';
|
|
915
875
|
/**
|
|
@@ -1697,6 +1657,6 @@ export declare namespace MessageStreamParams {
|
|
|
1697
1657
|
}
|
|
1698
1658
|
}
|
|
1699
1659
|
export declare namespace Messages {
|
|
1700
|
-
export { type ApprovalCreate as ApprovalCreate, type ApprovalRequestMessage as ApprovalRequestMessage, type ApprovalResponseMessage as ApprovalResponseMessage, type AssistantMessage as AssistantMessage, type EventMessage as EventMessage, type HiddenReasoningMessage as HiddenReasoningMessage, type ImageContent as ImageContent, type
|
|
1660
|
+
export { type ApprovalCreate as ApprovalCreate, type ApprovalRequestMessage as ApprovalRequestMessage, type ApprovalResponseMessage as ApprovalResponseMessage, type ApprovalReturn as ApprovalReturn, type AssistantMessage as AssistantMessage, type EventMessage as EventMessage, type HiddenReasoningMessage as HiddenReasoningMessage, type ImageContent as ImageContent, type InternalMessage as InternalMessage, type JobStatus as JobStatus, type JobType as JobType, type LettaAssistantMessageContentUnion as LettaAssistantMessageContentUnion, type LettaRequest as LettaRequest, type LettaResponse as LettaResponse, type LettaStreamingRequest as LettaStreamingRequest, type LettaStreamingResponse as LettaStreamingResponse, type LettaUserMessageContentUnion as LettaUserMessageContentUnion, type Message as Message, type MessageRole as MessageRole, type MessageType as MessageType, type OmittedReasoningContent as OmittedReasoningContent, type ReasoningContent as ReasoningContent, type ReasoningMessage as ReasoningMessage, type RedactedReasoningContent as RedactedReasoningContent, type Run as Run, type SummaryMessage as SummaryMessage, type SystemMessage as SystemMessage, type TextContent as TextContent, type ToolCall as ToolCall, type ToolCallContent as ToolCallContent, type ToolCallDelta as ToolCallDelta, type ToolCallMessage as ToolCallMessage, type ToolReturn as ToolReturn, type ToolReturnContent as ToolReturnContent, type UpdateAssistantMessage as UpdateAssistantMessage, type UpdateReasoningMessage as UpdateReasoningMessage, type UpdateSystemMessage as UpdateSystemMessage, type UpdateUserMessage as UpdateUserMessage, type UserMessage as UserMessage, type MessageCancelResponse as MessageCancelResponse, type MessageModifyResponse as MessageModifyResponse, type MessagesArrayPage as MessagesArrayPage, type MessageListParams as MessageListParams, type MessageCancelParams as MessageCancelParams, type MessageModifyParams as MessageModifyParams, type MessageResetParams as MessageResetParams, type MessageSendParams as MessageSendParams, type MessageSendParamsNonStreaming as MessageSendParamsNonStreaming, type MessageSendParamsStreaming as MessageSendParamsStreaming, type MessageSendAsyncParams as MessageSendAsyncParams, type MessageStreamParams as MessageStreamParams, };
|
|
1701
1661
|
}
|
|
1702
1662
|
//# sourceMappingURL=messages.d.mts.map
|