@llamaindex/llama-cloud 1.8.0 → 2.1.0
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 +72 -0
- package/README.md +10 -8
- package/client.d.mts +4 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -6
- package/client.d.ts.map +1 -1
- package/client.js +7 -6
- package/client.js.map +1 -1
- package/client.mjs +7 -6
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +0 -23
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +0 -23
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +1 -32
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +0 -30
- package/core/pagination.mjs.map +1 -1
- package/package.json +12 -1
- package/resources/beta/batch/batch.d.mts +55 -30
- package/resources/beta/batch/batch.d.mts.map +1 -1
- package/resources/beta/batch/batch.d.ts +55 -30
- package/resources/beta/batch/batch.d.ts.map +1 -1
- package/resources/beta/batch/batch.js +14 -11
- package/resources/beta/batch/batch.js.map +1 -1
- package/resources/beta/batch/batch.mjs +14 -11
- package/resources/beta/batch/batch.mjs.map +1 -1
- package/resources/beta/batch/job-items.d.mts +36 -13
- package/resources/beta/batch/job-items.d.mts.map +1 -1
- package/resources/beta/batch/job-items.d.ts +36 -13
- package/resources/beta/batch/job-items.d.ts.map +1 -1
- package/resources/beta/batch/job-items.js +6 -8
- package/resources/beta/batch/job-items.js.map +1 -1
- package/resources/beta/batch/job-items.mjs +6 -8
- package/resources/beta/batch/job-items.mjs.map +1 -1
- package/resources/beta/parse-configurations.d.mts +7 -9
- package/resources/beta/parse-configurations.d.mts.map +1 -1
- package/resources/beta/parse-configurations.d.ts +7 -9
- package/resources/beta/parse-configurations.d.ts.map +1 -1
- package/resources/beta/parse-configurations.js +7 -9
- package/resources/beta/parse-configurations.js.map +1 -1
- package/resources/beta/parse-configurations.mjs +7 -9
- package/resources/beta/parse-configurations.mjs.map +1 -1
- package/resources/beta/sheets.d.mts +16 -0
- package/resources/beta/sheets.d.mts.map +1 -1
- package/resources/beta/sheets.d.ts +16 -0
- package/resources/beta/sheets.d.ts.map +1 -1
- package/resources/beta/split.d.mts +60 -16
- package/resources/beta/split.d.mts.map +1 -1
- package/resources/beta/split.d.ts +60 -16
- package/resources/beta/split.d.ts.map +1 -1
- package/resources/beta/split.js.map +1 -1
- package/resources/beta/split.mjs.map +1 -1
- package/resources/classifier/jobs.d.mts +12 -3
- package/resources/classifier/jobs.d.mts.map +1 -1
- package/resources/classifier/jobs.d.ts +12 -3
- package/resources/classifier/jobs.d.ts.map +1 -1
- package/resources/classify.d.mts +93 -38
- package/resources/classify.d.mts.map +1 -1
- package/resources/classify.d.ts +93 -38
- package/resources/classify.d.ts.map +1 -1
- package/resources/classify.js +19 -2
- package/resources/classify.js.map +1 -1
- package/resources/classify.mjs +19 -2
- package/resources/classify.mjs.map +1 -1
- package/resources/extract.d.mts +1593 -0
- package/resources/extract.d.mts.map +1 -0
- package/resources/extract.d.ts +1593 -0
- package/resources/extract.d.ts.map +1 -0
- package/resources/extract.js +215 -0
- package/resources/extract.js.map +1 -0
- package/resources/extract.mjs +211 -0
- package/resources/extract.mjs.map +1 -0
- package/resources/files.d.mts +53 -39
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +53 -39
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +11 -10
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +11 -10
- package/resources/files.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 +3 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/parsing.d.mts +292 -138
- package/resources/parsing.d.mts.map +1 -1
- package/resources/parsing.d.ts +292 -138
- package/resources/parsing.d.ts.map +1 -1
- package/resources/parsing.js +30 -4
- package/resources/parsing.js.map +1 -1
- package/resources/parsing.mjs +30 -4
- package/resources/parsing.mjs.map +1 -1
- package/resources/pipelines/pipelines.d.mts +59 -13
- package/resources/pipelines/pipelines.d.mts.map +1 -1
- package/resources/pipelines/pipelines.d.ts +59 -13
- package/resources/pipelines/pipelines.d.ts.map +1 -1
- package/resources/pipelines/pipelines.js +24 -9
- package/resources/pipelines/pipelines.js.map +1 -1
- package/resources/pipelines/pipelines.mjs +24 -9
- package/resources/pipelines/pipelines.mjs.map +1 -1
- package/resources/pipelines/sync.d.mts +5 -3
- package/resources/pipelines/sync.d.mts.map +1 -1
- package/resources/pipelines/sync.d.ts +5 -3
- package/resources/pipelines/sync.d.ts.map +1 -1
- package/resources/pipelines/sync.js +5 -3
- package/resources/pipelines/sync.js.map +1 -1
- package/resources/pipelines/sync.mjs +5 -3
- package/resources/pipelines/sync.mjs.map +1 -1
- package/src/client.ts +50 -15
- package/src/core/pagination.ts +0 -71
- package/src/resources/beta/batch/batch.ts +75 -30
- package/src/resources/beta/batch/job-items.ts +56 -13
- package/src/resources/beta/parse-configurations.ts +7 -9
- package/src/resources/beta/sheets.ts +20 -0
- package/src/resources/beta/split.ts +70 -17
- package/src/resources/classifier/jobs.ts +12 -3
- package/src/resources/classify.ts +101 -38
- package/src/resources/extract.ts +2055 -0
- package/src/resources/files.ts +53 -39
- package/src/resources/index.ts +22 -1
- package/src/resources/parsing.ts +327 -136
- package/src/resources/pipelines/pipelines.ts +80 -14
- package/src/resources/pipelines/sync.ts +5 -3
- 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/extraction/extraction-agents/extraction-agents.d.mts +0 -126
- package/resources/extraction/extraction-agents/extraction-agents.d.mts.map +0 -1
- package/resources/extraction/extraction-agents/extraction-agents.d.ts +0 -126
- package/resources/extraction/extraction-agents/extraction-agents.d.ts.map +0 -1
- package/resources/extraction/extraction-agents/extraction-agents.js +0 -56
- package/resources/extraction/extraction-agents/extraction-agents.js.map +0 -1
- package/resources/extraction/extraction-agents/extraction-agents.mjs +0 -51
- package/resources/extraction/extraction-agents/extraction-agents.mjs.map +0 -1
- package/resources/extraction/extraction-agents/index.d.mts +0 -3
- package/resources/extraction/extraction-agents/index.d.mts.map +0 -1
- package/resources/extraction/extraction-agents/index.d.ts +0 -3
- package/resources/extraction/extraction-agents/index.d.ts.map +0 -1
- package/resources/extraction/extraction-agents/index.js +0 -9
- package/resources/extraction/extraction-agents/index.js.map +0 -1
- package/resources/extraction/extraction-agents/index.mjs +0 -4
- package/resources/extraction/extraction-agents/index.mjs.map +0 -1
- package/resources/extraction/extraction-agents/schema.d.mts +0 -75
- package/resources/extraction/extraction-agents/schema.d.mts.map +0 -1
- package/resources/extraction/extraction-agents/schema.d.ts +0 -75
- package/resources/extraction/extraction-agents/schema.d.ts.map +0 -1
- package/resources/extraction/extraction-agents/schema.js +0 -28
- package/resources/extraction/extraction-agents/schema.js.map +0 -1
- package/resources/extraction/extraction-agents/schema.mjs +0 -24
- package/resources/extraction/extraction-agents/schema.mjs.map +0 -1
- package/resources/extraction/extraction-agents.d.mts +0 -2
- package/resources/extraction/extraction-agents.d.mts.map +0 -1
- package/resources/extraction/extraction-agents.d.ts +0 -2
- package/resources/extraction/extraction-agents.d.ts.map +0 -1
- package/resources/extraction/extraction-agents.js +0 -6
- package/resources/extraction/extraction-agents.js.map +0 -1
- package/resources/extraction/extraction-agents.mjs +0 -3
- package/resources/extraction/extraction-agents.mjs.map +0 -1
- package/resources/extraction/extraction.d.mts +0 -118
- package/resources/extraction/extraction.d.mts.map +0 -1
- package/resources/extraction/extraction.d.ts +0 -118
- package/resources/extraction/extraction.d.ts.map +0 -1
- package/resources/extraction/extraction.js +0 -91
- package/resources/extraction/extraction.js.map +0 -1
- package/resources/extraction/extraction.mjs +0 -86
- package/resources/extraction/extraction.mjs.map +0 -1
- package/resources/extraction/index.d.mts +0 -5
- package/resources/extraction/index.d.mts.map +0 -1
- package/resources/extraction/index.d.ts +0 -5
- package/resources/extraction/index.d.ts.map +0 -1
- package/resources/extraction/index.js +0 -13
- package/resources/extraction/index.js.map +0 -1
- package/resources/extraction/index.mjs +0 -6
- package/resources/extraction/index.mjs.map +0 -1
- package/resources/extraction/jobs.d.mts +0 -280
- package/resources/extraction/jobs.d.mts.map +0 -1
- package/resources/extraction/jobs.d.ts +0 -280
- package/resources/extraction/jobs.d.ts.map +0 -1
- package/resources/extraction/jobs.js +0 -179
- package/resources/extraction/jobs.js.map +0 -1
- package/resources/extraction/jobs.mjs +0 -175
- package/resources/extraction/jobs.mjs.map +0 -1
- package/resources/extraction/runs.d.mts +0 -198
- package/resources/extraction/runs.d.mts.map +0 -1
- package/resources/extraction/runs.d.ts +0 -198
- package/resources/extraction/runs.d.ts.map +0 -1
- package/resources/extraction/runs.js +0 -42
- package/resources/extraction/runs.js.map +0 -1
- package/resources/extraction/runs.mjs +0 -38
- package/resources/extraction/runs.mjs.map +0 -1
- package/resources/extraction.d.mts +0 -2
- package/resources/extraction.d.mts.map +0 -1
- package/resources/extraction.d.ts +0 -2
- package/resources/extraction.d.ts.map +0 -1
- package/resources/extraction.js +0 -6
- package/resources/extraction.js.map +0 -1
- package/resources/extraction.mjs +0 -3
- package/resources/extraction.mjs.map +0 -1
- package/src/resources/extraction/extraction-agents/extraction-agents.ts +0 -196
- package/src/resources/extraction/extraction-agents/index.ts +0 -18
- package/src/resources/extraction/extraction-agents/schema.ts +0 -100
- package/src/resources/extraction/extraction-agents.ts +0 -3
- package/src/resources/extraction/extraction.ts +0 -224
- package/src/resources/extraction/index.ts +0 -34
- package/src/resources/extraction/jobs.ts +0 -414
- package/src/resources/extraction/runs.ts +0 -315
- package/src/resources/extraction.ts +0 -3
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import * as RunsAPI from '../runs';
|
|
5
|
-
import * as SchemaAPI from './schema';
|
|
6
|
-
import {
|
|
7
|
-
Schema,
|
|
8
|
-
SchemaGenerateSchemaParams,
|
|
9
|
-
SchemaGenerateSchemaResponse,
|
|
10
|
-
SchemaValidateSchemaParams,
|
|
11
|
-
SchemaValidateSchemaResponse,
|
|
12
|
-
} from './schema';
|
|
13
|
-
import { APIPromise } from '../../../core/api-promise';
|
|
14
|
-
import { RequestOptions } from '../../../internal/request-options';
|
|
15
|
-
import { path } from '../../../internal/utils/path';
|
|
16
|
-
|
|
17
|
-
export class ExtractionAgents extends APIResource {
|
|
18
|
-
schema: SchemaAPI.Schema = new SchemaAPI.Schema(this._client);
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Create Extraction Agent
|
|
22
|
-
*/
|
|
23
|
-
create(params: ExtractionAgentCreateParams, options?: RequestOptions): APIPromise<ExtractAgent> {
|
|
24
|
-
const { organization_id, project_id, ...body } = params;
|
|
25
|
-
return this._client.post('/api/v1/extraction/extraction-agents', {
|
|
26
|
-
query: { organization_id, project_id },
|
|
27
|
-
body,
|
|
28
|
-
...options,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Update Extraction Agent
|
|
34
|
-
*/
|
|
35
|
-
update(
|
|
36
|
-
extractionAgentID: string,
|
|
37
|
-
body: ExtractionAgentUpdateParams,
|
|
38
|
-
options?: RequestOptions,
|
|
39
|
-
): APIPromise<ExtractAgent> {
|
|
40
|
-
return this._client.put(path`/api/v1/extraction/extraction-agents/${extractionAgentID}`, {
|
|
41
|
-
body,
|
|
42
|
-
...options,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* List Extraction Agents
|
|
48
|
-
*/
|
|
49
|
-
list(
|
|
50
|
-
query: ExtractionAgentListParams | null | undefined = {},
|
|
51
|
-
options?: RequestOptions,
|
|
52
|
-
): APIPromise<ExtractionAgentListResponse> {
|
|
53
|
-
return this._client.get('/api/v1/extraction/extraction-agents', { query, ...options });
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Delete Extraction Agent
|
|
58
|
-
*/
|
|
59
|
-
delete(extractionAgentID: string, options?: RequestOptions): APIPromise<unknown> {
|
|
60
|
-
return this._client.delete(path`/api/v1/extraction/extraction-agents/${extractionAgentID}`, options);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Get Extraction Agent
|
|
65
|
-
*/
|
|
66
|
-
get(extractionAgentID: string, options?: RequestOptions): APIPromise<ExtractAgent> {
|
|
67
|
-
return this._client.get(path`/api/v1/extraction/extraction-agents/${extractionAgentID}`, options);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Schema and configuration for an extraction agent.
|
|
73
|
-
*/
|
|
74
|
-
export interface ExtractAgent {
|
|
75
|
-
/**
|
|
76
|
-
* The id of the extraction agent.
|
|
77
|
-
*/
|
|
78
|
-
id: string;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* The configuration parameters for the extraction agent.
|
|
82
|
-
*/
|
|
83
|
-
config: RunsAPI.ExtractConfig;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* The schema of the data.
|
|
87
|
-
*/
|
|
88
|
-
data_schema: {
|
|
89
|
-
[key: string]: { [key: string]: unknown } | Array<unknown> | string | number | boolean | null;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* The name of the extraction agent.
|
|
94
|
-
*/
|
|
95
|
-
name: string;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* The ID of the project that the extraction agent belongs to.
|
|
99
|
-
*/
|
|
100
|
-
project_id: string;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* The creation time of the extraction agent.
|
|
104
|
-
*/
|
|
105
|
-
created_at?: string | null;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Custom configuration type for the extraction agent. Currently supports
|
|
109
|
-
* 'default'.
|
|
110
|
-
*/
|
|
111
|
-
custom_configuration?: 'default' | null;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* The last update time of the extraction agent.
|
|
115
|
-
*/
|
|
116
|
-
updated_at?: string | null;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export type ExtractionAgentListResponse = Array<ExtractAgent>;
|
|
120
|
-
|
|
121
|
-
export type ExtractionAgentDeleteResponse = unknown;
|
|
122
|
-
|
|
123
|
-
export interface ExtractionAgentCreateParams {
|
|
124
|
-
/**
|
|
125
|
-
* Body param: The configuration parameters for the extraction agent.
|
|
126
|
-
*/
|
|
127
|
-
config: RunsAPI.ExtractConfig;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Body param: The schema of the data.
|
|
131
|
-
*/
|
|
132
|
-
data_schema:
|
|
133
|
-
| { [key: string]: { [key: string]: unknown } | Array<unknown> | string | number | boolean | null }
|
|
134
|
-
| string;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Body param: The name of the extraction schema
|
|
138
|
-
*/
|
|
139
|
-
name: string;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Query param
|
|
143
|
-
*/
|
|
144
|
-
organization_id?: string | null;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Query param
|
|
148
|
-
*/
|
|
149
|
-
project_id?: string | null;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface ExtractionAgentUpdateParams {
|
|
153
|
-
/**
|
|
154
|
-
* The configuration parameters for the extraction agent.
|
|
155
|
-
*/
|
|
156
|
-
config: RunsAPI.ExtractConfig;
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* The schema of the data
|
|
160
|
-
*/
|
|
161
|
-
data_schema:
|
|
162
|
-
| { [key: string]: { [key: string]: unknown } | Array<unknown> | string | number | boolean | null }
|
|
163
|
-
| string;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export interface ExtractionAgentListParams {
|
|
167
|
-
/**
|
|
168
|
-
* Whether to include default agents in the results
|
|
169
|
-
*/
|
|
170
|
-
include_default?: boolean;
|
|
171
|
-
|
|
172
|
-
organization_id?: string | null;
|
|
173
|
-
|
|
174
|
-
project_id?: string | null;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
ExtractionAgents.Schema = Schema;
|
|
178
|
-
|
|
179
|
-
export declare namespace ExtractionAgents {
|
|
180
|
-
export {
|
|
181
|
-
type ExtractAgent as ExtractAgent,
|
|
182
|
-
type ExtractionAgentListResponse as ExtractionAgentListResponse,
|
|
183
|
-
type ExtractionAgentDeleteResponse as ExtractionAgentDeleteResponse,
|
|
184
|
-
type ExtractionAgentCreateParams as ExtractionAgentCreateParams,
|
|
185
|
-
type ExtractionAgentUpdateParams as ExtractionAgentUpdateParams,
|
|
186
|
-
type ExtractionAgentListParams as ExtractionAgentListParams,
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
export {
|
|
190
|
-
Schema as Schema,
|
|
191
|
-
type SchemaGenerateSchemaResponse as SchemaGenerateSchemaResponse,
|
|
192
|
-
type SchemaValidateSchemaResponse as SchemaValidateSchemaResponse,
|
|
193
|
-
type SchemaGenerateSchemaParams as SchemaGenerateSchemaParams,
|
|
194
|
-
type SchemaValidateSchemaParams as SchemaValidateSchemaParams,
|
|
195
|
-
};
|
|
196
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
ExtractionAgents,
|
|
5
|
-
type ExtractAgent,
|
|
6
|
-
type ExtractionAgentListResponse,
|
|
7
|
-
type ExtractionAgentDeleteResponse,
|
|
8
|
-
type ExtractionAgentCreateParams,
|
|
9
|
-
type ExtractionAgentUpdateParams,
|
|
10
|
-
type ExtractionAgentListParams,
|
|
11
|
-
} from './extraction-agents';
|
|
12
|
-
export {
|
|
13
|
-
Schema,
|
|
14
|
-
type SchemaGenerateSchemaResponse,
|
|
15
|
-
type SchemaValidateSchemaResponse,
|
|
16
|
-
type SchemaGenerateSchemaParams,
|
|
17
|
-
type SchemaValidateSchemaParams,
|
|
18
|
-
} from './schema';
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
-
import { RequestOptions } from '../../../internal/request-options';
|
|
6
|
-
|
|
7
|
-
export class Schema extends APIResource {
|
|
8
|
-
/**
|
|
9
|
-
* Generates or refines an extraction agent's schema definition from a file,
|
|
10
|
-
* natural language prompt, or existing schema.
|
|
11
|
-
*/
|
|
12
|
-
generateSchema(
|
|
13
|
-
params: SchemaGenerateSchemaParams,
|
|
14
|
-
options?: RequestOptions,
|
|
15
|
-
): APIPromise<SchemaGenerateSchemaResponse> {
|
|
16
|
-
const { organization_id, project_id, ...body } = params;
|
|
17
|
-
return this._client.post('/api/v1/extraction/extraction-agents/schema/generate', {
|
|
18
|
-
query: { organization_id, project_id },
|
|
19
|
-
body,
|
|
20
|
-
...options,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Validates an extraction agent's schema definition. Returns the normalized and
|
|
26
|
-
* validated schema if valid, otherwise raises an HTTP 400.
|
|
27
|
-
*/
|
|
28
|
-
validateSchema(
|
|
29
|
-
body: SchemaValidateSchemaParams,
|
|
30
|
-
options?: RequestOptions,
|
|
31
|
-
): APIPromise<SchemaValidateSchemaResponse> {
|
|
32
|
-
return this._client.post('/api/v1/extraction/extraction-agents/schema/validation', { body, ...options });
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Response schema for schema generation.
|
|
38
|
-
*/
|
|
39
|
-
export interface SchemaGenerateSchemaResponse {
|
|
40
|
-
/**
|
|
41
|
-
* The generated JSON schema
|
|
42
|
-
*/
|
|
43
|
-
data_schema: {
|
|
44
|
-
[key: string]: { [key: string]: unknown } | Array<unknown> | string | number | boolean | null;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Response schema for schema validation.
|
|
50
|
-
*/
|
|
51
|
-
export interface SchemaValidateSchemaResponse {
|
|
52
|
-
data_schema: {
|
|
53
|
-
[key: string]: { [key: string]: unknown } | Array<unknown> | string | number | boolean | null;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface SchemaGenerateSchemaParams {
|
|
58
|
-
/**
|
|
59
|
-
* Query param
|
|
60
|
-
*/
|
|
61
|
-
organization_id?: string | null;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Query param
|
|
65
|
-
*/
|
|
66
|
-
project_id?: string | null;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Body param: Optional schema to validate, refine, or extend during generation
|
|
70
|
-
*/
|
|
71
|
-
data_schema?:
|
|
72
|
-
| { [key: string]: { [key: string]: unknown } | Array<unknown> | string | number | boolean | null }
|
|
73
|
-
| string
|
|
74
|
-
| null;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Body param: Optional file ID to analyze for schema generation
|
|
78
|
-
*/
|
|
79
|
-
file_id?: string | null;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Body param: Natural language description of the data structure to extract
|
|
83
|
-
*/
|
|
84
|
-
prompt?: string | null;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export interface SchemaValidateSchemaParams {
|
|
88
|
-
data_schema:
|
|
89
|
-
| { [key: string]: { [key: string]: unknown } | Array<unknown> | string | number | boolean | null }
|
|
90
|
-
| string;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export declare namespace Schema {
|
|
94
|
-
export {
|
|
95
|
-
type SchemaGenerateSchemaResponse as SchemaGenerateSchemaResponse,
|
|
96
|
-
type SchemaValidateSchemaResponse as SchemaValidateSchemaResponse,
|
|
97
|
-
type SchemaGenerateSchemaParams as SchemaGenerateSchemaParams,
|
|
98
|
-
type SchemaValidateSchemaParams as SchemaValidateSchemaParams,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../core/resource';
|
|
4
|
-
import * as JobsAPI from './jobs';
|
|
5
|
-
import {
|
|
6
|
-
ExtractJob,
|
|
7
|
-
JobCreateParams,
|
|
8
|
-
JobFileParams,
|
|
9
|
-
JobGetResultParams,
|
|
10
|
-
JobGetResultResponse,
|
|
11
|
-
JobListParams,
|
|
12
|
-
JobListResponse,
|
|
13
|
-
Jobs,
|
|
14
|
-
WebhookConfiguration,
|
|
15
|
-
} from './jobs';
|
|
16
|
-
import * as RunsAPI from './runs';
|
|
17
|
-
import {
|
|
18
|
-
ExtractConfig,
|
|
19
|
-
ExtractRun,
|
|
20
|
-
ExtractRunsPaginatedExtractRuns,
|
|
21
|
-
RunDeleteParams,
|
|
22
|
-
RunDeleteResponse,
|
|
23
|
-
RunGetByJobParams,
|
|
24
|
-
RunGetParams,
|
|
25
|
-
RunListParams,
|
|
26
|
-
Runs,
|
|
27
|
-
} from './runs';
|
|
28
|
-
import * as ExtractionAgentsAPI from './extraction-agents/extraction-agents';
|
|
29
|
-
import {
|
|
30
|
-
ExtractAgent,
|
|
31
|
-
ExtractionAgentCreateParams,
|
|
32
|
-
ExtractionAgentDeleteResponse,
|
|
33
|
-
ExtractionAgentListParams,
|
|
34
|
-
ExtractionAgentListResponse,
|
|
35
|
-
ExtractionAgentUpdateParams,
|
|
36
|
-
ExtractionAgents,
|
|
37
|
-
} from './extraction-agents/extraction-agents';
|
|
38
|
-
import { APIPromise } from '../../core/api-promise';
|
|
39
|
-
import { RequestOptions } from '../../internal/request-options';
|
|
40
|
-
import { PollingOptions, DEFAULT_TIMEOUT } from '../../core/polling';
|
|
41
|
-
|
|
42
|
-
export class Extraction extends APIResource {
|
|
43
|
-
jobs: JobsAPI.Jobs = new JobsAPI.Jobs(this._client);
|
|
44
|
-
runs: RunsAPI.Runs = new RunsAPI.Runs(this._client);
|
|
45
|
-
extractionAgents: ExtractionAgentsAPI.ExtractionAgents = new ExtractionAgentsAPI.ExtractionAgents(
|
|
46
|
-
this._client,
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Stateless extraction endpoint that uses a default extraction agent in the user's
|
|
51
|
-
* default project. Requires data_schema, config, and either file_id, text, or
|
|
52
|
-
* base64 encoded file data.
|
|
53
|
-
*/
|
|
54
|
-
run(params: ExtractionRunParams, options?: RequestOptions): APIPromise<JobsAPI.ExtractJob> {
|
|
55
|
-
const { organization_id, project_id, ...body } = params;
|
|
56
|
-
return this._client.post('/api/v1/extraction/run', {
|
|
57
|
-
query: { organization_id, project_id },
|
|
58
|
-
body,
|
|
59
|
-
...options,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Run a stateless extraction and wait for it to complete, returning the result.
|
|
65
|
-
*
|
|
66
|
-
* This is a convenience method that combines run(), waitForCompletion(),
|
|
67
|
-
* and getResult() into a single call for the most common end-to-end workflow.
|
|
68
|
-
*
|
|
69
|
-
* This endpoint uses a default extraction agent in the user's default project.
|
|
70
|
-
*
|
|
71
|
-
* @param params - Extraction parameters
|
|
72
|
-
* @param options - Polling configuration and request options
|
|
73
|
-
* @returns The extraction result (JobGetResultResponse)
|
|
74
|
-
* @throws {PollingTimeoutError} If the job doesn't complete within the timeout period
|
|
75
|
-
* @throws {PollingError} If the job fails or is cancelled
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```typescript
|
|
79
|
-
* import { LlamaCloud } from 'llama-cloud';
|
|
80
|
-
*
|
|
81
|
-
* const client = new LlamaCloud({ apiKey: '...' });
|
|
82
|
-
*
|
|
83
|
-
* // One-shot: run stateless extraction, wait for completion, and get result
|
|
84
|
-
* const result = await client.extraction.extract({
|
|
85
|
-
* config: {
|
|
86
|
-
* chunk_mode: 'PAGE',
|
|
87
|
-
* cite_sources: true,
|
|
88
|
-
* extraction_target: 'PER_DOC',
|
|
89
|
-
* extraction_mode: 'BALANCED'
|
|
90
|
-
* },
|
|
91
|
-
* data_schema: { model_names: { type: 'array', items: { type: 'string' } } },
|
|
92
|
-
* file_id: 'file_id'
|
|
93
|
-
* }, { verbose: true });
|
|
94
|
-
*
|
|
95
|
-
* // Result is ready to use immediately
|
|
96
|
-
* console.log(result.data);
|
|
97
|
-
* ```
|
|
98
|
-
*/
|
|
99
|
-
async extract(
|
|
100
|
-
params: ExtractionRunParams,
|
|
101
|
-
options?: PollingOptions & RequestOptions,
|
|
102
|
-
): Promise<JobsAPI.JobGetResultResponse> {
|
|
103
|
-
const { pollingInterval, maxInterval, timeout, backoff, verbose, ...requestOptions } = options || {};
|
|
104
|
-
|
|
105
|
-
// Run the extraction job
|
|
106
|
-
const job = await this.run(params, requestOptions);
|
|
107
|
-
|
|
108
|
-
// Wait for completion
|
|
109
|
-
await this.jobs.waitForCompletion(job.id, {
|
|
110
|
-
pollingInterval,
|
|
111
|
-
maxInterval,
|
|
112
|
-
timeout: timeout || DEFAULT_TIMEOUT,
|
|
113
|
-
backoff,
|
|
114
|
-
verbose,
|
|
115
|
-
...requestOptions,
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
// Get and return the result
|
|
119
|
-
return await this.jobs.getResult(job.id, {}, requestOptions);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export interface ExtractionRunParams {
|
|
124
|
-
/**
|
|
125
|
-
* Body param: The configuration parameters for the extraction
|
|
126
|
-
*/
|
|
127
|
-
config: RunsAPI.ExtractConfig;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Body param: The schema of the data to extract
|
|
131
|
-
*/
|
|
132
|
-
data_schema:
|
|
133
|
-
| { [key: string]: { [key: string]: unknown } | Array<unknown> | string | number | boolean | null }
|
|
134
|
-
| string;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Query param
|
|
138
|
-
*/
|
|
139
|
-
organization_id?: string | null;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Query param
|
|
143
|
-
*/
|
|
144
|
-
project_id?: string | null;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Body param: Schema for file data with base64 content and MIME type.
|
|
148
|
-
*/
|
|
149
|
-
file?: ExtractionRunParams.File | null;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Body param: The ID of the file to extract from
|
|
153
|
-
*/
|
|
154
|
-
file_id?: string | null;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Body param: The text content to extract from
|
|
158
|
-
*/
|
|
159
|
-
text?: string | null;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Body param: The outbound webhook configurations
|
|
163
|
-
*/
|
|
164
|
-
webhook_configurations?: Array<JobsAPI.WebhookConfiguration> | null;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export namespace ExtractionRunParams {
|
|
168
|
-
/**
|
|
169
|
-
* Schema for file data with base64 content and MIME type.
|
|
170
|
-
*/
|
|
171
|
-
export interface File {
|
|
172
|
-
/**
|
|
173
|
-
* The file content as base64-encoded string
|
|
174
|
-
*/
|
|
175
|
-
data: string;
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* The MIME type of the file (e.g., 'application/pdf', 'text/plain')
|
|
179
|
-
*/
|
|
180
|
-
mime_type: string;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
Extraction.Jobs = Jobs;
|
|
185
|
-
Extraction.Runs = Runs;
|
|
186
|
-
Extraction.ExtractionAgents = ExtractionAgents;
|
|
187
|
-
|
|
188
|
-
export declare namespace Extraction {
|
|
189
|
-
export { type ExtractionRunParams as ExtractionRunParams };
|
|
190
|
-
|
|
191
|
-
export {
|
|
192
|
-
Jobs as Jobs,
|
|
193
|
-
type ExtractJob as ExtractJob,
|
|
194
|
-
type WebhookConfiguration as WebhookConfiguration,
|
|
195
|
-
type JobListResponse as JobListResponse,
|
|
196
|
-
type JobGetResultResponse as JobGetResultResponse,
|
|
197
|
-
type JobCreateParams as JobCreateParams,
|
|
198
|
-
type JobListParams as JobListParams,
|
|
199
|
-
type JobFileParams as JobFileParams,
|
|
200
|
-
type JobGetResultParams as JobGetResultParams,
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
export {
|
|
204
|
-
Runs as Runs,
|
|
205
|
-
type ExtractConfig as ExtractConfig,
|
|
206
|
-
type ExtractRun as ExtractRun,
|
|
207
|
-
type RunDeleteResponse as RunDeleteResponse,
|
|
208
|
-
type ExtractRunsPaginatedExtractRuns as ExtractRunsPaginatedExtractRuns,
|
|
209
|
-
type RunListParams as RunListParams,
|
|
210
|
-
type RunDeleteParams as RunDeleteParams,
|
|
211
|
-
type RunGetParams as RunGetParams,
|
|
212
|
-
type RunGetByJobParams as RunGetByJobParams,
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
export {
|
|
216
|
-
ExtractionAgents as ExtractionAgents,
|
|
217
|
-
type ExtractAgent as ExtractAgent,
|
|
218
|
-
type ExtractionAgentListResponse as ExtractionAgentListResponse,
|
|
219
|
-
type ExtractionAgentDeleteResponse as ExtractionAgentDeleteResponse,
|
|
220
|
-
type ExtractionAgentCreateParams as ExtractionAgentCreateParams,
|
|
221
|
-
type ExtractionAgentUpdateParams as ExtractionAgentUpdateParams,
|
|
222
|
-
type ExtractionAgentListParams as ExtractionAgentListParams,
|
|
223
|
-
};
|
|
224
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
export { Extraction, type ExtractionRunParams } from './extraction';
|
|
4
|
-
export {
|
|
5
|
-
ExtractionAgents,
|
|
6
|
-
type ExtractAgent,
|
|
7
|
-
type ExtractionAgentListResponse,
|
|
8
|
-
type ExtractionAgentDeleteResponse,
|
|
9
|
-
type ExtractionAgentCreateParams,
|
|
10
|
-
type ExtractionAgentUpdateParams,
|
|
11
|
-
type ExtractionAgentListParams,
|
|
12
|
-
} from './extraction-agents/index';
|
|
13
|
-
export {
|
|
14
|
-
Jobs,
|
|
15
|
-
type ExtractJob,
|
|
16
|
-
type WebhookConfiguration,
|
|
17
|
-
type JobListResponse,
|
|
18
|
-
type JobGetResultResponse,
|
|
19
|
-
type JobCreateParams,
|
|
20
|
-
type JobListParams,
|
|
21
|
-
type JobFileParams,
|
|
22
|
-
type JobGetResultParams,
|
|
23
|
-
} from './jobs';
|
|
24
|
-
export {
|
|
25
|
-
Runs,
|
|
26
|
-
type ExtractConfig,
|
|
27
|
-
type ExtractRun,
|
|
28
|
-
type RunDeleteResponse,
|
|
29
|
-
type RunListParams,
|
|
30
|
-
type RunDeleteParams,
|
|
31
|
-
type RunGetParams,
|
|
32
|
-
type RunGetByJobParams,
|
|
33
|
-
type ExtractRunsPaginatedExtractRuns,
|
|
34
|
-
} from './runs';
|