@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
|
@@ -4,9 +4,10 @@ import { APIResource } from '../../core/resource';
|
|
|
4
4
|
import * as AgentsAPI from '../agents/agents';
|
|
5
5
|
import * as MessagesAPI from '../agents/messages';
|
|
6
6
|
import * as BatchesMessagesAPI from './messages';
|
|
7
|
-
import { MessageListParams,
|
|
7
|
+
import { MessageListParams, Messages } from './messages';
|
|
8
8
|
import * as RunsAPI from '../runs/runs';
|
|
9
9
|
import { APIPromise } from '../../core/api-promise';
|
|
10
|
+
import { ArrayPage, type ArrayPageParams, PagePromise } from '../../core/pagination';
|
|
10
11
|
import { RequestOptions } from '../../internal/request-options';
|
|
11
12
|
import { path } from '../../internal/utils/path';
|
|
12
13
|
|
|
@@ -36,8 +37,8 @@ export class Batches extends APIResource {
|
|
|
36
37
|
list(
|
|
37
38
|
query: BatchListParams | null | undefined = {},
|
|
38
39
|
options?: RequestOptions,
|
|
39
|
-
):
|
|
40
|
-
return this._client.
|
|
40
|
+
): PagePromise<BatchJobsArrayPage, BatchJob> {
|
|
41
|
+
return this._client.getAPIList('/v1/messages/batches', ArrayPage<BatchJob>, { query, ...options });
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
/**
|
|
@@ -48,11 +49,13 @@ export class Batches extends APIResource {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
export type BatchJobsArrayPage = ArrayPage<BatchJob>;
|
|
53
|
+
|
|
51
54
|
export interface BatchJob {
|
|
52
55
|
/**
|
|
53
56
|
* The human-friendly ID of the Job
|
|
54
57
|
*/
|
|
55
|
-
id
|
|
58
|
+
id: string;
|
|
56
59
|
|
|
57
60
|
/**
|
|
58
61
|
* The agent associated with this job/run.
|
|
@@ -137,8 +140,6 @@ export interface BatchJob {
|
|
|
137
140
|
updated_at?: string | null;
|
|
138
141
|
}
|
|
139
142
|
|
|
140
|
-
export type BatchListResponse = Array<BatchJob>;
|
|
141
|
-
|
|
142
143
|
export type BatchCancelResponse = unknown;
|
|
143
144
|
|
|
144
145
|
export interface BatchCreateParams {
|
|
@@ -268,50 +269,18 @@ export namespace BatchCreateParams {
|
|
|
268
269
|
}
|
|
269
270
|
}
|
|
270
271
|
|
|
271
|
-
export interface BatchListParams {
|
|
272
|
-
/**
|
|
273
|
-
* Job ID cursor for pagination. Returns jobs that come after this job ID in the
|
|
274
|
-
* specified sort order
|
|
275
|
-
*/
|
|
276
|
-
after?: string | null;
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Job ID cursor for pagination. Returns jobs that come before this job ID in the
|
|
280
|
-
* specified sort order
|
|
281
|
-
*/
|
|
282
|
-
before?: string | null;
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* Maximum number of jobs to return
|
|
286
|
-
*/
|
|
287
|
-
limit?: number | null;
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest
|
|
291
|
-
* first
|
|
292
|
-
*/
|
|
293
|
-
order?: 'asc' | 'desc';
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Field to sort by
|
|
297
|
-
*/
|
|
298
|
-
order_by?: 'created_at';
|
|
299
|
-
}
|
|
272
|
+
export interface BatchListParams extends ArrayPageParams {}
|
|
300
273
|
|
|
301
274
|
Batches.Messages = Messages;
|
|
302
275
|
|
|
303
276
|
export declare namespace Batches {
|
|
304
277
|
export {
|
|
305
278
|
type BatchJob as BatchJob,
|
|
306
|
-
type BatchListResponse as BatchListResponse,
|
|
307
279
|
type BatchCancelResponse as BatchCancelResponse,
|
|
280
|
+
type BatchJobsArrayPage as BatchJobsArrayPage,
|
|
308
281
|
type BatchCreateParams as BatchCreateParams,
|
|
309
282
|
type BatchListParams as BatchListParams,
|
|
310
283
|
};
|
|
311
284
|
|
|
312
|
-
export {
|
|
313
|
-
Messages as Messages,
|
|
314
|
-
type MessageListResponse as MessageListResponse,
|
|
315
|
-
type MessageListParams as MessageListParams,
|
|
316
|
-
};
|
|
285
|
+
export { Messages as Messages, type MessageListParams as MessageListParams };
|
|
317
286
|
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
export {
|
|
4
4
|
Batches,
|
|
5
5
|
type BatchJob,
|
|
6
|
-
type BatchListResponse,
|
|
7
6
|
type BatchCancelResponse,
|
|
8
7
|
type BatchCreateParams,
|
|
9
8
|
type BatchListParams,
|
|
9
|
+
type BatchJobsArrayPage,
|
|
10
10
|
} from './batches';
|
|
11
|
-
export { Messages, type
|
|
11
|
+
export { Messages, type MessageListParams } from './messages';
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as MessagesAPI from '../agents/messages';
|
|
5
|
-
import {
|
|
5
|
+
import { MessagesObjectPage } from '../agents/messages';
|
|
6
|
+
import { ObjectPage, type ObjectPageParams, PagePromise } from '../../core/pagination';
|
|
6
7
|
import { RequestOptions } from '../../internal/request-options';
|
|
7
8
|
import { path } from '../../internal/utils/path';
|
|
8
9
|
|
|
@@ -14,50 +15,24 @@ export class Messages extends APIResource {
|
|
|
14
15
|
batchID: string,
|
|
15
16
|
query: MessageListParams | null | undefined = {},
|
|
16
17
|
options?: RequestOptions,
|
|
17
|
-
):
|
|
18
|
-
return this._client.
|
|
18
|
+
): PagePromise<MessagesObjectPage, MessagesAPI.Message> {
|
|
19
|
+
return this._client.getAPIList(
|
|
20
|
+
path`/v1/messages/batches/${batchID}/messages`,
|
|
21
|
+
ObjectPage<MessagesAPI.Message>,
|
|
22
|
+
{ query, ...options },
|
|
23
|
+
);
|
|
19
24
|
}
|
|
20
25
|
}
|
|
21
26
|
|
|
22
|
-
export interface
|
|
23
|
-
messages: Array<MessagesAPI.Message>;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface MessageListParams {
|
|
27
|
-
/**
|
|
28
|
-
* Message ID cursor for pagination. Returns messages that come after this message
|
|
29
|
-
* ID in the specified sort order
|
|
30
|
-
*/
|
|
31
|
-
after?: string | null;
|
|
32
|
-
|
|
27
|
+
export interface MessageListParams extends ObjectPageParams {
|
|
33
28
|
/**
|
|
34
29
|
* Filter messages by agent ID
|
|
35
30
|
*/
|
|
36
31
|
agent_id?: string | null;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Message ID cursor for pagination. Returns messages that come before this message
|
|
40
|
-
* ID in the specified sort order
|
|
41
|
-
*/
|
|
42
|
-
before?: string | null;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Maximum number of messages to return
|
|
46
|
-
*/
|
|
47
|
-
limit?: number | null;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Sort order for messages by creation time. 'asc' for oldest first, 'desc' for
|
|
51
|
-
* newest first
|
|
52
|
-
*/
|
|
53
|
-
order?: 'asc' | 'desc';
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Field to sort by
|
|
57
|
-
*/
|
|
58
|
-
order_by?: 'created_at';
|
|
59
32
|
}
|
|
60
33
|
|
|
61
34
|
export declare namespace Messages {
|
|
62
|
-
export { type
|
|
35
|
+
export { type MessageListParams as MessageListParams };
|
|
63
36
|
}
|
|
37
|
+
|
|
38
|
+
export { type MessagesObjectPage };
|
|
@@ -42,13 +42,6 @@ export class Blocks extends APIResource {
|
|
|
42
42
|
return this._client.delete(path`/v1/blocks/${blockID}`, options);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
/**
|
|
46
|
-
* Count all blocks created by a user.
|
|
47
|
-
*/
|
|
48
|
-
count(options?: RequestOptions): APIPromise<BlockCountResponse> {
|
|
49
|
-
return this._client.get('/v1/blocks/count', options);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
45
|
/**
|
|
53
46
|
* Modify Block
|
|
54
47
|
*/
|
|
@@ -230,8 +223,6 @@ export interface CreateBlock {
|
|
|
230
223
|
|
|
231
224
|
export type BlockDeleteResponse = unknown;
|
|
232
225
|
|
|
233
|
-
export type BlockCountResponse = number;
|
|
234
|
-
|
|
235
226
|
export interface BlockCreateParams {
|
|
236
227
|
/**
|
|
237
228
|
* Label of the block.
|
|
@@ -457,7 +448,6 @@ export declare namespace Blocks {
|
|
|
457
448
|
type BlockResponse as BlockResponse,
|
|
458
449
|
type CreateBlock as CreateBlock,
|
|
459
450
|
type BlockDeleteResponse as BlockDeleteResponse,
|
|
460
|
-
type BlockCountResponse as BlockCountResponse,
|
|
461
451
|
type BlockResponsesArrayPage as BlockResponsesArrayPage,
|
|
462
452
|
type BlockCreateParams as BlockCreateParams,
|
|
463
453
|
type BlockListParams as BlockListParams,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { ArrayPage, type ArrayPageParams, PagePromise } from '../../core/pagination';
|
|
5
6
|
import { type Uploadable } from '../../core/uploads';
|
|
6
7
|
import { buildHeaders } from '../../internal/headers';
|
|
7
8
|
import { RequestOptions } from '../../internal/request-options';
|
|
@@ -16,8 +17,11 @@ export class Files extends APIResource {
|
|
|
16
17
|
folderID: string,
|
|
17
18
|
query: FileListParams | null | undefined = {},
|
|
18
19
|
options?: RequestOptions,
|
|
19
|
-
):
|
|
20
|
-
return this._client.
|
|
20
|
+
): PagePromise<FileListResponsesArrayPage, FileListResponse> {
|
|
21
|
+
return this._client.getAPIList(path`/v1/folders/${folderID}/files`, ArrayPage<FileListResponse>, {
|
|
22
|
+
query,
|
|
23
|
+
...options,
|
|
24
|
+
});
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
/**
|
|
@@ -47,110 +51,21 @@ export class Files extends APIResource {
|
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
|
|
50
|
-
export type
|
|
51
|
-
|
|
52
|
-
export namespace FileListResponse {
|
|
53
|
-
/**
|
|
54
|
-
* Representation of a single FileMetadata
|
|
55
|
-
*/
|
|
56
|
-
export interface FileListResponseItem {
|
|
57
|
-
/**
|
|
58
|
-
* The unique identifier of the source associated with the document.
|
|
59
|
-
*/
|
|
60
|
-
source_id: string;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* The human-friendly ID of the File
|
|
64
|
-
*/
|
|
65
|
-
id?: string;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Number of chunks that have been embedded.
|
|
69
|
-
*/
|
|
70
|
-
chunks_embedded?: number | null;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Optional full-text content of the file; only populated on demand due to its
|
|
74
|
-
* size.
|
|
75
|
-
*/
|
|
76
|
-
content?: string | null;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* The creation date of the file.
|
|
80
|
-
*/
|
|
81
|
-
created_at?: string | null;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Optional error message if the file failed processing.
|
|
85
|
-
*/
|
|
86
|
-
error_message?: string | null;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* The creation date of the file.
|
|
90
|
-
*/
|
|
91
|
-
file_creation_date?: string | null;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* The last modified date of the file.
|
|
95
|
-
*/
|
|
96
|
-
file_last_modified_date?: string | null;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* The name of the file.
|
|
100
|
-
*/
|
|
101
|
-
file_name?: string | null;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* The path to the file.
|
|
105
|
-
*/
|
|
106
|
-
file_path?: string | null;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* The size of the file in bytes.
|
|
110
|
-
*/
|
|
111
|
-
file_size?: number | null;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* The type of the file (MIME type).
|
|
115
|
-
*/
|
|
116
|
-
file_type?: string | null;
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* The original name of the file as uploaded.
|
|
120
|
-
*/
|
|
121
|
-
original_file_name?: string | null;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* The current processing status of the file (e.g. pending, parsing, embedding,
|
|
125
|
-
* completed, error).
|
|
126
|
-
*/
|
|
127
|
-
processing_status?: 'pending' | 'parsing' | 'embedding' | 'completed' | 'error';
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Total number of chunks for the file.
|
|
131
|
-
*/
|
|
132
|
-
total_chunks?: number | null;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* The update date of the file.
|
|
136
|
-
*/
|
|
137
|
-
updated_at?: string | null;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
54
|
+
export type FileListResponsesArrayPage = ArrayPage<FileListResponse>;
|
|
140
55
|
|
|
141
56
|
/**
|
|
142
57
|
* Representation of a single FileMetadata
|
|
143
58
|
*/
|
|
144
|
-
export interface
|
|
59
|
+
export interface FileListResponse {
|
|
145
60
|
/**
|
|
146
|
-
* The
|
|
61
|
+
* The human-friendly ID of the File
|
|
147
62
|
*/
|
|
148
|
-
|
|
63
|
+
id: string;
|
|
149
64
|
|
|
150
65
|
/**
|
|
151
|
-
* The
|
|
66
|
+
* The unique identifier of the source associated with the document.
|
|
152
67
|
*/
|
|
153
|
-
|
|
68
|
+
source_id: string;
|
|
154
69
|
|
|
155
70
|
/**
|
|
156
71
|
* Number of chunks that have been embedded.
|
|
@@ -225,39 +140,98 @@ export interface FileUploadResponse {
|
|
|
225
140
|
updated_at?: string | null;
|
|
226
141
|
}
|
|
227
142
|
|
|
228
|
-
|
|
143
|
+
/**
|
|
144
|
+
* Representation of a single FileMetadata
|
|
145
|
+
*/
|
|
146
|
+
export interface FileUploadResponse {
|
|
229
147
|
/**
|
|
230
|
-
*
|
|
231
|
-
* specified sort order
|
|
148
|
+
* The human-friendly ID of the File
|
|
232
149
|
*/
|
|
233
|
-
|
|
150
|
+
id: string;
|
|
234
151
|
|
|
235
152
|
/**
|
|
236
|
-
*
|
|
237
|
-
* the specified sort order
|
|
153
|
+
* The unique identifier of the source associated with the document.
|
|
238
154
|
*/
|
|
239
|
-
|
|
155
|
+
source_id: string;
|
|
240
156
|
|
|
241
157
|
/**
|
|
242
|
-
*
|
|
158
|
+
* Number of chunks that have been embedded.
|
|
243
159
|
*/
|
|
244
|
-
|
|
160
|
+
chunks_embedded?: number | null;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Optional full-text content of the file; only populated on demand due to its
|
|
164
|
+
* size.
|
|
165
|
+
*/
|
|
166
|
+
content?: string | null;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* The creation date of the file.
|
|
170
|
+
*/
|
|
171
|
+
created_at?: string | null;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Optional error message if the file failed processing.
|
|
175
|
+
*/
|
|
176
|
+
error_message?: string | null;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The creation date of the file.
|
|
180
|
+
*/
|
|
181
|
+
file_creation_date?: string | null;
|
|
245
182
|
|
|
246
183
|
/**
|
|
247
|
-
*
|
|
184
|
+
* The last modified date of the file.
|
|
185
|
+
*/
|
|
186
|
+
file_last_modified_date?: string | null;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* The name of the file.
|
|
190
|
+
*/
|
|
191
|
+
file_name?: string | null;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The path to the file.
|
|
248
195
|
*/
|
|
249
|
-
|
|
196
|
+
file_path?: string | null;
|
|
250
197
|
|
|
251
198
|
/**
|
|
252
|
-
*
|
|
253
|
-
* first
|
|
199
|
+
* The size of the file in bytes.
|
|
254
200
|
*/
|
|
255
|
-
|
|
201
|
+
file_size?: number | null;
|
|
256
202
|
|
|
257
203
|
/**
|
|
258
|
-
*
|
|
204
|
+
* The type of the file (MIME type).
|
|
259
205
|
*/
|
|
260
|
-
|
|
206
|
+
file_type?: string | null;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* The original name of the file as uploaded.
|
|
210
|
+
*/
|
|
211
|
+
original_file_name?: string | null;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* The current processing status of the file (e.g. pending, parsing, embedding,
|
|
215
|
+
* completed, error).
|
|
216
|
+
*/
|
|
217
|
+
processing_status?: 'pending' | 'parsing' | 'embedding' | 'completed' | 'error';
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Total number of chunks for the file.
|
|
221
|
+
*/
|
|
222
|
+
total_chunks?: number | null;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* The update date of the file.
|
|
226
|
+
*/
|
|
227
|
+
updated_at?: string | null;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export interface FileListParams extends ArrayPageParams {
|
|
231
|
+
/**
|
|
232
|
+
* Whether to include full file content
|
|
233
|
+
*/
|
|
234
|
+
include_content?: boolean;
|
|
261
235
|
}
|
|
262
236
|
|
|
263
237
|
export interface FileDeleteParams {
|
|
@@ -288,6 +262,7 @@ export declare namespace Files {
|
|
|
288
262
|
export {
|
|
289
263
|
type FileListResponse as FileListResponse,
|
|
290
264
|
type FileUploadResponse as FileUploadResponse,
|
|
265
|
+
type FileListResponsesArrayPage as FileListResponsesArrayPage,
|
|
291
266
|
type FileListParams as FileListParams,
|
|
292
267
|
type FileDeleteParams as FileDeleteParams,
|
|
293
268
|
type FileUploadParams as FileUploadParams,
|
|
@@ -8,12 +8,14 @@ import {
|
|
|
8
8
|
FileDeleteParams,
|
|
9
9
|
FileListParams,
|
|
10
10
|
FileListResponse,
|
|
11
|
+
FileListResponsesArrayPage,
|
|
11
12
|
FileUploadParams,
|
|
12
13
|
FileUploadResponse,
|
|
13
14
|
Files,
|
|
14
15
|
} from './files';
|
|
15
16
|
import * as ModelsAPI from '../models/models';
|
|
16
17
|
import { APIPromise } from '../../core/api-promise';
|
|
18
|
+
import { ArrayPage, type ArrayPageParams, PagePromise } from '../../core/pagination';
|
|
17
19
|
import { RequestOptions } from '../../internal/request-options';
|
|
18
20
|
import { path } from '../../internal/utils/path';
|
|
19
21
|
|
|
@@ -41,8 +43,8 @@ export class Folders extends APIResource {
|
|
|
41
43
|
list(
|
|
42
44
|
query: FolderListParams | null | undefined = {},
|
|
43
45
|
options?: RequestOptions,
|
|
44
|
-
):
|
|
45
|
-
return this._client.
|
|
46
|
+
): PagePromise<FoldersArrayPage, Folder> {
|
|
47
|
+
return this._client.getAPIList('/v1/folders/', ArrayPage<Folder>, { query, ...options });
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
/**
|
|
@@ -52,13 +54,6 @@ export class Folders extends APIResource {
|
|
|
52
54
|
return this._client.delete(path`/v1/folders/${folderID}`, options);
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
/**
|
|
56
|
-
* Count all data folders created by a user.
|
|
57
|
-
*/
|
|
58
|
-
count(options?: RequestOptions): APIPromise<FolderCountResponse> {
|
|
59
|
-
return this._client.get('/v1/folders/count', options);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
57
|
/**
|
|
63
58
|
* Update the name or documentation of an existing data folder.
|
|
64
59
|
*/
|
|
@@ -67,6 +62,8 @@ export class Folders extends APIResource {
|
|
|
67
62
|
}
|
|
68
63
|
}
|
|
69
64
|
|
|
65
|
+
export type FoldersArrayPage = ArrayPage<Folder>;
|
|
66
|
+
|
|
70
67
|
/**
|
|
71
68
|
* Representation of a folder, which is a collection of files and passages.
|
|
72
69
|
*
|
|
@@ -77,6 +74,11 @@ export class Folders extends APIResource {
|
|
|
77
74
|
* of the folder.
|
|
78
75
|
*/
|
|
79
76
|
export interface Folder {
|
|
77
|
+
/**
|
|
78
|
+
* The human-friendly ID of the Source
|
|
79
|
+
*/
|
|
80
|
+
id: string;
|
|
81
|
+
|
|
80
82
|
/**
|
|
81
83
|
* The embedding configuration used by the folder.
|
|
82
84
|
*/
|
|
@@ -87,11 +89,6 @@ export interface Folder {
|
|
|
87
89
|
*/
|
|
88
90
|
name: string;
|
|
89
91
|
|
|
90
|
-
/**
|
|
91
|
-
* The human-friendly ID of the Source
|
|
92
|
-
*/
|
|
93
|
-
id?: string;
|
|
94
|
-
|
|
95
92
|
/**
|
|
96
93
|
* The timestamp when the folder was created.
|
|
97
94
|
*/
|
|
@@ -128,12 +125,8 @@ export interface Folder {
|
|
|
128
125
|
updated_at?: string | null;
|
|
129
126
|
}
|
|
130
127
|
|
|
131
|
-
export type FolderListResponse = Array<Folder>;
|
|
132
|
-
|
|
133
128
|
export type FolderDeleteResponse = unknown;
|
|
134
129
|
|
|
135
|
-
export type FolderCountResponse = number;
|
|
136
|
-
|
|
137
130
|
export interface FolderCreateParams {
|
|
138
131
|
/**
|
|
139
132
|
* The name of the source.
|
|
@@ -171,39 +164,11 @@ export interface FolderCreateParams {
|
|
|
171
164
|
metadata?: { [key: string]: unknown } | null;
|
|
172
165
|
}
|
|
173
166
|
|
|
174
|
-
export interface FolderListParams {
|
|
175
|
-
/**
|
|
176
|
-
* Folder ID cursor for pagination. Returns folders that come after this folder ID
|
|
177
|
-
* in the specified sort order
|
|
178
|
-
*/
|
|
179
|
-
after?: string | null;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Folder ID cursor for pagination. Returns folders that come before this folder ID
|
|
183
|
-
* in the specified sort order
|
|
184
|
-
*/
|
|
185
|
-
before?: string | null;
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Maximum number of folders to return
|
|
189
|
-
*/
|
|
190
|
-
limit?: number | null;
|
|
191
|
-
|
|
167
|
+
export interface FolderListParams extends ArrayPageParams {
|
|
192
168
|
/**
|
|
193
169
|
* Folder name to filter by
|
|
194
170
|
*/
|
|
195
171
|
name?: string | null;
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Sort order for folders by creation time. 'asc' for oldest first, 'desc' for
|
|
199
|
-
* newest first
|
|
200
|
-
*/
|
|
201
|
-
order?: 'asc' | 'desc';
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Field to sort by
|
|
205
|
-
*/
|
|
206
|
-
order_by?: 'created_at';
|
|
207
172
|
}
|
|
208
173
|
|
|
209
174
|
export interface FolderModifyParams {
|
|
@@ -239,9 +204,8 @@ Folders.Agents = Agents;
|
|
|
239
204
|
export declare namespace Folders {
|
|
240
205
|
export {
|
|
241
206
|
type Folder as Folder,
|
|
242
|
-
type FolderListResponse as FolderListResponse,
|
|
243
207
|
type FolderDeleteResponse as FolderDeleteResponse,
|
|
244
|
-
type
|
|
208
|
+
type FoldersArrayPage as FoldersArrayPage,
|
|
245
209
|
type FolderCreateParams as FolderCreateParams,
|
|
246
210
|
type FolderListParams as FolderListParams,
|
|
247
211
|
type FolderModifyParams as FolderModifyParams,
|
|
@@ -251,6 +215,7 @@ export declare namespace Folders {
|
|
|
251
215
|
Files as Files,
|
|
252
216
|
type FileListResponse as FileListResponse,
|
|
253
217
|
type FileUploadResponse as FileUploadResponse,
|
|
218
|
+
type FileListResponsesArrayPage as FileListResponsesArrayPage,
|
|
254
219
|
type FileListParams as FileListParams,
|
|
255
220
|
type FileDeleteParams as FileDeleteParams,
|
|
256
221
|
type FileUploadParams as FileUploadParams,
|
|
@@ -8,14 +8,14 @@ export {
|
|
|
8
8
|
type FileListParams,
|
|
9
9
|
type FileDeleteParams,
|
|
10
10
|
type FileUploadParams,
|
|
11
|
+
type FileListResponsesArrayPage,
|
|
11
12
|
} from './files';
|
|
12
13
|
export {
|
|
13
14
|
Folders,
|
|
14
15
|
type Folder,
|
|
15
|
-
type FolderListResponse,
|
|
16
16
|
type FolderDeleteResponse,
|
|
17
|
-
type FolderCountResponse,
|
|
18
17
|
type FolderCreateParams,
|
|
19
18
|
type FolderListParams,
|
|
20
19
|
type FolderModifyParams,
|
|
20
|
+
type FoldersArrayPage,
|
|
21
21
|
} from './folders';
|
|
@@ -51,13 +51,6 @@ export class Groups extends APIResource {
|
|
|
51
51
|
return this._client.delete(path`/v1/groups/${groupID}`, options);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
/**
|
|
55
|
-
* Get the count of all groups associated with a given user.
|
|
56
|
-
*/
|
|
57
|
-
count(options?: RequestOptions): APIPromise<GroupCountResponse> {
|
|
58
|
-
return this._client.get('/v1/groups/count', options);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
54
|
/**
|
|
62
55
|
* Create a new multi-agent group with the specified configuration.
|
|
63
56
|
*/
|
|
@@ -195,8 +188,6 @@ export interface VoiceSleeptimeManager {
|
|
|
195
188
|
|
|
196
189
|
export type GroupDeleteResponse = unknown;
|
|
197
190
|
|
|
198
|
-
export type GroupCountResponse = number;
|
|
199
|
-
|
|
200
191
|
export interface GroupCreateParams {
|
|
201
192
|
agent_ids: Array<string>;
|
|
202
193
|
|
|
@@ -324,7 +315,6 @@ export declare namespace Groups {
|
|
|
324
315
|
type SupervisorManager as SupervisorManager,
|
|
325
316
|
type VoiceSleeptimeManager as VoiceSleeptimeManager,
|
|
326
317
|
type GroupDeleteResponse as GroupDeleteResponse,
|
|
327
|
-
type GroupCountResponse as GroupCountResponse,
|
|
328
318
|
type GroupsArrayPage as GroupsArrayPage,
|
|
329
319
|
type GroupCreateParams as GroupCreateParams,
|
|
330
320
|
type GroupListParams as GroupListParams,
|