@letta-ai/letta-client 1.0.0-alpha.15 → 1.0.0-alpha.17
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 +41 -0
- package/client.d.mts +22 -22
- package/client.d.mts.map +1 -1
- package/client.d.ts +22 -22
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents/agents.d.mts +1098 -136
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +1098 -136
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js +0 -6
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +1 -7
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/blocks.d.mts +1 -15
- package/resources/agents/blocks.d.mts.map +1 -1
- package/resources/agents/blocks.d.ts +1 -15
- package/resources/agents/blocks.d.ts.map +1 -1
- package/resources/agents/folders.d.mts +47 -76
- package/resources/agents/folders.d.mts.map +1 -1
- package/resources/agents/folders.d.ts +47 -76
- package/resources/agents/folders.d.ts.map +1 -1
- package/resources/agents/folders.js +5 -1
- package/resources/agents/folders.js.map +1 -1
- package/resources/agents/folders.mjs +5 -1
- package/resources/agents/folders.mjs.map +1 -1
- package/resources/agents/index.d.mts +4 -4
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +4 -4
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs.map +1 -1
- package/resources/agents/messages.d.mts +87 -28
- package/resources/agents/messages.d.mts.map +1 -1
- package/resources/agents/messages.d.ts +87 -28
- package/resources/agents/messages.d.ts.map +1 -1
- package/resources/agents/messages.js +5 -5
- package/resources/agents/messages.js.map +1 -1
- package/resources/agents/messages.mjs +5 -5
- package/resources/agents/messages.mjs.map +1 -1
- package/resources/agents/tools.d.mts +6 -27
- package/resources/agents/tools.d.mts.map +1 -1
- package/resources/agents/tools.d.ts +6 -27
- package/resources/agents/tools.d.ts.map +1 -1
- package/resources/agents/tools.js +5 -1
- package/resources/agents/tools.js.map +1 -1
- package/resources/agents/tools.mjs +5 -1
- package/resources/agents/tools.mjs.map +1 -1
- package/resources/archives.d.mts +9 -37
- package/resources/archives.d.mts.map +1 -1
- package/resources/archives.d.ts +9 -37
- package/resources/archives.d.ts.map +1 -1
- package/resources/archives.js +2 -1
- package/resources/archives.js.map +1 -1
- package/resources/archives.mjs +2 -1
- package/resources/archives.mjs.map +1 -1
- package/resources/batches/batches.d.mts +8 -30
- package/resources/batches/batches.d.mts.map +1 -1
- package/resources/batches/batches.d.ts +8 -30
- package/resources/batches/batches.d.ts.map +1 -1
- package/resources/batches/batches.js +2 -1
- package/resources/batches/batches.js.map +1 -1
- package/resources/batches/batches.mjs +2 -1
- package/resources/batches/batches.mjs.map +1 -1
- package/resources/batches/index.d.mts +2 -2
- package/resources/batches/index.d.mts.map +1 -1
- package/resources/batches/index.d.ts +2 -2
- package/resources/batches/index.d.ts.map +1 -1
- package/resources/batches/index.js.map +1 -1
- package/resources/batches/index.mjs.map +1 -1
- package/resources/batches/messages.d.mts +6 -30
- package/resources/batches/messages.d.mts.map +1 -1
- package/resources/batches/messages.d.ts +6 -30
- package/resources/batches/messages.d.ts.map +1 -1
- package/resources/batches/messages.js +2 -1
- package/resources/batches/messages.js.map +1 -1
- package/resources/batches/messages.mjs +2 -1
- package/resources/batches/messages.mjs.map +1 -1
- package/resources/blocks/blocks.d.mts +1 -6
- package/resources/blocks/blocks.d.mts.map +1 -1
- package/resources/blocks/blocks.d.ts +1 -6
- package/resources/blocks/blocks.d.ts.map +1 -1
- package/resources/blocks/blocks.js +0 -6
- package/resources/blocks/blocks.js.map +1 -1
- package/resources/blocks/blocks.mjs +0 -6
- package/resources/blocks/blocks.mjs.map +1 -1
- package/resources/blocks/index.d.mts +1 -1
- package/resources/blocks/index.d.mts.map +1 -1
- package/resources/blocks/index.d.ts +1 -1
- package/resources/blocks/index.d.ts.map +1 -1
- package/resources/blocks/index.js.map +1 -1
- package/resources/blocks/index.mjs.map +1 -1
- package/resources/folders/files.d.mts +73 -97
- package/resources/folders/files.d.mts.map +1 -1
- package/resources/folders/files.d.ts +73 -97
- package/resources/folders/files.d.ts.map +1 -1
- package/resources/folders/files.js +5 -1
- package/resources/folders/files.js.map +1 -1
- package/resources/folders/files.mjs +5 -1
- package/resources/folders/files.mjs.map +1 -1
- package/resources/folders/folders.d.mts +11 -44
- package/resources/folders/folders.d.mts.map +1 -1
- package/resources/folders/folders.d.ts +11 -44
- package/resources/folders/folders.d.ts.map +1 -1
- package/resources/folders/folders.js +2 -7
- package/resources/folders/folders.js.map +1 -1
- package/resources/folders/folders.mjs +2 -7
- package/resources/folders/folders.mjs.map +1 -1
- package/resources/folders/index.d.mts +2 -2
- package/resources/folders/index.d.mts.map +1 -1
- package/resources/folders/index.d.ts +2 -2
- package/resources/folders/index.d.ts.map +1 -1
- package/resources/folders/index.js.map +1 -1
- package/resources/folders/index.mjs.map +1 -1
- package/resources/groups/groups.d.mts +1 -6
- package/resources/groups/groups.d.mts.map +1 -1
- package/resources/groups/groups.d.ts +1 -6
- package/resources/groups/groups.d.ts.map +1 -1
- package/resources/groups/groups.js +0 -6
- package/resources/groups/groups.js.map +1 -1
- package/resources/groups/groups.mjs +0 -6
- package/resources/groups/groups.mjs.map +1 -1
- package/resources/groups/index.d.mts +1 -1
- package/resources/groups/index.d.mts.map +1 -1
- package/resources/groups/index.d.ts +1 -1
- package/resources/groups/index.d.ts.map +1 -1
- package/resources/groups/index.js.map +1 -1
- package/resources/groups/index.mjs.map +1 -1
- package/resources/groups/messages.d.mts +9 -3
- package/resources/groups/messages.d.mts.map +1 -1
- package/resources/groups/messages.d.ts +9 -3
- package/resources/groups/messages.d.ts.map +1 -1
- package/resources/identities/identities.d.mts +9 -36
- package/resources/identities/identities.d.mts.map +1 -1
- package/resources/identities/identities.d.ts +9 -36
- package/resources/identities/identities.d.ts.map +1 -1
- package/resources/identities/identities.js +2 -7
- package/resources/identities/identities.js.map +1 -1
- package/resources/identities/identities.mjs +2 -7
- package/resources/identities/identities.mjs.map +1 -1
- package/resources/identities/index.d.mts +1 -1
- package/resources/identities/index.d.mts.map +1 -1
- package/resources/identities/index.d.ts +1 -1
- package/resources/identities/index.d.ts.map +1 -1
- package/resources/identities/index.js.map +1 -1
- package/resources/identities/index.mjs.map +1 -1
- package/resources/index.d.mts +11 -11
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +11 -11
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/mcp-servers/index.d.mts +2 -3
- package/resources/mcp-servers/index.d.mts.map +1 -1
- package/resources/mcp-servers/index.d.ts +2 -3
- package/resources/mcp-servers/index.d.ts.map +1 -1
- package/resources/mcp-servers/index.js +1 -3
- package/resources/mcp-servers/index.js.map +1 -1
- package/resources/mcp-servers/index.mjs +1 -2
- package/resources/mcp-servers/index.mjs.map +1 -1
- package/resources/mcp-servers/mcp-servers.d.mts +292 -378
- package/resources/mcp-servers/mcp-servers.d.mts.map +1 -1
- package/resources/mcp-servers/mcp-servers.d.ts +292 -378
- package/resources/mcp-servers/mcp-servers.d.ts.map +1 -1
- package/resources/mcp-servers/mcp-servers.js +17 -4
- package/resources/mcp-servers/mcp-servers.js.map +1 -1
- package/resources/mcp-servers/mcp-servers.mjs +17 -4
- package/resources/mcp-servers/mcp-servers.mjs.map +1 -1
- package/resources/mcp-servers/tools.d.mts +3 -41
- package/resources/mcp-servers/tools.d.mts.map +1 -1
- package/resources/mcp-servers/tools.d.ts +3 -41
- package/resources/mcp-servers/tools.d.ts.map +1 -1
- package/resources/mcp-servers/tools.js.map +1 -1
- package/resources/mcp-servers/tools.mjs.map +1 -1
- package/resources/models/embeddings.d.mts +6 -2
- package/resources/models/embeddings.d.mts.map +1 -1
- package/resources/models/embeddings.d.ts +6 -2
- package/resources/models/embeddings.d.ts.map +1 -1
- package/resources/models/embeddings.js +5 -1
- package/resources/models/embeddings.js.map +1 -1
- package/resources/models/embeddings.mjs +5 -1
- package/resources/models/embeddings.mjs.map +1 -1
- package/resources/models/index.d.mts +1 -1
- package/resources/models/index.d.mts.map +1 -1
- package/resources/models/index.d.ts +1 -1
- package/resources/models/index.d.ts.map +1 -1
- package/resources/models/index.js.map +1 -1
- package/resources/models/index.mjs.map +1 -1
- package/resources/models/models.d.mts +174 -3
- package/resources/models/models.d.mts.map +1 -1
- package/resources/models/models.d.ts +174 -3
- package/resources/models/models.d.ts.map +1 -1
- package/resources/models/models.js +5 -1
- package/resources/models/models.js.map +1 -1
- package/resources/models/models.mjs +5 -1
- package/resources/models/models.mjs.map +1 -1
- package/resources/runs/index.d.mts +1 -1
- package/resources/runs/index.d.mts.map +1 -1
- package/resources/runs/index.d.ts +1 -1
- package/resources/runs/index.d.ts.map +1 -1
- package/resources/runs/index.js.map +1 -1
- package/resources/runs/index.mjs.map +1 -1
- package/resources/runs/runs.d.mts +6 -32
- package/resources/runs/runs.d.mts.map +1 -1
- package/resources/runs/runs.d.ts +6 -32
- package/resources/runs/runs.d.ts.map +1 -1
- package/resources/runs/runs.js +2 -1
- package/resources/runs/runs.js.map +1 -1
- package/resources/runs/runs.mjs +2 -1
- package/resources/runs/runs.mjs.map +1 -1
- package/resources/tools.d.mts +6 -68
- package/resources/tools.d.mts.map +1 -1
- package/resources/tools.d.ts +6 -68
- package/resources/tools.d.ts.map +1 -1
- package/resources/tools.js +2 -7
- package/resources/tools.js.map +1 -1
- package/resources/tools.mjs +2 -7
- package/resources/tools.mjs.map +1 -1
- package/src/client.ts +41 -28
- package/src/resources/agents/agents.ts +1364 -77
- package/src/resources/agents/blocks.ts +1 -15
- package/src/resources/agents/folders.ts +55 -85
- package/src/resources/agents/index.ts +5 -2
- package/src/resources/agents/messages.ts +123 -28
- package/src/resources/agents/tools.ts +10 -34
- package/src/resources/archives.ts +12 -45
- package/src/resources/batches/batches.ts +10 -41
- package/src/resources/batches/index.ts +2 -2
- package/src/resources/batches/messages.ts +12 -37
- package/src/resources/blocks/blocks.ts +0 -10
- package/src/resources/blocks/index.ts +0 -1
- package/src/resources/folders/files.ts +88 -113
- package/src/resources/folders/folders.ts +14 -55
- package/src/resources/folders/index.ts +2 -2
- package/src/resources/groups/groups.ts +0 -10
- package/src/resources/groups/index.ts +0 -1
- package/src/resources/groups/messages.ts +10 -3
- package/src/resources/identities/identities.ts +12 -49
- package/src/resources/identities/index.ts +1 -2
- package/src/resources/index.ts +21 -14
- package/src/resources/mcp-servers/index.ts +14 -9
- package/src/resources/mcp-servers/mcp-servers.ts +303 -402
- package/src/resources/mcp-servers/tools.ts +6 -47
- package/src/resources/models/embeddings.ts +6 -2
- package/src/resources/models/index.ts +2 -0
- package/src/resources/models/models.ts +254 -2
- package/src/resources/runs/index.ts +1 -1
- package/src/resources/runs/runs.ts +11 -44
- package/src/resources/tools.ts +8 -92
- 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
- package/resources/mcp-servers/refresh.d.mts +0 -24
- package/resources/mcp-servers/refresh.d.mts.map +0 -1
- package/resources/mcp-servers/refresh.d.ts +0 -24
- package/resources/mcp-servers/refresh.d.ts.map +0 -1
- package/resources/mcp-servers/refresh.js +0 -27
- package/resources/mcp-servers/refresh.js.map +0 -1
- package/resources/mcp-servers/refresh.mjs +0 -23
- package/resources/mcp-servers/refresh.mjs.map +0 -1
- package/src/resources/mcp-servers/refresh.ts +0 -43
|
@@ -78,21 +78,7 @@ export class Blocks extends APIResource {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
* A Block represents a reserved section of the LLM's context window
|
|
82
|
-
* editable. `Block` objects contained in the `Memory` object, which is able to
|
|
83
|
-
* edit the Block values.
|
|
84
|
-
*
|
|
85
|
-
* Parameters: label (str): The label of the block (e.g. 'human', 'persona'). This
|
|
86
|
-
* defines a category for the block. value (str): The value of the block. This is
|
|
87
|
-
* the string that is represented in the context window. limit (int): The character
|
|
88
|
-
* limit of the block. is_template (bool): Whether the block is a template (e.g.
|
|
89
|
-
* saved human/persona options). Non-template blocks are not stored in the database
|
|
90
|
-
* and are ephemeral, while templated blocks are stored in the database. label
|
|
91
|
-
* (str): The label of the block (e.g. 'human', 'persona'). This defines a category
|
|
92
|
-
* for the block. template_name (str): The name of the block template (if it is a
|
|
93
|
-
* template). description (str): Description of the block. metadata (Dict):
|
|
94
|
-
* Metadata of the block. user_id (str): The unique identifier of the user
|
|
95
|
-
* associated with the block.
|
|
81
|
+
* A Block represents a reserved section of the LLM's context window.
|
|
96
82
|
*/
|
|
97
83
|
export interface Block {
|
|
98
84
|
/**
|
|
@@ -5,6 +5,7 @@ import * as ArchivesAPI from '../archives';
|
|
|
5
5
|
import * as AgentsAPI from './agents';
|
|
6
6
|
import * as ModelsAPI from '../models/models';
|
|
7
7
|
import { APIPromise } from '../../core/api-promise';
|
|
8
|
+
import { ArrayPage, type ArrayPageParams, PagePromise } from '../../core/pagination';
|
|
8
9
|
import { RequestOptions } from '../../internal/request-options';
|
|
9
10
|
import { path } from '../../internal/utils/path';
|
|
10
11
|
|
|
@@ -16,8 +17,11 @@ export class Folders extends APIResource {
|
|
|
16
17
|
agentID: string,
|
|
17
18
|
query: FolderListParams | null | undefined = {},
|
|
18
19
|
options?: RequestOptions,
|
|
19
|
-
):
|
|
20
|
-
return this._client.
|
|
20
|
+
): PagePromise<FolderListResponsesArrayPage, FolderListResponse> {
|
|
21
|
+
return this._client.getAPIList(path`/v1/agents/${agentID}/folders`, ArrayPage<FolderListResponse>, {
|
|
22
|
+
query,
|
|
23
|
+
...options,
|
|
24
|
+
});
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
/**
|
|
@@ -45,106 +49,71 @@ export class Folders extends APIResource {
|
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
|
|
48
|
-
export type
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
name: string;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* The human-friendly ID of the Source
|
|
73
|
-
*/
|
|
74
|
-
id?: string;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* The timestamp when the source was created.
|
|
78
|
-
*/
|
|
79
|
-
created_at?: string | null;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* The id of the user that made this Tool.
|
|
83
|
-
*/
|
|
84
|
-
created_by_id?: string | null;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* The description of the source.
|
|
88
|
-
*/
|
|
89
|
-
description?: string | null;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Instructions for how to use the source.
|
|
93
|
-
*/
|
|
94
|
-
instructions?: string | null;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* The id of the user that made this Tool.
|
|
98
|
-
*/
|
|
99
|
-
last_updated_by_id?: string | null;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Metadata associated with the source.
|
|
103
|
-
*/
|
|
104
|
-
metadata?: { [key: string]: unknown } | null;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* The timestamp when the source was last updated.
|
|
108
|
-
*/
|
|
109
|
-
updated_at?: string | null;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* The vector database provider used for this source's passages
|
|
113
|
-
*/
|
|
114
|
-
vector_db_provider?: ArchivesAPI.VectorDBProvider;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
52
|
+
export type FolderListResponsesArrayPage = ArrayPage<FolderListResponse>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* (Deprecated: Use Folder) Representation of a source, which is a collection of
|
|
56
|
+
* files and passages.
|
|
57
|
+
*/
|
|
58
|
+
export interface FolderListResponse {
|
|
59
|
+
/**
|
|
60
|
+
* The human-friendly ID of the Source
|
|
61
|
+
*/
|
|
62
|
+
id: string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The embedding configuration used by the source.
|
|
66
|
+
*/
|
|
67
|
+
embedding_config: ModelsAPI.EmbeddingConfig;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The name of the source.
|
|
71
|
+
*/
|
|
72
|
+
name: string;
|
|
117
73
|
|
|
118
|
-
export interface FolderListParams {
|
|
119
74
|
/**
|
|
120
|
-
*
|
|
121
|
-
* in the specified sort order
|
|
75
|
+
* The timestamp when the source was created.
|
|
122
76
|
*/
|
|
123
|
-
|
|
77
|
+
created_at?: string | null;
|
|
124
78
|
|
|
125
79
|
/**
|
|
126
|
-
*
|
|
127
|
-
* in the specified sort order
|
|
80
|
+
* The id of the user that made this Tool.
|
|
128
81
|
*/
|
|
129
|
-
|
|
82
|
+
created_by_id?: string | null;
|
|
130
83
|
|
|
131
84
|
/**
|
|
132
|
-
*
|
|
85
|
+
* The description of the source.
|
|
133
86
|
*/
|
|
134
|
-
|
|
87
|
+
description?: string | null;
|
|
135
88
|
|
|
136
89
|
/**
|
|
137
|
-
*
|
|
138
|
-
* newest first
|
|
90
|
+
* Instructions for how to use the source.
|
|
139
91
|
*/
|
|
140
|
-
|
|
92
|
+
instructions?: string | null;
|
|
141
93
|
|
|
142
94
|
/**
|
|
143
|
-
*
|
|
95
|
+
* The id of the user that made this Tool.
|
|
144
96
|
*/
|
|
145
|
-
|
|
97
|
+
last_updated_by_id?: string | null;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Metadata associated with the source.
|
|
101
|
+
*/
|
|
102
|
+
metadata?: { [key: string]: unknown } | null;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The timestamp when the source was last updated.
|
|
106
|
+
*/
|
|
107
|
+
updated_at?: string | null;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The vector database provider used for this source's passages
|
|
111
|
+
*/
|
|
112
|
+
vector_db_provider?: ArchivesAPI.VectorDBProvider;
|
|
146
113
|
}
|
|
147
114
|
|
|
115
|
+
export interface FolderListParams extends ArrayPageParams {}
|
|
116
|
+
|
|
148
117
|
export interface FolderAttachParams {
|
|
149
118
|
/**
|
|
150
119
|
* The ID of the agent in the format 'agent-<uuid4>'
|
|
@@ -162,6 +131,7 @@ export interface FolderDetachParams {
|
|
|
162
131
|
export declare namespace Folders {
|
|
163
132
|
export {
|
|
164
133
|
type FolderListResponse as FolderListResponse,
|
|
134
|
+
type FolderListResponsesArrayPage as FolderListResponsesArrayPage,
|
|
165
135
|
type FolderListParams as FolderListParams,
|
|
166
136
|
type FolderAttachParams as FolderAttachParams,
|
|
167
137
|
type FolderDetachParams as FolderDetachParams,
|
|
@@ -20,7 +20,6 @@ export {
|
|
|
20
20
|
type TerminalToolRule,
|
|
21
21
|
type TextResponseFormat,
|
|
22
22
|
type AgentDeleteResponse,
|
|
23
|
-
type AgentCountResponse,
|
|
24
23
|
type AgentExportFileResponse,
|
|
25
24
|
type AgentImportFileResponse,
|
|
26
25
|
type AgentCreateParams,
|
|
@@ -58,6 +57,7 @@ export {
|
|
|
58
57
|
type FolderListParams,
|
|
59
58
|
type FolderAttachParams,
|
|
60
59
|
type FolderDetachParams,
|
|
60
|
+
type FolderListResponsesArrayPage,
|
|
61
61
|
} from './folders';
|
|
62
62
|
export { Groups, type GroupListParams } from './groups';
|
|
63
63
|
export {
|
|
@@ -107,13 +107,16 @@ export {
|
|
|
107
107
|
type MessageModifyParams,
|
|
108
108
|
type MessageResetParams,
|
|
109
109
|
type MessageSendParams,
|
|
110
|
+
type MessageSendParamsNonStreaming,
|
|
111
|
+
type MessageSendParamsStreaming,
|
|
110
112
|
type MessageSendAsyncParams,
|
|
111
113
|
type MessageStreamParams,
|
|
112
114
|
type LettaMessageUnionsArrayPage,
|
|
115
|
+
type RunsArrayPage,
|
|
116
|
+
type MessagesObjectPage,
|
|
113
117
|
} from './messages';
|
|
114
118
|
export {
|
|
115
119
|
Tools,
|
|
116
|
-
type ToolListResponse,
|
|
117
120
|
type ToolListParams,
|
|
118
121
|
type ToolAttachParams,
|
|
119
122
|
type ToolDetachParams,
|
|
@@ -6,7 +6,7 @@ import * as ToolsAPI from '../tools';
|
|
|
6
6
|
import * as AgentsAPI from './agents';
|
|
7
7
|
import * as RunsAPI from '../runs/runs';
|
|
8
8
|
import { APIPromise } from '../../core/api-promise';
|
|
9
|
-
import { ArrayPage, type ArrayPageParams, PagePromise } from '../../core/pagination';
|
|
9
|
+
import { ArrayPage, type ArrayPageParams, ObjectPage, PagePromise } from '../../core/pagination';
|
|
10
10
|
import { Stream } from '../../core/streaming';
|
|
11
11
|
import { buildHeaders } from '../../internal/headers';
|
|
12
12
|
import { RequestOptions } from '../../internal/request-options';
|
|
@@ -67,9 +67,44 @@ export class Messages extends APIResource {
|
|
|
67
67
|
/**
|
|
68
68
|
* Process a user message and return the agent's response. This endpoint accepts a
|
|
69
69
|
* message from a user and processes it through the agent.
|
|
70
|
+
*
|
|
71
|
+
* The response format is controlled by the `streaming` field in the request body:
|
|
72
|
+
*
|
|
73
|
+
* - If `streaming=false` (default): Returns a complete LettaResponse with all
|
|
74
|
+
* messages
|
|
75
|
+
* - If `streaming=true`: Returns a Server-Sent Events (SSE) stream
|
|
76
|
+
*
|
|
77
|
+
* Additional streaming options (only used when streaming=true):
|
|
78
|
+
*
|
|
79
|
+
* - `stream_tokens`: Stream individual tokens instead of complete steps
|
|
80
|
+
* - `include_pings`: Include keepalive pings to prevent connection timeouts
|
|
81
|
+
* - `background`: Process the request in the background
|
|
70
82
|
*/
|
|
71
|
-
send(
|
|
72
|
-
|
|
83
|
+
send(
|
|
84
|
+
agentID: string,
|
|
85
|
+
body: MessageSendParamsNonStreaming,
|
|
86
|
+
options?: RequestOptions,
|
|
87
|
+
): APIPromise<LettaResponse>;
|
|
88
|
+
send(
|
|
89
|
+
agentID: string,
|
|
90
|
+
body: MessageSendParamsStreaming,
|
|
91
|
+
options?: RequestOptions,
|
|
92
|
+
): APIPromise<Stream<LettaStreamingResponse>>;
|
|
93
|
+
send(
|
|
94
|
+
agentID: string,
|
|
95
|
+
body: MessageSendParamsBase,
|
|
96
|
+
options?: RequestOptions,
|
|
97
|
+
): APIPromise<Stream<LettaStreamingResponse> | LettaResponse>;
|
|
98
|
+
send(
|
|
99
|
+
agentID: string,
|
|
100
|
+
body: MessageSendParams,
|
|
101
|
+
options?: RequestOptions,
|
|
102
|
+
): APIPromise<LettaResponse> | APIPromise<Stream<LettaStreamingResponse>> {
|
|
103
|
+
return this._client.post(path`/v1/agents/${agentID}/messages`, {
|
|
104
|
+
body,
|
|
105
|
+
...options,
|
|
106
|
+
stream: body.streaming ?? false,
|
|
107
|
+
}) as APIPromise<LettaResponse> | APIPromise<Stream<LettaStreamingResponse>>;
|
|
73
108
|
}
|
|
74
109
|
|
|
75
110
|
/**
|
|
@@ -114,6 +149,10 @@ export class Messages extends APIResource {
|
|
|
114
149
|
|
|
115
150
|
export type LettaMessageUnionsArrayPage = ArrayPage<LettaMessageUnion>;
|
|
116
151
|
|
|
152
|
+
export type RunsArrayPage = ArrayPage<Run>;
|
|
153
|
+
|
|
154
|
+
export type MessagesObjectPage = ObjectPage<Message>;
|
|
155
|
+
|
|
117
156
|
/**
|
|
118
157
|
* Input to approve or deny a tool call request
|
|
119
158
|
*/
|
|
@@ -133,6 +172,11 @@ export interface ApprovalCreate {
|
|
|
133
172
|
*/
|
|
134
173
|
approve?: boolean | null;
|
|
135
174
|
|
|
175
|
+
/**
|
|
176
|
+
* The multi-agent group that the message was sent in
|
|
177
|
+
*/
|
|
178
|
+
group_id?: string | null;
|
|
179
|
+
|
|
136
180
|
/**
|
|
137
181
|
* @deprecated An optional explanation for the provided approval status
|
|
138
182
|
*/
|
|
@@ -714,7 +758,8 @@ export interface LettaStreamingRequest {
|
|
|
714
758
|
assistant_message_tool_name?: string;
|
|
715
759
|
|
|
716
760
|
/**
|
|
717
|
-
* Whether to process the request in the background
|
|
761
|
+
* Whether to process the request in the background (only used when
|
|
762
|
+
* streaming=true).
|
|
718
763
|
*/
|
|
719
764
|
background?: boolean;
|
|
720
765
|
|
|
@@ -726,7 +771,7 @@ export interface LettaStreamingRequest {
|
|
|
726
771
|
|
|
727
772
|
/**
|
|
728
773
|
* Whether to include periodic keepalive ping messages in the stream to prevent
|
|
729
|
-
* connection timeouts.
|
|
774
|
+
* connection timeouts (only used when streaming=true).
|
|
730
775
|
*/
|
|
731
776
|
include_pings?: boolean;
|
|
732
777
|
|
|
@@ -766,10 +811,16 @@ export interface LettaStreamingRequest {
|
|
|
766
811
|
|
|
767
812
|
/**
|
|
768
813
|
* Flag to determine if individual tokens should be streamed, rather than streaming
|
|
769
|
-
* per step.
|
|
814
|
+
* per step (only used when streaming=true).
|
|
770
815
|
*/
|
|
771
816
|
stream_tokens?: boolean;
|
|
772
817
|
|
|
818
|
+
/**
|
|
819
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
820
|
+
* returns a complete response.
|
|
821
|
+
*/
|
|
822
|
+
streaming?: boolean;
|
|
823
|
+
|
|
773
824
|
/**
|
|
774
825
|
* @deprecated Whether the server should parse specific tool call arguments
|
|
775
826
|
* (default `send_message`) as `AssistantMessage` objects. Still supported for
|
|
@@ -928,14 +979,14 @@ export type LettaUserMessageContentUnion = TextContent | ImageContent;
|
|
|
928
979
|
*/
|
|
929
980
|
export interface Message {
|
|
930
981
|
/**
|
|
931
|
-
* The
|
|
982
|
+
* The human-friendly ID of the Message
|
|
932
983
|
*/
|
|
933
|
-
|
|
984
|
+
id: string;
|
|
934
985
|
|
|
935
986
|
/**
|
|
936
|
-
* The
|
|
987
|
+
* The role of the participant.
|
|
937
988
|
*/
|
|
938
|
-
|
|
989
|
+
role: MessageRole;
|
|
939
990
|
|
|
940
991
|
/**
|
|
941
992
|
* The unique identifier of the agent.
|
|
@@ -1311,27 +1362,17 @@ export interface RedactedReasoningContent {
|
|
|
1311
1362
|
* Representation of a run - a conversation or processing session for an agent.
|
|
1312
1363
|
* Runs track when agents process messages and maintain the relationship between
|
|
1313
1364
|
* agents, steps, and messages.
|
|
1314
|
-
*
|
|
1315
|
-
* Parameters: id (str): The unique identifier of the run (prefixed with 'run-').
|
|
1316
|
-
* status (JobStatus): The current status of the run. created_at (datetime): The
|
|
1317
|
-
* timestamp when the run was created. completed_at (datetime): The timestamp when
|
|
1318
|
-
* the run was completed. agent_id (str): The unique identifier of the agent
|
|
1319
|
-
* associated with the run. base_template_id (str): The base template ID that the
|
|
1320
|
-
* run belongs to. stop_reason (StopReasonType): The reason why the run was
|
|
1321
|
-
* stopped. background (bool): Whether the run was created in background mode.
|
|
1322
|
-
* metadata (dict): Additional metadata for the run. request_config
|
|
1323
|
-
* (LettaRequestConfig): The request configuration for the run.
|
|
1324
1365
|
*/
|
|
1325
1366
|
export interface Run {
|
|
1326
1367
|
/**
|
|
1327
|
-
* The
|
|
1368
|
+
* The human-friendly ID of the Run
|
|
1328
1369
|
*/
|
|
1329
|
-
|
|
1370
|
+
id: string;
|
|
1330
1371
|
|
|
1331
1372
|
/**
|
|
1332
|
-
* The
|
|
1373
|
+
* The unique identifier of the agent associated with the run.
|
|
1333
1374
|
*/
|
|
1334
|
-
|
|
1375
|
+
agent_id: string;
|
|
1335
1376
|
|
|
1336
1377
|
/**
|
|
1337
1378
|
* Whether the run was created in background mode.
|
|
@@ -1860,7 +1901,9 @@ export interface MessageResetParams {
|
|
|
1860
1901
|
add_default_initial_messages?: boolean;
|
|
1861
1902
|
}
|
|
1862
1903
|
|
|
1863
|
-
export
|
|
1904
|
+
export type MessageSendParams = MessageSendParamsNonStreaming | MessageSendParamsStreaming;
|
|
1905
|
+
|
|
1906
|
+
export interface MessageSendParamsBase {
|
|
1864
1907
|
/**
|
|
1865
1908
|
* @deprecated The name of the message argument in the designated message tool.
|
|
1866
1909
|
* Still supported for legacy agent types, but deprecated for letta_v1_agent
|
|
@@ -1874,12 +1917,24 @@ export interface MessageSendParams {
|
|
|
1874
1917
|
*/
|
|
1875
1918
|
assistant_message_tool_name?: string;
|
|
1876
1919
|
|
|
1920
|
+
/**
|
|
1921
|
+
* Whether to process the request in the background (only used when
|
|
1922
|
+
* streaming=true).
|
|
1923
|
+
*/
|
|
1924
|
+
background?: boolean;
|
|
1925
|
+
|
|
1877
1926
|
/**
|
|
1878
1927
|
* @deprecated If set to True, enables reasoning before responses or tool calls
|
|
1879
1928
|
* from the agent.
|
|
1880
1929
|
*/
|
|
1881
1930
|
enable_thinking?: string;
|
|
1882
1931
|
|
|
1932
|
+
/**
|
|
1933
|
+
* Whether to include periodic keepalive ping messages in the stream to prevent
|
|
1934
|
+
* connection timeouts (only used when streaming=true).
|
|
1935
|
+
*/
|
|
1936
|
+
include_pings?: boolean;
|
|
1937
|
+
|
|
1883
1938
|
/**
|
|
1884
1939
|
* Only return specified message types in the response. If `None` (default) returns
|
|
1885
1940
|
* all messages.
|
|
@@ -1914,6 +1969,18 @@ export interface MessageSendParams {
|
|
|
1914
1969
|
*/
|
|
1915
1970
|
messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
|
|
1916
1971
|
|
|
1972
|
+
/**
|
|
1973
|
+
* Flag to determine if individual tokens should be streamed, rather than streaming
|
|
1974
|
+
* per step (only used when streaming=true).
|
|
1975
|
+
*/
|
|
1976
|
+
stream_tokens?: boolean;
|
|
1977
|
+
|
|
1978
|
+
/**
|
|
1979
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
1980
|
+
* returns a complete response.
|
|
1981
|
+
*/
|
|
1982
|
+
streaming?: boolean;
|
|
1983
|
+
|
|
1917
1984
|
/**
|
|
1918
1985
|
* @deprecated Whether the server should parse specific tool call arguments
|
|
1919
1986
|
* (default `send_message`) as `AssistantMessage` objects. Still supported for
|
|
@@ -1961,6 +2028,25 @@ export namespace MessageSendParams {
|
|
|
1961
2028
|
text: string;
|
|
1962
2029
|
}
|
|
1963
2030
|
}
|
|
2031
|
+
|
|
2032
|
+
export type MessageSendParamsNonStreaming = MessagesAPI.MessageSendParamsNonStreaming;
|
|
2033
|
+
export type MessageSendParamsStreaming = MessagesAPI.MessageSendParamsStreaming;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
export interface MessageSendParamsNonStreaming extends MessageSendParamsBase {
|
|
2037
|
+
/**
|
|
2038
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
2039
|
+
* returns a complete response.
|
|
2040
|
+
*/
|
|
2041
|
+
streaming?: false;
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
export interface MessageSendParamsStreaming extends MessageSendParamsBase {
|
|
2045
|
+
/**
|
|
2046
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
2047
|
+
* returns a complete response.
|
|
2048
|
+
*/
|
|
2049
|
+
streaming: true;
|
|
1964
2050
|
}
|
|
1965
2051
|
|
|
1966
2052
|
export interface MessageSendAsyncParams {
|
|
@@ -2086,7 +2172,8 @@ export interface MessageStreamParams {
|
|
|
2086
2172
|
assistant_message_tool_name?: string;
|
|
2087
2173
|
|
|
2088
2174
|
/**
|
|
2089
|
-
* Whether to process the request in the background
|
|
2175
|
+
* Whether to process the request in the background (only used when
|
|
2176
|
+
* streaming=true).
|
|
2090
2177
|
*/
|
|
2091
2178
|
background?: boolean;
|
|
2092
2179
|
|
|
@@ -2098,7 +2185,7 @@ export interface MessageStreamParams {
|
|
|
2098
2185
|
|
|
2099
2186
|
/**
|
|
2100
2187
|
* Whether to include periodic keepalive ping messages in the stream to prevent
|
|
2101
|
-
* connection timeouts.
|
|
2188
|
+
* connection timeouts (only used when streaming=true).
|
|
2102
2189
|
*/
|
|
2103
2190
|
include_pings?: boolean;
|
|
2104
2191
|
|
|
@@ -2138,10 +2225,16 @@ export interface MessageStreamParams {
|
|
|
2138
2225
|
|
|
2139
2226
|
/**
|
|
2140
2227
|
* Flag to determine if individual tokens should be streamed, rather than streaming
|
|
2141
|
-
* per step.
|
|
2228
|
+
* per step (only used when streaming=true).
|
|
2142
2229
|
*/
|
|
2143
2230
|
stream_tokens?: boolean;
|
|
2144
2231
|
|
|
2232
|
+
/**
|
|
2233
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
2234
|
+
* returns a complete response.
|
|
2235
|
+
*/
|
|
2236
|
+
streaming?: boolean;
|
|
2237
|
+
|
|
2145
2238
|
/**
|
|
2146
2239
|
* @deprecated Whether the server should parse specific tool call arguments
|
|
2147
2240
|
* (default `send_message`) as `AssistantMessage` objects. Still supported for
|
|
@@ -2239,6 +2332,8 @@ export declare namespace Messages {
|
|
|
2239
2332
|
type MessageModifyParams as MessageModifyParams,
|
|
2240
2333
|
type MessageResetParams as MessageResetParams,
|
|
2241
2334
|
type MessageSendParams as MessageSendParams,
|
|
2335
|
+
type MessageSendParamsNonStreaming as MessageSendParamsNonStreaming,
|
|
2336
|
+
type MessageSendParamsStreaming as MessageSendParamsStreaming,
|
|
2242
2337
|
type MessageSendAsyncParams as MessageSendAsyncParams,
|
|
2243
2338
|
type MessageStreamParams as MessageStreamParams,
|
|
2244
2339
|
};
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as ToolsAPI from '../tools';
|
|
5
|
+
import { ToolsArrayPage } from '../tools';
|
|
5
6
|
import * as AgentsAPI from './agents';
|
|
6
7
|
import { APIPromise } from '../../core/api-promise';
|
|
8
|
+
import { ArrayPage, type ArrayPageParams, PagePromise } from '../../core/pagination';
|
|
7
9
|
import { RequestOptions } from '../../internal/request-options';
|
|
8
10
|
import { path } from '../../internal/utils/path';
|
|
9
11
|
|
|
@@ -15,8 +17,11 @@ export class Tools extends APIResource {
|
|
|
15
17
|
agentID: string,
|
|
16
18
|
query: ToolListParams | null | undefined = {},
|
|
17
19
|
options?: RequestOptions,
|
|
18
|
-
):
|
|
19
|
-
return this._client.
|
|
20
|
+
): PagePromise<ToolsArrayPage, ToolsAPI.Tool> {
|
|
21
|
+
return this._client.getAPIList(path`/v1/agents/${agentID}/tools`, ArrayPage<ToolsAPI.Tool>, {
|
|
22
|
+
query,
|
|
23
|
+
...options,
|
|
24
|
+
});
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
/**
|
|
@@ -63,37 +68,7 @@ export class Tools extends APIResource {
|
|
|
63
68
|
}
|
|
64
69
|
}
|
|
65
70
|
|
|
66
|
-
export
|
|
67
|
-
|
|
68
|
-
export interface ToolListParams {
|
|
69
|
-
/**
|
|
70
|
-
* Tool ID cursor for pagination. Returns tools that come after this tool ID in the
|
|
71
|
-
* specified sort order
|
|
72
|
-
*/
|
|
73
|
-
after?: string | null;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Tool ID cursor for pagination. Returns tools that come before this tool ID in
|
|
77
|
-
* the specified sort order
|
|
78
|
-
*/
|
|
79
|
-
before?: string | null;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Maximum number of tools to return
|
|
83
|
-
*/
|
|
84
|
-
limit?: number | null;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Sort order for tools by creation time. 'asc' for oldest first, 'desc' for newest
|
|
88
|
-
* first
|
|
89
|
-
*/
|
|
90
|
-
order?: 'asc' | 'desc';
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Field to sort by
|
|
94
|
-
*/
|
|
95
|
-
order_by?: 'created_at';
|
|
96
|
-
}
|
|
71
|
+
export interface ToolListParams extends ArrayPageParams {}
|
|
97
72
|
|
|
98
73
|
export interface ToolAttachParams {
|
|
99
74
|
/**
|
|
@@ -128,10 +103,11 @@ export interface ToolUpdateApprovalParams {
|
|
|
128
103
|
|
|
129
104
|
export declare namespace Tools {
|
|
130
105
|
export {
|
|
131
|
-
type ToolListResponse as ToolListResponse,
|
|
132
106
|
type ToolListParams as ToolListParams,
|
|
133
107
|
type ToolAttachParams as ToolAttachParams,
|
|
134
108
|
type ToolDetachParams as ToolDetachParams,
|
|
135
109
|
type ToolUpdateApprovalParams as ToolUpdateApprovalParams,
|
|
136
110
|
};
|
|
137
111
|
}
|
|
112
|
+
|
|
113
|
+
export { type ToolsArrayPage };
|