@letta-ai/letta-client 1.0.0-alpha.15 → 1.0.0-alpha.16
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 +26 -0
- 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.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents/agents.d.mts +163 -52
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +163 -52
- 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/folders.d.mts +52 -76
- package/resources/agents/folders.d.mts.map +1 -1
- package/resources/agents/folders.d.ts +52 -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 -18
- package/resources/agents/messages.d.mts.map +1 -1
- package/resources/agents/messages.d.ts +87 -18
- 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 -31
- package/resources/archives.d.mts.map +1 -1
- package/resources/archives.d.ts +9 -31
- 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 -38
- package/resources/folders/folders.d.mts.map +1 -1
- package/resources/folders/folders.d.ts +11 -38
- 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 +10 -10
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +10 -10
- 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 +302 -378
- package/resources/mcp-servers/mcp-servers.d.mts.map +1 -1
- package/resources/mcp-servers/mcp-servers.d.ts +302 -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 +71 -2
- package/resources/models/embeddings.d.mts.map +1 -1
- package/resources/models/embeddings.d.ts +71 -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/models.d.mts +113 -2
- package/resources/models/models.d.mts.map +1 -1
- package/resources/models/models.d.ts +113 -2
- 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 -27
- package/resources/runs/runs.d.mts.map +1 -1
- package/resources/runs/runs.d.ts +6 -27
- 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 -64
- package/resources/tools.d.mts.map +1 -1
- package/resources/tools.d.ts +6 -64
- 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 +37 -28
- package/src/resources/agents/agents.ts +181 -60
- package/src/resources/agents/folders.ts +60 -85
- package/src/resources/agents/index.ts +5 -2
- package/src/resources/agents/messages.ts +123 -18
- package/src/resources/agents/tools.ts +10 -34
- package/src/resources/archives.ts +12 -39
- 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 -49
- 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 +19 -14
- package/src/resources/mcp-servers/index.ts +14 -9
- package/src/resources/mcp-servers/mcp-servers.ts +313 -402
- package/src/resources/mcp-servers/tools.ts +6 -47
- package/src/resources/models/embeddings.ts +105 -2
- package/src/resources/models/models.ts +158 -2
- package/src/resources/runs/index.ts +1 -1
- package/src/resources/runs/runs.ts +11 -39
- package/src/resources/tools.ts +8 -88
- 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
|
@@ -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,76 @@ 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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
+
* Representation of a source, which is a collection of files and passages.
|
|
56
|
+
*
|
|
57
|
+
* Parameters: id (str): The ID of the source name (str): The name of the source.
|
|
58
|
+
* embedding_config (EmbeddingConfig): The embedding configuration used by the
|
|
59
|
+
* source. user_id (str): The ID of the user that created the source. metadata
|
|
60
|
+
* (dict): Metadata associated with the source. description (str): The description
|
|
61
|
+
* of the source.
|
|
62
|
+
*/
|
|
63
|
+
export interface FolderListResponse {
|
|
64
|
+
/**
|
|
65
|
+
* The human-friendly ID of the Source
|
|
66
|
+
*/
|
|
67
|
+
id: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The embedding configuration used by the source.
|
|
71
|
+
*/
|
|
72
|
+
embedding_config: ModelsAPI.EmbeddingConfig;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The name of the source.
|
|
76
|
+
*/
|
|
77
|
+
name: string;
|
|
117
78
|
|
|
118
|
-
export interface FolderListParams {
|
|
119
79
|
/**
|
|
120
|
-
*
|
|
121
|
-
* in the specified sort order
|
|
80
|
+
* The timestamp when the source was created.
|
|
122
81
|
*/
|
|
123
|
-
|
|
82
|
+
created_at?: string | null;
|
|
124
83
|
|
|
125
84
|
/**
|
|
126
|
-
*
|
|
127
|
-
* in the specified sort order
|
|
85
|
+
* The id of the user that made this Tool.
|
|
128
86
|
*/
|
|
129
|
-
|
|
87
|
+
created_by_id?: string | null;
|
|
130
88
|
|
|
131
89
|
/**
|
|
132
|
-
*
|
|
90
|
+
* The description of the source.
|
|
133
91
|
*/
|
|
134
|
-
|
|
92
|
+
description?: string | null;
|
|
135
93
|
|
|
136
94
|
/**
|
|
137
|
-
*
|
|
138
|
-
* newest first
|
|
95
|
+
* Instructions for how to use the source.
|
|
139
96
|
*/
|
|
140
|
-
|
|
97
|
+
instructions?: string | null;
|
|
141
98
|
|
|
142
99
|
/**
|
|
143
|
-
*
|
|
100
|
+
* The id of the user that made this Tool.
|
|
144
101
|
*/
|
|
145
|
-
|
|
102
|
+
last_updated_by_id?: string | null;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Metadata associated with the source.
|
|
106
|
+
*/
|
|
107
|
+
metadata?: { [key: string]: unknown } | null;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The timestamp when the source was last updated.
|
|
111
|
+
*/
|
|
112
|
+
updated_at?: string | null;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The vector database provider used for this source's passages
|
|
116
|
+
*/
|
|
117
|
+
vector_db_provider?: ArchivesAPI.VectorDBProvider;
|
|
146
118
|
}
|
|
147
119
|
|
|
120
|
+
export interface FolderListParams extends ArrayPageParams {}
|
|
121
|
+
|
|
148
122
|
export interface FolderAttachParams {
|
|
149
123
|
/**
|
|
150
124
|
* The ID of the agent in the format 'agent-<uuid4>'
|
|
@@ -162,6 +136,7 @@ export interface FolderDetachParams {
|
|
|
162
136
|
export declare namespace Folders {
|
|
163
137
|
export {
|
|
164
138
|
type FolderListResponse as FolderListResponse,
|
|
139
|
+
type FolderListResponsesArrayPage as FolderListResponsesArrayPage,
|
|
165
140
|
type FolderListParams as FolderListParams,
|
|
166
141
|
type FolderAttachParams as FolderAttachParams,
|
|
167
142
|
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.
|
|
@@ -1324,14 +1375,14 @@ export interface RedactedReasoningContent {
|
|
|
1324
1375
|
*/
|
|
1325
1376
|
export interface Run {
|
|
1326
1377
|
/**
|
|
1327
|
-
* The
|
|
1378
|
+
* The human-friendly ID of the Run
|
|
1328
1379
|
*/
|
|
1329
|
-
|
|
1380
|
+
id: string;
|
|
1330
1381
|
|
|
1331
1382
|
/**
|
|
1332
|
-
* The
|
|
1383
|
+
* The unique identifier of the agent associated with the run.
|
|
1333
1384
|
*/
|
|
1334
|
-
|
|
1385
|
+
agent_id: string;
|
|
1335
1386
|
|
|
1336
1387
|
/**
|
|
1337
1388
|
* Whether the run was created in background mode.
|
|
@@ -1860,7 +1911,9 @@ export interface MessageResetParams {
|
|
|
1860
1911
|
add_default_initial_messages?: boolean;
|
|
1861
1912
|
}
|
|
1862
1913
|
|
|
1863
|
-
export
|
|
1914
|
+
export type MessageSendParams = MessageSendParamsNonStreaming | MessageSendParamsStreaming;
|
|
1915
|
+
|
|
1916
|
+
export interface MessageSendParamsBase {
|
|
1864
1917
|
/**
|
|
1865
1918
|
* @deprecated The name of the message argument in the designated message tool.
|
|
1866
1919
|
* Still supported for legacy agent types, but deprecated for letta_v1_agent
|
|
@@ -1874,12 +1927,24 @@ export interface MessageSendParams {
|
|
|
1874
1927
|
*/
|
|
1875
1928
|
assistant_message_tool_name?: string;
|
|
1876
1929
|
|
|
1930
|
+
/**
|
|
1931
|
+
* Whether to process the request in the background (only used when
|
|
1932
|
+
* streaming=true).
|
|
1933
|
+
*/
|
|
1934
|
+
background?: boolean;
|
|
1935
|
+
|
|
1877
1936
|
/**
|
|
1878
1937
|
* @deprecated If set to True, enables reasoning before responses or tool calls
|
|
1879
1938
|
* from the agent.
|
|
1880
1939
|
*/
|
|
1881
1940
|
enable_thinking?: string;
|
|
1882
1941
|
|
|
1942
|
+
/**
|
|
1943
|
+
* Whether to include periodic keepalive ping messages in the stream to prevent
|
|
1944
|
+
* connection timeouts (only used when streaming=true).
|
|
1945
|
+
*/
|
|
1946
|
+
include_pings?: boolean;
|
|
1947
|
+
|
|
1883
1948
|
/**
|
|
1884
1949
|
* Only return specified message types in the response. If `None` (default) returns
|
|
1885
1950
|
* all messages.
|
|
@@ -1914,6 +1979,18 @@ export interface MessageSendParams {
|
|
|
1914
1979
|
*/
|
|
1915
1980
|
messages?: Array<AgentsAPI.MessageCreate | ApprovalCreate> | null;
|
|
1916
1981
|
|
|
1982
|
+
/**
|
|
1983
|
+
* Flag to determine if individual tokens should be streamed, rather than streaming
|
|
1984
|
+
* per step (only used when streaming=true).
|
|
1985
|
+
*/
|
|
1986
|
+
stream_tokens?: boolean;
|
|
1987
|
+
|
|
1988
|
+
/**
|
|
1989
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
1990
|
+
* returns a complete response.
|
|
1991
|
+
*/
|
|
1992
|
+
streaming?: boolean;
|
|
1993
|
+
|
|
1917
1994
|
/**
|
|
1918
1995
|
* @deprecated Whether the server should parse specific tool call arguments
|
|
1919
1996
|
* (default `send_message`) as `AssistantMessage` objects. Still supported for
|
|
@@ -1961,6 +2038,25 @@ export namespace MessageSendParams {
|
|
|
1961
2038
|
text: string;
|
|
1962
2039
|
}
|
|
1963
2040
|
}
|
|
2041
|
+
|
|
2042
|
+
export type MessageSendParamsNonStreaming = MessagesAPI.MessageSendParamsNonStreaming;
|
|
2043
|
+
export type MessageSendParamsStreaming = MessagesAPI.MessageSendParamsStreaming;
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
export interface MessageSendParamsNonStreaming extends MessageSendParamsBase {
|
|
2047
|
+
/**
|
|
2048
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
2049
|
+
* returns a complete response.
|
|
2050
|
+
*/
|
|
2051
|
+
streaming?: false;
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
export interface MessageSendParamsStreaming extends MessageSendParamsBase {
|
|
2055
|
+
/**
|
|
2056
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
2057
|
+
* returns a complete response.
|
|
2058
|
+
*/
|
|
2059
|
+
streaming: true;
|
|
1964
2060
|
}
|
|
1965
2061
|
|
|
1966
2062
|
export interface MessageSendAsyncParams {
|
|
@@ -2086,7 +2182,8 @@ export interface MessageStreamParams {
|
|
|
2086
2182
|
assistant_message_tool_name?: string;
|
|
2087
2183
|
|
|
2088
2184
|
/**
|
|
2089
|
-
* Whether to process the request in the background
|
|
2185
|
+
* Whether to process the request in the background (only used when
|
|
2186
|
+
* streaming=true).
|
|
2090
2187
|
*/
|
|
2091
2188
|
background?: boolean;
|
|
2092
2189
|
|
|
@@ -2098,7 +2195,7 @@ export interface MessageStreamParams {
|
|
|
2098
2195
|
|
|
2099
2196
|
/**
|
|
2100
2197
|
* Whether to include periodic keepalive ping messages in the stream to prevent
|
|
2101
|
-
* connection timeouts.
|
|
2198
|
+
* connection timeouts (only used when streaming=true).
|
|
2102
2199
|
*/
|
|
2103
2200
|
include_pings?: boolean;
|
|
2104
2201
|
|
|
@@ -2138,10 +2235,16 @@ export interface MessageStreamParams {
|
|
|
2138
2235
|
|
|
2139
2236
|
/**
|
|
2140
2237
|
* Flag to determine if individual tokens should be streamed, rather than streaming
|
|
2141
|
-
* per step.
|
|
2238
|
+
* per step (only used when streaming=true).
|
|
2142
2239
|
*/
|
|
2143
2240
|
stream_tokens?: boolean;
|
|
2144
2241
|
|
|
2242
|
+
/**
|
|
2243
|
+
* If True, returns a streaming response (Server-Sent Events). If False (default),
|
|
2244
|
+
* returns a complete response.
|
|
2245
|
+
*/
|
|
2246
|
+
streaming?: boolean;
|
|
2247
|
+
|
|
2145
2248
|
/**
|
|
2146
2249
|
* @deprecated Whether the server should parse specific tool call arguments
|
|
2147
2250
|
* (default `send_message`) as `AssistantMessage` objects. Still supported for
|
|
@@ -2239,6 +2342,8 @@ export declare namespace Messages {
|
|
|
2239
2342
|
type MessageModifyParams as MessageModifyParams,
|
|
2240
2343
|
type MessageResetParams as MessageResetParams,
|
|
2241
2344
|
type MessageSendParams as MessageSendParams,
|
|
2345
|
+
type MessageSendParamsNonStreaming as MessageSendParamsNonStreaming,
|
|
2346
|
+
type MessageSendParamsStreaming as MessageSendParamsStreaming,
|
|
2242
2347
|
type MessageSendAsyncParams as MessageSendAsyncParams,
|
|
2243
2348
|
type MessageStreamParams as MessageStreamParams,
|
|
2244
2349
|
};
|
|
@@ -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 };
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import * as ModelsAPI from './models/models';
|
|
5
5
|
import { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { ArrayPage, type ArrayPageParams, PagePromise } from '../core/pagination';
|
|
6
7
|
import { RequestOptions } from '../internal/request-options';
|
|
7
8
|
import { path } from '../internal/utils/path';
|
|
8
9
|
|
|
@@ -28,8 +29,8 @@ export class Archives extends APIResource {
|
|
|
28
29
|
list(
|
|
29
30
|
query: ArchiveListParams | null | undefined = {},
|
|
30
31
|
options?: RequestOptions,
|
|
31
|
-
):
|
|
32
|
-
return this._client.
|
|
32
|
+
): PagePromise<ArchivesArrayPage, Archive> {
|
|
33
|
+
return this._client.getAPIList('/v1/archives/', ArrayPage<Archive>, { query, ...options });
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
/**
|
|
@@ -47,6 +48,8 @@ export class Archives extends APIResource {
|
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
export type ArchivesArrayPage = ArrayPage<Archive>;
|
|
52
|
+
|
|
50
53
|
/**
|
|
51
54
|
* Representation of an archive - a collection of archival passages that can be
|
|
52
55
|
* shared between agents.
|
|
@@ -58,6 +61,11 @@ export class Archives extends APIResource {
|
|
|
58
61
|
* archive.
|
|
59
62
|
*/
|
|
60
63
|
export interface Archive {
|
|
64
|
+
/**
|
|
65
|
+
* The human-friendly ID of the Archive
|
|
66
|
+
*/
|
|
67
|
+
id: string;
|
|
68
|
+
|
|
61
69
|
/**
|
|
62
70
|
* The creation date of the archive
|
|
63
71
|
*/
|
|
@@ -73,11 +81,6 @@ export interface Archive {
|
|
|
73
81
|
*/
|
|
74
82
|
name: string;
|
|
75
83
|
|
|
76
|
-
/**
|
|
77
|
-
* The human-friendly ID of the Archive
|
|
78
|
-
*/
|
|
79
|
-
id?: string;
|
|
80
|
-
|
|
81
84
|
/**
|
|
82
85
|
* The id of the user that made this object.
|
|
83
86
|
*/
|
|
@@ -114,8 +117,6 @@ export interface Archive {
|
|
|
114
117
|
*/
|
|
115
118
|
export type VectorDBProvider = 'native' | 'tpuf' | 'pinecone';
|
|
116
119
|
|
|
117
|
-
export type ArchiveListResponse = Array<Archive>;
|
|
118
|
-
|
|
119
120
|
export interface ArchiveCreateParams {
|
|
120
121
|
/**
|
|
121
122
|
* Embedding configuration for the archive
|
|
@@ -127,44 +128,16 @@ export interface ArchiveCreateParams {
|
|
|
127
128
|
description?: string | null;
|
|
128
129
|
}
|
|
129
130
|
|
|
130
|
-
export interface ArchiveListParams {
|
|
131
|
-
/**
|
|
132
|
-
* Archive ID cursor for pagination. Returns archives that come after this archive
|
|
133
|
-
* ID in the specified sort order
|
|
134
|
-
*/
|
|
135
|
-
after?: string | null;
|
|
136
|
-
|
|
131
|
+
export interface ArchiveListParams extends ArrayPageParams {
|
|
137
132
|
/**
|
|
138
133
|
* Only archives attached to this agent ID
|
|
139
134
|
*/
|
|
140
135
|
agent_id?: string | null;
|
|
141
136
|
|
|
142
|
-
/**
|
|
143
|
-
* Archive ID cursor for pagination. Returns archives that come before this archive
|
|
144
|
-
* ID in the specified sort order
|
|
145
|
-
*/
|
|
146
|
-
before?: string | null;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Maximum number of archives to return
|
|
150
|
-
*/
|
|
151
|
-
limit?: number | null;
|
|
152
|
-
|
|
153
137
|
/**
|
|
154
138
|
* Filter by archive name (exact match)
|
|
155
139
|
*/
|
|
156
140
|
name?: string | null;
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Sort order for archives by creation time. 'asc' for oldest first, 'desc' for
|
|
160
|
-
* newest first
|
|
161
|
-
*/
|
|
162
|
-
order?: 'asc' | 'desc';
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Field to sort by
|
|
166
|
-
*/
|
|
167
|
-
order_by?: 'created_at';
|
|
168
141
|
}
|
|
169
142
|
|
|
170
143
|
export interface ArchiveModifyParams {
|
|
@@ -177,7 +150,7 @@ export declare namespace Archives {
|
|
|
177
150
|
export {
|
|
178
151
|
type Archive as Archive,
|
|
179
152
|
type VectorDBProvider as VectorDBProvider,
|
|
180
|
-
type
|
|
153
|
+
type ArchivesArrayPage as ArchivesArrayPage,
|
|
181
154
|
type ArchiveCreateParams as ArchiveCreateParams,
|
|
182
155
|
type ArchiveListParams as ArchiveListParams,
|
|
183
156
|
type ArchiveModifyParams as ArchiveModifyParams,
|