@llamaindex/llama-cloud 2.3.0 → 2.4.1
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 +34 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/beta/agent-data.d.mts +82 -19
- package/resources/beta/agent-data.d.mts.map +1 -1
- package/resources/beta/agent-data.d.ts +82 -19
- package/resources/beta/agent-data.d.ts.map +1 -1
- package/resources/beta/agent-data.js +76 -11
- package/resources/beta/agent-data.js.map +1 -1
- package/resources/beta/agent-data.mjs +76 -11
- package/resources/beta/agent-data.mjs.map +1 -1
- package/resources/beta/batch/batch.d.mts +27 -0
- package/resources/beta/batch/batch.d.mts.map +1 -1
- package/resources/beta/batch/batch.d.ts +27 -0
- package/resources/beta/batch/batch.d.ts.map +1 -1
- package/resources/beta/batch/batch.js +27 -0
- package/resources/beta/batch/batch.js.map +1 -1
- package/resources/beta/batch/batch.mjs +27 -0
- package/resources/beta/batch/batch.mjs.map +1 -1
- package/resources/beta/batch/job-items.d.mts +18 -0
- package/resources/beta/batch/job-items.d.mts.map +1 -1
- package/resources/beta/batch/job-items.d.ts +18 -0
- package/resources/beta/batch/job-items.d.ts.map +1 -1
- package/resources/beta/batch/job-items.js +18 -0
- package/resources/beta/batch/job-items.js.map +1 -1
- package/resources/beta/batch/job-items.mjs +18 -0
- package/resources/beta/batch/job-items.mjs.map +1 -1
- package/resources/beta/beta.d.mts +2 -2
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +2 -2
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/directories/directories.d.mts +34 -0
- package/resources/beta/directories/directories.d.mts.map +1 -1
- package/resources/beta/directories/directories.d.ts +34 -0
- package/resources/beta/directories/directories.d.ts.map +1 -1
- package/resources/beta/directories/directories.js +34 -0
- package/resources/beta/directories/directories.js.map +1 -1
- package/resources/beta/directories/directories.mjs +34 -0
- package/resources/beta/directories/directories.mjs.map +1 -1
- package/resources/beta/directories/files.d.mts +93 -0
- package/resources/beta/directories/files.d.mts.map +1 -1
- package/resources/beta/directories/files.d.ts +93 -0
- package/resources/beta/directories/files.d.ts.map +1 -1
- package/resources/beta/directories/files.js +50 -0
- package/resources/beta/directories/files.js.map +1 -1
- package/resources/beta/directories/files.mjs +50 -0
- package/resources/beta/directories/files.mjs.map +1 -1
- package/resources/beta/index.d.mts +1 -1
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/sheets.d.mts +38 -0
- package/resources/beta/sheets.d.mts.map +1 -1
- package/resources/beta/sheets.d.ts +38 -0
- package/resources/beta/sheets.d.ts.map +1 -1
- package/resources/beta/sheets.js +38 -0
- package/resources/beta/sheets.js.map +1 -1
- package/resources/beta/sheets.mjs +38 -0
- package/resources/beta/sheets.mjs.map +1 -1
- package/resources/beta/split.d.mts +25 -10
- package/resources/beta/split.d.mts.map +1 -1
- package/resources/beta/split.d.ts +25 -10
- package/resources/beta/split.d.ts.map +1 -1
- package/resources/beta/split.js +21 -6
- package/resources/beta/split.js.map +1 -1
- package/resources/beta/split.mjs +21 -6
- package/resources/beta/split.mjs.map +1 -1
- package/resources/classify.d.mts +70 -0
- package/resources/classify.d.mts.map +1 -1
- package/resources/classify.d.ts +70 -0
- package/resources/classify.d.ts.map +1 -1
- package/resources/classify.js +113 -0
- package/resources/classify.js.map +1 -1
- package/resources/classify.mjs +113 -0
- package/resources/classify.mjs.map +1 -1
- package/resources/configurations.d.mts +214 -13
- package/resources/configurations.d.mts.map +1 -1
- package/resources/configurations.d.ts +214 -13
- package/resources/configurations.d.ts.map +1 -1
- package/resources/extract.d.mts +16 -6
- package/resources/extract.d.mts.map +1 -1
- package/resources/extract.d.ts +16 -6
- package/resources/extract.d.ts.map +1 -1
- package/resources/extract.js +14 -1
- package/resources/extract.js.map +1 -1
- package/resources/extract.mjs +14 -1
- package/resources/extract.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/parsing.d.mts +5 -4
- package/resources/parsing.d.mts.map +1 -1
- package/resources/parsing.d.ts +5 -4
- package/resources/parsing.d.ts.map +1 -1
- package/resources/pipelines/documents.d.mts +0 -3
- package/resources/pipelines/documents.d.mts.map +1 -1
- package/resources/pipelines/documents.d.ts +0 -3
- package/resources/pipelines/documents.d.ts.map +1 -1
- package/resources/pipelines/pipelines.d.mts +0 -7
- package/resources/pipelines/pipelines.d.mts.map +1 -1
- package/resources/pipelines/pipelines.d.ts +0 -7
- package/resources/pipelines/pipelines.d.ts.map +1 -1
- package/resources/pipelines/pipelines.js.map +1 -1
- package/resources/pipelines/pipelines.mjs.map +1 -1
- package/resources/retrievers/index.d.mts +1 -1
- package/resources/retrievers/index.d.mts.map +1 -1
- package/resources/retrievers/index.d.ts +1 -1
- package/resources/retrievers/index.d.ts.map +1 -1
- package/resources/retrievers/index.js.map +1 -1
- package/resources/retrievers/index.mjs.map +1 -1
- package/resources/retrievers/retrievers.d.mts +17 -5
- package/resources/retrievers/retrievers.d.mts.map +1 -1
- package/resources/retrievers/retrievers.d.ts +17 -5
- package/resources/retrievers/retrievers.d.ts.map +1 -1
- package/resources/retrievers/retrievers.js +10 -3
- package/resources/retrievers/retrievers.js.map +1 -1
- package/resources/retrievers/retrievers.mjs +10 -3
- package/resources/retrievers/retrievers.mjs.map +1 -1
- package/src/client.ts +2 -0
- package/src/internal/utils/env.ts +2 -2
- package/src/resources/beta/agent-data.ts +94 -28
- package/src/resources/beta/batch/batch.ts +27 -0
- package/src/resources/beta/batch/job-items.ts +18 -0
- package/src/resources/beta/beta.ts +2 -2
- package/src/resources/beta/directories/directories.ts +34 -0
- package/src/resources/beta/directories/files.ts +86 -0
- package/src/resources/beta/index.ts +1 -1
- package/src/resources/beta/sheets.ts +38 -0
- package/src/resources/beta/split.ts +25 -10
- package/src/resources/classify.ts +130 -0
- package/src/resources/configurations.ts +256 -8
- package/src/resources/extract.ts +16 -7
- package/src/resources/index.ts +1 -0
- package/src/resources/parsing.ts +9 -2
- package/src/resources/pipelines/documents.ts +0 -3
- package/src/resources/pipelines/pipelines.ts +0 -7
- package/src/resources/retrievers/index.ts +1 -0
- package/src/resources/retrievers/retrievers.ts +37 -5
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrievers.mjs","sourceRoot":"","sources":["../../src/resources/retrievers/retrievers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,KAAK,YAAY;OAEjB,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,UAAW,SAAQ,WAAW;IAA3C;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"retrievers.mjs","sourceRoot":"","sources":["../../src/resources/retrievers/retrievers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,KAAK,YAAY;OAEjB,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,UAAW,SAAQ,WAAW;IAA3C;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA0F/E,CAAC;IAxFC;;OAEG;IACH,MAAM,CAAC,MAA6B,EAAE,OAAwB;QAC5D,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE;YAC7C,KAAK,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE;YACtC,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,WAAmB,EACnB,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,sBAAsB,WAAW,EAAE,EAAE;YAC/D,KAAK,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE;YACtC,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,IAAI,CACF,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,WAAmB,EACnB,SAAmD,EAAE,EACrD,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,sBAAsB,WAAW,EAAE,EAAE;YAClE,KAAK,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE;YACtC,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,GAAG,CACD,WAAmB,EACnB,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,sBAAsB,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAA6B,EAAE,OAAwB;QAC5D,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE;YACtD,KAAK,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE;YACtC,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAA6B,EAAE,OAAwB;QAC5D,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE;YAC5C,KAAK,EAAE,EAAE,eAAe,EAAE,UAAU,EAAE;YACtC,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -201,6 +201,7 @@ import {
|
|
|
201
201
|
Retriever,
|
|
202
202
|
RetrieverCreate,
|
|
203
203
|
RetrieverCreateParams,
|
|
204
|
+
RetrieverDeleteParams,
|
|
204
205
|
RetrieverGetParams,
|
|
205
206
|
RetrieverListParams,
|
|
206
207
|
RetrieverListResponse,
|
|
@@ -1190,6 +1191,7 @@ export declare namespace LlamaCloud {
|
|
|
1190
1191
|
type RetrieverCreateParams as RetrieverCreateParams,
|
|
1191
1192
|
type RetrieverUpdateParams as RetrieverUpdateParams,
|
|
1192
1193
|
type RetrieverListParams as RetrieverListParams,
|
|
1194
|
+
type RetrieverDeleteParams as RetrieverDeleteParams,
|
|
1193
1195
|
type RetrieverGetParams as RetrieverGetParams,
|
|
1194
1196
|
type RetrieverSearchParams as RetrieverSearchParams,
|
|
1195
1197
|
type RetrieverUpsertParams as RetrieverUpsertParams,
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export const readEnv = (env: string): string | undefined => {
|
|
11
11
|
if (typeof (globalThis as any).process !== 'undefined') {
|
|
12
|
-
return (globalThis as any).process.env?.[env]?.trim()
|
|
12
|
+
return (globalThis as any).process.env?.[env]?.trim() || undefined;
|
|
13
13
|
}
|
|
14
14
|
if (typeof (globalThis as any).Deno !== 'undefined') {
|
|
15
|
-
return (globalThis as any).Deno.env?.get?.(env)?.trim();
|
|
15
|
+
return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
|
|
16
16
|
}
|
|
17
17
|
return undefined;
|
|
18
18
|
};
|
|
@@ -7,8 +7,45 @@ import { RequestOptions } from '../../internal/request-options';
|
|
|
7
7
|
import { path } from '../../internal/utils/path';
|
|
8
8
|
|
|
9
9
|
export class AgentData extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Create new agent data.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const agentData = await client.beta.agentData.create({
|
|
16
|
+
* data: { foo: 'bar' },
|
|
17
|
+
* deployment_name: 'deployment_name',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(params: AgentDataCreateParams, options?: RequestOptions): APIPromise<AgentData> {
|
|
22
|
+
const { organization_id, project_id, ...body } = params;
|
|
23
|
+
return this._client.post('/api/v1/beta/agent-data', {
|
|
24
|
+
query: { organization_id, project_id },
|
|
25
|
+
body,
|
|
26
|
+
...options,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Use {@link create} instead. `agentData` is kept as a
|
|
32
|
+
* backwards-compatible alias for SDK versions that exposed the create
|
|
33
|
+
* endpoint under this name.
|
|
34
|
+
*/
|
|
35
|
+
agentData(params: AgentDataCreateParams, options?: RequestOptions): APIPromise<AgentData> {
|
|
36
|
+
return this.create(params, options);
|
|
37
|
+
}
|
|
38
|
+
|
|
10
39
|
/**
|
|
11
40
|
* Update agent data by ID (overwrites).
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const agentData = await client.beta.agentData.update(
|
|
45
|
+
* 'item_id',
|
|
46
|
+
* { data: { foo: 'bar' } },
|
|
47
|
+
* );
|
|
48
|
+
* ```
|
|
12
49
|
*/
|
|
13
50
|
update(itemID: string, params: AgentDataUpdateParams, options?: RequestOptions): APIPromise<AgentData> {
|
|
14
51
|
const { organization_id, project_id, ...body } = params;
|
|
@@ -21,6 +58,13 @@ export class AgentData extends APIResource {
|
|
|
21
58
|
|
|
22
59
|
/**
|
|
23
60
|
* Delete agent data by ID.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const agentData = await client.beta.agentData.delete(
|
|
65
|
+
* 'item_id',
|
|
66
|
+
* );
|
|
67
|
+
* ```
|
|
24
68
|
*/
|
|
25
69
|
delete(
|
|
26
70
|
itemID: string,
|
|
@@ -34,20 +78,18 @@ export class AgentData extends APIResource {
|
|
|
34
78
|
});
|
|
35
79
|
}
|
|
36
80
|
|
|
37
|
-
/**
|
|
38
|
-
* Create new agent data.
|
|
39
|
-
*/
|
|
40
|
-
agentData(params: AgentDataAgentDataParams, options?: RequestOptions): APIPromise<AgentData> {
|
|
41
|
-
const { organization_id, project_id, ...body } = params;
|
|
42
|
-
return this._client.post('/api/v1/beta/agent-data', {
|
|
43
|
-
query: { organization_id, project_id },
|
|
44
|
-
body,
|
|
45
|
-
...options,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
81
|
/**
|
|
50
82
|
* Aggregate agent data with grouping and optional counting/first item retrieval.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* // Automatically fetches more pages as needed.
|
|
87
|
+
* for await (const agentDataAggregateResponse of client.beta.agentData.aggregate(
|
|
88
|
+
* { deployment_name: 'deployment_name' },
|
|
89
|
+
* )) {
|
|
90
|
+
* // ...
|
|
91
|
+
* }
|
|
92
|
+
* ```
|
|
51
93
|
*/
|
|
52
94
|
aggregate(
|
|
53
95
|
params: AgentDataAggregateParams,
|
|
@@ -63,6 +105,13 @@ export class AgentData extends APIResource {
|
|
|
63
105
|
|
|
64
106
|
/**
|
|
65
107
|
* Bulk delete agent data by query (deployment_name, collection, optional filters).
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* const response = await client.beta.agentData.deleteByQuery({
|
|
112
|
+
* deployment_name: 'deployment_name',
|
|
113
|
+
* });
|
|
114
|
+
* ```
|
|
66
115
|
*/
|
|
67
116
|
deleteByQuery(
|
|
68
117
|
params: AgentDataDeleteByQueryParams,
|
|
@@ -78,6 +127,13 @@ export class AgentData extends APIResource {
|
|
|
78
127
|
|
|
79
128
|
/**
|
|
80
129
|
* Get agent data by ID.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* const agentData = await client.beta.agentData.get(
|
|
134
|
+
* 'item_id',
|
|
135
|
+
* );
|
|
136
|
+
* ```
|
|
81
137
|
*/
|
|
82
138
|
get(
|
|
83
139
|
itemID: string,
|
|
@@ -89,6 +145,16 @@ export class AgentData extends APIResource {
|
|
|
89
145
|
|
|
90
146
|
/**
|
|
91
147
|
* Search agent data with filtering, sorting, and pagination.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* // Automatically fetches more pages as needed.
|
|
152
|
+
* for await (const agentData of client.beta.agentData.search({
|
|
153
|
+
* deployment_name: 'deployment_name',
|
|
154
|
+
* })) {
|
|
155
|
+
* // ...
|
|
156
|
+
* }
|
|
157
|
+
* ```
|
|
92
158
|
*/
|
|
93
159
|
search(
|
|
94
160
|
params: AgentDataSearchParams,
|
|
@@ -147,39 +213,38 @@ export interface AgentDataDeleteByQueryResponse {
|
|
|
147
213
|
deleted_count: number;
|
|
148
214
|
}
|
|
149
215
|
|
|
150
|
-
export interface
|
|
216
|
+
export interface AgentDataCreateParams {
|
|
151
217
|
/**
|
|
152
218
|
* Body param
|
|
153
219
|
*/
|
|
154
220
|
data: { [key: string]: unknown };
|
|
155
221
|
|
|
156
222
|
/**
|
|
157
|
-
*
|
|
223
|
+
* Body param
|
|
158
224
|
*/
|
|
159
|
-
|
|
225
|
+
deployment_name: string;
|
|
160
226
|
|
|
161
227
|
/**
|
|
162
228
|
* Query param
|
|
163
229
|
*/
|
|
164
|
-
project_id?: string | null;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export interface AgentDataDeleteParams {
|
|
168
230
|
organization_id?: string | null;
|
|
169
231
|
|
|
232
|
+
/**
|
|
233
|
+
* Query param
|
|
234
|
+
*/
|
|
170
235
|
project_id?: string | null;
|
|
171
|
-
}
|
|
172
236
|
|
|
173
|
-
export interface AgentDataAgentDataParams {
|
|
174
237
|
/**
|
|
175
238
|
* Body param
|
|
176
239
|
*/
|
|
177
|
-
|
|
240
|
+
collection?: string;
|
|
241
|
+
}
|
|
178
242
|
|
|
243
|
+
export interface AgentDataUpdateParams {
|
|
179
244
|
/**
|
|
180
245
|
* Body param
|
|
181
246
|
*/
|
|
182
|
-
|
|
247
|
+
data: { [key: string]: unknown };
|
|
183
248
|
|
|
184
249
|
/**
|
|
185
250
|
* Query param
|
|
@@ -190,11 +255,12 @@ export interface AgentDataAgentDataParams {
|
|
|
190
255
|
* Query param
|
|
191
256
|
*/
|
|
192
257
|
project_id?: string | null;
|
|
258
|
+
}
|
|
193
259
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
260
|
+
export interface AgentDataDeleteParams {
|
|
261
|
+
organization_id?: string | null;
|
|
262
|
+
|
|
263
|
+
project_id?: string | null;
|
|
198
264
|
}
|
|
199
265
|
|
|
200
266
|
export interface AgentDataAggregateParams extends PaginatedCursorPostParams {
|
|
@@ -409,9 +475,9 @@ export declare namespace AgentData {
|
|
|
409
475
|
type AgentDataDeleteByQueryResponse as AgentDataDeleteByQueryResponse,
|
|
410
476
|
type AgentDataAggregateResponsesPaginatedCursorPost as AgentDataAggregateResponsesPaginatedCursorPost,
|
|
411
477
|
type AgentDataPaginatedCursorPost as AgentDataPaginatedCursorPost,
|
|
478
|
+
type AgentDataCreateParams as AgentDataCreateParams,
|
|
412
479
|
type AgentDataUpdateParams as AgentDataUpdateParams,
|
|
413
480
|
type AgentDataDeleteParams as AgentDataDeleteParams,
|
|
414
|
-
type AgentDataAgentDataParams as AgentDataAgentDataParams,
|
|
415
481
|
type AgentDataAggregateParams as AgentDataAggregateParams,
|
|
416
482
|
type AgentDataDeleteByQueryParams as AgentDataDeleteByQueryParams,
|
|
417
483
|
type AgentDataGetParams as AgentDataGetParams,
|
|
@@ -30,6 +30,13 @@ export class Batch extends APIResource {
|
|
|
30
30
|
* Provide either `directory_id` to process all files in a directory, or `item_ids`
|
|
31
31
|
* for specific items. The job runs asynchronously — poll `GET /batch/{job_id}` for
|
|
32
32
|
* progress.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const batch = await client.beta.batch.create({
|
|
37
|
+
* job_config: {},
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
33
40
|
*/
|
|
34
41
|
create(params: BatchCreateParams, options?: RequestOptions): APIPromise<BatchCreateResponse> {
|
|
35
42
|
const { organization_id, project_id, 'temporal-namespace': temporalNamespace, ...body } = params;
|
|
@@ -49,6 +56,14 @@ export class Batch extends APIResource {
|
|
|
49
56
|
*
|
|
50
57
|
* Filter by `directory_id`, `job_type`, or `status`. Results are paginated with
|
|
51
58
|
* configurable `limit` and `offset`.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* // Automatically fetches more pages as needed.
|
|
63
|
+
* for await (const batchListResponse of client.beta.batch.list()) {
|
|
64
|
+
* // ...
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
52
67
|
*/
|
|
53
68
|
list(
|
|
54
69
|
query: BatchListParams | null | undefined = {},
|
|
@@ -65,6 +80,11 @@ export class Batch extends APIResource {
|
|
|
65
80
|
*
|
|
66
81
|
* Stops processing and marks pending items as cancelled. Items currently being
|
|
67
82
|
* processed may still complete.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const response = await client.beta.batch.cancel('job_id');
|
|
87
|
+
* ```
|
|
68
88
|
*/
|
|
69
89
|
cancel(
|
|
70
90
|
jobID: string,
|
|
@@ -88,6 +108,13 @@ export class Batch extends APIResource {
|
|
|
88
108
|
*
|
|
89
109
|
* Returns current progress percentage, file counts (total, processed, failed,
|
|
90
110
|
* skipped), and timestamps.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* const response = await client.beta.batch.getStatus(
|
|
115
|
+
* 'job_id',
|
|
116
|
+
* );
|
|
117
|
+
* ```
|
|
91
118
|
*/
|
|
92
119
|
getStatus(
|
|
93
120
|
jobID: string,
|
|
@@ -14,6 +14,16 @@ export class JobItems extends APIResource {
|
|
|
14
14
|
*
|
|
15
15
|
* Useful for finding failed items, viewing completed items, or debugging
|
|
16
16
|
* processing issues.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // Automatically fetches more pages as needed.
|
|
21
|
+
* for await (const jobItemListResponse of client.beta.batch.jobItems.list(
|
|
22
|
+
* 'job_id',
|
|
23
|
+
* )) {
|
|
24
|
+
* // ...
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
17
27
|
*/
|
|
18
28
|
list(
|
|
19
29
|
jobID: string,
|
|
@@ -33,6 +43,14 @@ export class JobItems extends APIResource {
|
|
|
33
43
|
* Returns the complete processing history for an item including what operations
|
|
34
44
|
* were performed, parameters used, and where outputs are stored. Optionally filter
|
|
35
45
|
* by `job_type`.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const response =
|
|
50
|
+
* await client.beta.batch.jobItems.getProcessingResults(
|
|
51
|
+
* 'item_id',
|
|
52
|
+
* );
|
|
53
|
+
* ```
|
|
36
54
|
*/
|
|
37
55
|
getProcessingResults(
|
|
38
56
|
itemID: string,
|
|
@@ -4,10 +4,10 @@ import { APIResource } from '../../core/resource';
|
|
|
4
4
|
import * as AgentDataAPI from './agent-data';
|
|
5
5
|
import {
|
|
6
6
|
AgentData,
|
|
7
|
-
AgentDataAgentDataParams,
|
|
8
7
|
AgentDataAggregateParams,
|
|
9
8
|
AgentDataAggregateResponse,
|
|
10
9
|
AgentDataAggregateResponsesPaginatedCursorPost,
|
|
10
|
+
AgentDataCreateParams,
|
|
11
11
|
AgentDataDeleteByQueryParams,
|
|
12
12
|
AgentDataDeleteByQueryResponse,
|
|
13
13
|
AgentDataDeleteParams,
|
|
@@ -94,9 +94,9 @@ export declare namespace Beta {
|
|
|
94
94
|
type AgentDataDeleteByQueryResponse as AgentDataDeleteByQueryResponse,
|
|
95
95
|
type AgentDataAggregateResponsesPaginatedCursorPost as AgentDataAggregateResponsesPaginatedCursorPost,
|
|
96
96
|
type AgentDataPaginatedCursorPost as AgentDataPaginatedCursorPost,
|
|
97
|
+
type AgentDataCreateParams as AgentDataCreateParams,
|
|
97
98
|
type AgentDataUpdateParams as AgentDataUpdateParams,
|
|
98
99
|
type AgentDataDeleteParams as AgentDataDeleteParams,
|
|
99
|
-
type AgentDataAgentDataParams as AgentDataAgentDataParams,
|
|
100
100
|
type AgentDataAggregateParams as AgentDataAggregateParams,
|
|
101
101
|
type AgentDataDeleteByQueryParams as AgentDataDeleteByQueryParams,
|
|
102
102
|
type AgentDataGetParams as AgentDataGetParams,
|
|
@@ -31,6 +31,13 @@ export class Directories extends APIResource {
|
|
|
31
31
|
*
|
|
32
32
|
* If data_source_id is provided, validates that the data source exists and belongs
|
|
33
33
|
* to the same project.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const directory = await client.beta.directories.create({
|
|
38
|
+
* name: 'x',
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
34
41
|
*/
|
|
35
42
|
create(params: DirectoryCreateParams, options?: RequestOptions): APIPromise<DirectoryCreateResponse> {
|
|
36
43
|
const { organization_id, project_id, ...body } = params;
|
|
@@ -43,6 +50,13 @@ export class Directories extends APIResource {
|
|
|
43
50
|
|
|
44
51
|
/**
|
|
45
52
|
* Update directory metadata.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const directory = await client.beta.directories.update(
|
|
57
|
+
* 'directory_id',
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
46
60
|
*/
|
|
47
61
|
update(
|
|
48
62
|
directoryID: string,
|
|
@@ -59,6 +73,14 @@ export class Directories extends APIResource {
|
|
|
59
73
|
|
|
60
74
|
/**
|
|
61
75
|
* List Directories
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* // Automatically fetches more pages as needed.
|
|
80
|
+
* for await (const directoryListResponse of client.beta.directories.list()) {
|
|
81
|
+
* // ...
|
|
82
|
+
* }
|
|
83
|
+
* ```
|
|
62
84
|
*/
|
|
63
85
|
list(
|
|
64
86
|
query: DirectoryListParams | null | undefined = {},
|
|
@@ -72,6 +94,11 @@ export class Directories extends APIResource {
|
|
|
72
94
|
|
|
73
95
|
/**
|
|
74
96
|
* Permanently delete a directory.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* await client.beta.directories.delete('directory_id');
|
|
101
|
+
* ```
|
|
75
102
|
*/
|
|
76
103
|
delete(
|
|
77
104
|
directoryID: string,
|
|
@@ -88,6 +115,13 @@ export class Directories extends APIResource {
|
|
|
88
115
|
|
|
89
116
|
/**
|
|
90
117
|
* Retrieve a directory by its identifier.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* const directory = await client.beta.directories.get(
|
|
122
|
+
* 'directory_id',
|
|
123
|
+
* );
|
|
124
|
+
* ```
|
|
91
125
|
*/
|
|
92
126
|
get(
|
|
93
127
|
directoryID: string,
|
|
@@ -18,6 +18,14 @@ export class Files extends APIResource {
|
|
|
18
18
|
* Note: This endpoint uses directory_file_id (the internal ID). If you're trying
|
|
19
19
|
* to update a file by its unique_id, use the list endpoint with a filter to find
|
|
20
20
|
* the directory_file_id first.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const file = await client.beta.directories.files.update(
|
|
25
|
+
* 'directory_file_id',
|
|
26
|
+
* { path_directory_id: 'directory_id' },
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
21
29
|
*/
|
|
22
30
|
update(
|
|
23
31
|
directoryFileID: string,
|
|
@@ -35,6 +43,16 @@ export class Files extends APIResource {
|
|
|
35
43
|
/**
|
|
36
44
|
* List all files within the specified directory with optional filtering and
|
|
37
45
|
* pagination.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* // Automatically fetches more pages as needed.
|
|
50
|
+
* for await (const fileListResponse of client.beta.directories.files.list(
|
|
51
|
+
* 'directory_id',
|
|
52
|
+
* )) {
|
|
53
|
+
* // ...
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
38
56
|
*/
|
|
39
57
|
list(
|
|
40
58
|
directoryID: string,
|
|
@@ -54,6 +72,14 @@ export class Files extends APIResource {
|
|
|
54
72
|
* Note: This endpoint uses directory_file_id (the internal ID). If you're trying
|
|
55
73
|
* to delete a file by its unique_id, use the list endpoint with a filter to find
|
|
56
74
|
* the directory_file_id first.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* await client.beta.directories.files.delete(
|
|
79
|
+
* 'directory_file_id',
|
|
80
|
+
* { directory_id: 'directory_id' },
|
|
81
|
+
* );
|
|
82
|
+
* ```
|
|
57
83
|
*/
|
|
58
84
|
delete(directoryFileID: string, params: FileDeleteParams, options?: RequestOptions): APIPromise<void> {
|
|
59
85
|
const { directory_id, organization_id, project_id } = params;
|
|
@@ -69,6 +95,14 @@ export class Files extends APIResource {
|
|
|
69
95
|
*
|
|
70
96
|
* The directory must exist and belong to the project passed in. The file_id must
|
|
71
97
|
* be provided and exist in the project.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* const response = await client.beta.directories.files.add(
|
|
102
|
+
* 'directory_id',
|
|
103
|
+
* { file_id: 'file_id' },
|
|
104
|
+
* );
|
|
105
|
+
* ```
|
|
72
106
|
*/
|
|
73
107
|
add(directoryID: string, params: FileAddParams, options?: RequestOptions): APIPromise<FileAddResponse> {
|
|
74
108
|
const { organization_id, project_id, ...body } = params;
|
|
@@ -83,6 +117,14 @@ export class Files extends APIResource {
|
|
|
83
117
|
* Get a file by its directory_file_id within the specified directory. If you're
|
|
84
118
|
* trying to get a file by its unique_id, use the list endpoint with a filter
|
|
85
119
|
* instead.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const file = await client.beta.directories.files.get(
|
|
124
|
+
* 'directory_file_id',
|
|
125
|
+
* { directory_id: 'directory_id' },
|
|
126
|
+
* );
|
|
127
|
+
* ```
|
|
86
128
|
*/
|
|
87
129
|
get(directoryFileID: string, params: FileGetParams, options?: RequestOptions): APIPromise<FileGetResponse> {
|
|
88
130
|
const { directory_id, ...query } = params;
|
|
@@ -98,6 +140,14 @@ export class Files extends APIResource {
|
|
|
98
140
|
* Uploads a file and creates a directory file entry in a single operation. If
|
|
99
141
|
* unique_id or display_name are not provided, they will be derived from the file
|
|
100
142
|
* metadata.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```ts
|
|
146
|
+
* const response = await client.beta.directories.files.upload(
|
|
147
|
+
* 'directory_id',
|
|
148
|
+
* { upload_file: fs.createReadStream('path/to/file') },
|
|
149
|
+
* );
|
|
150
|
+
* ```
|
|
101
151
|
*/
|
|
102
152
|
upload(
|
|
103
153
|
directoryID: string,
|
|
@@ -163,6 +213,11 @@ export interface FileUpdateResponse {
|
|
|
163
213
|
*/
|
|
164
214
|
file_id?: string | null;
|
|
165
215
|
|
|
216
|
+
/**
|
|
217
|
+
* Merged metadata from all sources. Higher-priority sources override lower.
|
|
218
|
+
*/
|
|
219
|
+
metadata?: { [key: string]: string | number | boolean | null };
|
|
220
|
+
|
|
166
221
|
/**
|
|
167
222
|
* Update datetime
|
|
168
223
|
*/
|
|
@@ -218,6 +273,11 @@ export interface FileListResponse {
|
|
|
218
273
|
*/
|
|
219
274
|
file_id?: string | null;
|
|
220
275
|
|
|
276
|
+
/**
|
|
277
|
+
* Merged metadata from all sources. Higher-priority sources override lower.
|
|
278
|
+
*/
|
|
279
|
+
metadata?: { [key: string]: string | number | boolean | null };
|
|
280
|
+
|
|
221
281
|
/**
|
|
222
282
|
* Update datetime
|
|
223
283
|
*/
|
|
@@ -273,6 +333,11 @@ export interface FileAddResponse {
|
|
|
273
333
|
*/
|
|
274
334
|
file_id?: string | null;
|
|
275
335
|
|
|
336
|
+
/**
|
|
337
|
+
* Merged metadata from all sources. Higher-priority sources override lower.
|
|
338
|
+
*/
|
|
339
|
+
metadata?: { [key: string]: string | number | boolean | null };
|
|
340
|
+
|
|
276
341
|
/**
|
|
277
342
|
* Update datetime
|
|
278
343
|
*/
|
|
@@ -328,6 +393,11 @@ export interface FileGetResponse {
|
|
|
328
393
|
*/
|
|
329
394
|
file_id?: string | null;
|
|
330
395
|
|
|
396
|
+
/**
|
|
397
|
+
* Merged metadata from all sources. Higher-priority sources override lower.
|
|
398
|
+
*/
|
|
399
|
+
metadata?: { [key: string]: string | number | boolean | null };
|
|
400
|
+
|
|
331
401
|
/**
|
|
332
402
|
* Update datetime
|
|
333
403
|
*/
|
|
@@ -383,6 +453,11 @@ export interface FileUploadResponse {
|
|
|
383
453
|
*/
|
|
384
454
|
file_id?: string | null;
|
|
385
455
|
|
|
456
|
+
/**
|
|
457
|
+
* Merged metadata from all sources. Higher-priority sources override lower.
|
|
458
|
+
*/
|
|
459
|
+
metadata?: { [key: string]: string | number | boolean | null };
|
|
460
|
+
|
|
386
461
|
/**
|
|
387
462
|
* Update datetime
|
|
388
463
|
*/
|
|
@@ -415,6 +490,12 @@ export interface FileUpdateParams {
|
|
|
415
490
|
*/
|
|
416
491
|
display_name?: string | null;
|
|
417
492
|
|
|
493
|
+
/**
|
|
494
|
+
* Body param: User-defined metadata key-value pairs. Replaces the user metadata
|
|
495
|
+
* layer.
|
|
496
|
+
*/
|
|
497
|
+
metadata?: { [key: string]: string | number | boolean | null } | null;
|
|
498
|
+
|
|
418
499
|
/**
|
|
419
500
|
* Body param: Updated unique identifier.
|
|
420
501
|
*/
|
|
@@ -476,6 +557,11 @@ export interface FileAddParams {
|
|
|
476
557
|
*/
|
|
477
558
|
display_name?: string | null;
|
|
478
559
|
|
|
560
|
+
/**
|
|
561
|
+
* Body param: User-defined metadata key-value pairs to associate with the file.
|
|
562
|
+
*/
|
|
563
|
+
metadata?: { [key: string]: string | number | boolean | null } | null;
|
|
564
|
+
|
|
479
565
|
/**
|
|
480
566
|
* Body param: Unique identifier for the file in the directory. If not provided,
|
|
481
567
|
* will use the file's external_file_id or name.
|
|
@@ -5,9 +5,9 @@ export {
|
|
|
5
5
|
type AgentDataDeleteResponse,
|
|
6
6
|
type AgentDataAggregateResponse,
|
|
7
7
|
type AgentDataDeleteByQueryResponse,
|
|
8
|
+
type AgentDataCreateParams,
|
|
8
9
|
type AgentDataUpdateParams,
|
|
9
10
|
type AgentDataDeleteParams,
|
|
10
|
-
type AgentDataAgentDataParams,
|
|
11
11
|
type AgentDataAggregateParams,
|
|
12
12
|
type AgentDataDeleteByQueryParams,
|
|
13
13
|
type AgentDataGetParams,
|
|
@@ -13,6 +13,13 @@ export class Sheets extends APIResource {
|
|
|
13
13
|
/**
|
|
14
14
|
* Create a spreadsheet parsing job. Experimental: This endpoint is not yet ready
|
|
15
15
|
* for production use and is subject to change at any time.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const sheetsJob = await client.beta.sheets.create({
|
|
20
|
+
* file_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
16
23
|
*/
|
|
17
24
|
create(params: SheetCreateParams, options?: RequestOptions): APIPromise<SheetsJob> {
|
|
18
25
|
const { organization_id, project_id, ...body } = params;
|
|
@@ -26,6 +33,14 @@ export class Sheets extends APIResource {
|
|
|
26
33
|
/**
|
|
27
34
|
* List spreadsheet parsing jobs. Experimental: This endpoint is not yet ready for
|
|
28
35
|
* production use and is subject to change at any time.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* // Automatically fetches more pages as needed.
|
|
40
|
+
* for await (const sheetsJob of client.beta.sheets.list()) {
|
|
41
|
+
* // ...
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
29
44
|
*/
|
|
30
45
|
list(
|
|
31
46
|
query: SheetListParams | null | undefined = {},
|
|
@@ -41,6 +56,13 @@ export class Sheets extends APIResource {
|
|
|
41
56
|
* Delete a spreadsheet parsing job and its associated data. Experimental: This
|
|
42
57
|
* endpoint is not yet ready for production use and is subject to change at any
|
|
43
58
|
* time.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const response = await client.beta.sheets.deleteJob(
|
|
63
|
+
* 'spreadsheet_job_id',
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
44
66
|
*/
|
|
45
67
|
deleteJob(
|
|
46
68
|
spreadsheetJobID: string,
|
|
@@ -63,6 +85,13 @@ export class Sheets extends APIResource {
|
|
|
63
85
|
*
|
|
64
86
|
* Experimental: This endpoint is not yet ready for production use and is subject
|
|
65
87
|
* to change at any time.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* const sheetsJob = await client.beta.sheets.get(
|
|
92
|
+
* 'spreadsheet_job_id',
|
|
93
|
+
* );
|
|
94
|
+
* ```
|
|
66
95
|
*/
|
|
67
96
|
get(
|
|
68
97
|
spreadsheetJobID: string,
|
|
@@ -76,6 +105,15 @@ export class Sheets extends APIResource {
|
|
|
76
105
|
* Generate a presigned URL to download a specific extracted region. Experimental:
|
|
77
106
|
* This endpoint is not yet ready for production use and is subject to change at
|
|
78
107
|
* any time.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* const presignedURL =
|
|
112
|
+
* await client.beta.sheets.getResultTable('table', {
|
|
113
|
+
* spreadsheet_job_id: 'spreadsheet_job_id',
|
|
114
|
+
* region_id: 'region_id',
|
|
115
|
+
* });
|
|
116
|
+
* ```
|
|
79
117
|
*/
|
|
80
118
|
getResultTable(
|
|
81
119
|
regionType: 'table' | 'extra' | 'cell_metadata',
|