extend-ai 1.10.0 → 1.11.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.
Files changed (38) hide show
  1. package/.gitattributes +1 -0
  2. package/BaseClient.js +2 -2
  3. package/api/resources/evaluationSetRuns/client/Client.d.ts +34 -0
  4. package/api/resources/evaluationSetRuns/client/Client.js +101 -0
  5. package/api/resources/evaluationSetRuns/client/requests/EvaluationSetRunsCreateRequest.d.ts +27 -0
  6. package/api/resources/evaluationSetRuns/client/requests/EvaluationSetRunsCreateRequest.js +3 -0
  7. package/api/resources/evaluationSetRuns/client/requests/index.d.ts +1 -0
  8. package/api/resources/evaluationSetRuns/index.d.ts +1 -0
  9. package/api/resources/evaluationSetRuns/index.js +1 -0
  10. package/api/resources/evaluationSetRuns/types/EvaluationSetRunsCreateRequestEntity.d.ts +9 -0
  11. package/api/resources/evaluationSetRuns/types/EvaluationSetRunsCreateRequestEntity.js +3 -0
  12. package/api/resources/evaluationSetRuns/types/index.d.ts +1 -0
  13. package/api/resources/evaluationSetRuns/types/index.js +17 -0
  14. package/api/resources/extractors/client/Client.d.ts +25 -3
  15. package/api/resources/extractors/client/Client.js +25 -3
  16. package/api/resources/extractors/client/requests/ExtractorsCreateRequest.d.ts +31 -5
  17. package/api/resources/extractors/types/ExtractorsCreateRequestGenerate.d.ts +12 -0
  18. package/api/resources/extractors/types/ExtractorsCreateRequestGenerate.js +3 -0
  19. package/api/resources/extractors/types/ExtractorsCreateRequestGenerateFilesItem.d.ts +2 -0
  20. package/api/resources/extractors/types/ExtractorsCreateRequestGenerateFilesItem.js +3 -0
  21. package/api/resources/extractors/types/index.d.ts +2 -0
  22. package/api/resources/extractors/types/index.js +2 -0
  23. package/api/resources/index.d.ts +1 -0
  24. package/api/resources/index.js +1 -0
  25. package/api/types/ClassifyAdvancedOptions.d.ts +2 -0
  26. package/api/types/ClassifyRun.d.ts +7 -7
  27. package/api/types/ExtractAdvancedOptions.d.ts +9 -2
  28. package/api/types/ExtractAdvancedOptionsCitationMode.d.ts +12 -0
  29. package/api/types/ExtractAdvancedOptionsCitationMode.js +15 -0
  30. package/api/types/ExtractRun.d.ts +12 -12
  31. package/api/types/SplitRun.d.ts +7 -7
  32. package/api/types/StepRun.d.ts +28 -2
  33. package/api/types/index.d.ts +1 -0
  34. package/api/types/index.js +1 -0
  35. package/package.json +1 -1
  36. package/reference.md +85 -3
  37. package/version.d.ts +1 -1
  38. package/version.js +1 -1
package/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ .fern/replay.lock linguist-generated=true
package/BaseClient.js CHANGED
@@ -44,8 +44,8 @@ function normalizeClientOptions(options) {
44
44
  const headers = (0, headers_1.mergeHeaders)({
45
45
  "X-Fern-Language": "JavaScript",
46
46
  "X-Fern-SDK-Name": "extend-ai",
47
- "X-Fern-SDK-Version": "1.10.0",
48
- "User-Agent": "extend-ai/1.10.0",
47
+ "X-Fern-SDK-Version": "1.11.0",
48
+ "User-Agent": "extend-ai/1.11.0",
49
49
  "X-Fern-Runtime": core.RUNTIME.type,
50
50
  "X-Fern-Runtime-Version": core.RUNTIME.version,
51
51
  "x-extend-api-version": (_a = options === null || options === void 0 ? void 0 : options.extendApiVersion) !== null && _a !== void 0 ? _a : "2026-02-09",
@@ -10,6 +10,40 @@ export declare namespace EvaluationSetRunsClient {
10
10
  export declare class EvaluationSetRunsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<EvaluationSetRunsClient.Options>;
12
12
  constructor(options: EvaluationSetRunsClient.Options);
13
+ /**
14
+ * Create and start an async evaluation set run. The response returns the evaluation set run object with its initial status; use `GET /evaluation_set_runs/{id}` to poll for completion.
15
+ *
16
+ * Evaluation set runs are currently supported for document processor evaluation sets.
17
+ *
18
+ * @param {Extend.EvaluationSetRunsCreateRequest} request
19
+ * @param {EvaluationSetRunsClient.RequestOptions} requestOptions - Request-specific configuration.
20
+ *
21
+ * @throws {@link Extend.BadRequestError}
22
+ * @throws {@link Extend.UnauthorizedError}
23
+ * @throws {@link Extend.PaymentRequiredError}
24
+ * @throws {@link Extend.ForbiddenError}
25
+ * @throws {@link Extend.NotFoundError}
26
+ * @throws {@link Extend.UnprocessableEntityError}
27
+ * @throws {@link Extend.TooManyRequestsError}
28
+ * @throws {@link Extend.InternalServerError}
29
+ *
30
+ * @example
31
+ * await client.evaluationSetRuns.create({
32
+ * evaluationSetId: "ev_2LcgeY_mp2T5yPaEuq5Lw",
33
+ * entity: {
34
+ * id: "ex_Xj8mK2pL9nR4vT7qY5wZ",
35
+ * version: "1.0"
36
+ * }
37
+ * })
38
+ *
39
+ * @example
40
+ * await client.evaluationSetRuns.create({
41
+ * evaluationSetId: "ev_2LcgeY_mp2T5yPaEuq5Lw",
42
+ * evaluationSetItemIds: ["evi_kR9mNP12Qw4yTv8BdR3H"]
43
+ * })
44
+ */
45
+ create(request: Extend.EvaluationSetRunsCreateRequest, requestOptions?: EvaluationSetRunsClient.RequestOptions): core.HttpResponsePromise<Extend.EvaluationSetRun>;
46
+ private __create;
13
47
  /**
14
48
  * Get details of an evaluation set run.
15
49
  *
@@ -42,6 +42,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
42
42
  step((generator = generator.apply(thisArg, _arguments || [])).next());
43
43
  });
44
44
  };
45
+ var __rest = (this && this.__rest) || function (s, e) {
46
+ var t = {};
47
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
48
+ t[p] = s[p];
49
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
50
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
51
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
52
+ t[p[i]] = s[p[i]];
53
+ }
54
+ return t;
55
+ };
45
56
  Object.defineProperty(exports, "__esModule", { value: true });
46
57
  exports.EvaluationSetRunsClient = void 0;
47
58
  const BaseClient_1 = require("../../../../BaseClient");
@@ -55,6 +66,96 @@ class EvaluationSetRunsClient {
55
66
  constructor(options) {
56
67
  this._options = (0, BaseClient_1.normalizeClientOptionsWithAuth)(options);
57
68
  }
69
+ /**
70
+ * Create and start an async evaluation set run. The response returns the evaluation set run object with its initial status; use `GET /evaluation_set_runs/{id}` to poll for completion.
71
+ *
72
+ * Evaluation set runs are currently supported for document processor evaluation sets.
73
+ *
74
+ * @param {Extend.EvaluationSetRunsCreateRequest} request
75
+ * @param {EvaluationSetRunsClient.RequestOptions} requestOptions - Request-specific configuration.
76
+ *
77
+ * @throws {@link Extend.BadRequestError}
78
+ * @throws {@link Extend.UnauthorizedError}
79
+ * @throws {@link Extend.PaymentRequiredError}
80
+ * @throws {@link Extend.ForbiddenError}
81
+ * @throws {@link Extend.NotFoundError}
82
+ * @throws {@link Extend.UnprocessableEntityError}
83
+ * @throws {@link Extend.TooManyRequestsError}
84
+ * @throws {@link Extend.InternalServerError}
85
+ *
86
+ * @example
87
+ * await client.evaluationSetRuns.create({
88
+ * evaluationSetId: "ev_2LcgeY_mp2T5yPaEuq5Lw",
89
+ * entity: {
90
+ * id: "ex_Xj8mK2pL9nR4vT7qY5wZ",
91
+ * version: "1.0"
92
+ * }
93
+ * })
94
+ *
95
+ * @example
96
+ * await client.evaluationSetRuns.create({
97
+ * evaluationSetId: "ev_2LcgeY_mp2T5yPaEuq5Lw",
98
+ * evaluationSetItemIds: ["evi_kR9mNP12Qw4yTv8BdR3H"]
99
+ * })
100
+ */
101
+ create(request, requestOptions) {
102
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
103
+ }
104
+ __create(request, requestOptions) {
105
+ return __awaiter(this, void 0, void 0, function* () {
106
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
107
+ const { "x-extend-workspace-id": extendWorkspaceId } = request, _body = __rest(request, ["x-extend-workspace-id"]);
108
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
109
+ const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
110
+ "x-extend-workspace-id": extendWorkspaceId,
111
+ "x-extend-api-version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.extendApiVersion) !== null && _b !== void 0 ? _b : "2026-02-09",
112
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
113
+ const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
114
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ExtendEnvironment.Production, "evaluation_set_runs"),
115
+ method: "POST",
116
+ headers: _headers,
117
+ contentType: "application/json",
118
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
119
+ requestType: "json",
120
+ body: _body,
121
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 300) * 1000,
122
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
123
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
124
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
125
+ logging: this._options.logging,
126
+ });
127
+ if (_response.ok) {
128
+ return { data: _response.body, rawResponse: _response.rawResponse };
129
+ }
130
+ if (_response.error.reason === "status-code") {
131
+ switch (_response.error.statusCode) {
132
+ case 400:
133
+ throw new Extend.BadRequestError(_response.error.body, _response.rawResponse);
134
+ case 401:
135
+ throw new Extend.UnauthorizedError(_response.error.body, _response.rawResponse);
136
+ case 402:
137
+ throw new Extend.PaymentRequiredError(_response.error.body, _response.rawResponse);
138
+ case 403:
139
+ throw new Extend.ForbiddenError(_response.error.body, _response.rawResponse);
140
+ case 404:
141
+ throw new Extend.NotFoundError(_response.error.body, _response.rawResponse);
142
+ case 422:
143
+ throw new Extend.UnprocessableEntityError(_response.error.body, _response.rawResponse);
144
+ case 429:
145
+ throw new Extend.TooManyRequestsError(_response.error.body, _response.rawResponse);
146
+ case 500:
147
+ throw new Extend.InternalServerError(_response.error.body, _response.rawResponse);
148
+ default:
149
+ throw new errors.ExtendError({
150
+ statusCode: _response.error.statusCode,
151
+ body: _response.error.body,
152
+ rawResponse: _response.rawResponse,
153
+ });
154
+ }
155
+ }
156
+ return (0, handleNonStatusCodeError_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/evaluation_set_runs");
157
+ });
158
+ }
58
159
  /**
59
160
  * Get details of an evaluation set run.
60
161
  *
@@ -0,0 +1,27 @@
1
+ import type * as Extend from "../../../../index";
2
+ /**
3
+ * @example
4
+ * {
5
+ * evaluationSetId: "ev_2LcgeY_mp2T5yPaEuq5Lw",
6
+ * entity: {
7
+ * id: "ex_Xj8mK2pL9nR4vT7qY5wZ",
8
+ * version: "1.0"
9
+ * }
10
+ * }
11
+ *
12
+ * @example
13
+ * {
14
+ * evaluationSetId: "ev_2LcgeY_mp2T5yPaEuq5Lw",
15
+ * evaluationSetItemIds: ["evi_kR9mNP12Qw4yTv8BdR3H"]
16
+ * }
17
+ */
18
+ export interface EvaluationSetRunsCreateRequest {
19
+ /** The workspace ID to target. **Required** when using an organization-scoped API key; optional for workspace-scoped keys (the key is already tied to a workspace). See [Authentication](https://docs.extend.ai/2026-02-09/developers/authentication) for details on API key scopes. */
20
+ "x-extend-workspace-id"?: string;
21
+ /** The ID of the evaluation set to run. */
22
+ evaluationSetId: string;
23
+ /** Optional processor and version to run against the evaluation set. If omitted, the evaluation set's processor is run at its draft version. */
24
+ entity?: Extend.EvaluationSetRunsCreateRequestEntity;
25
+ /** Optional list of evaluation set item IDs to run. If omitted, all items in the evaluation set are run. */
26
+ evaluationSetItemIds?: string[];
27
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
+ export type { EvaluationSetRunsCreateRequest } from "./EvaluationSetRunsCreateRequest";
1
2
  export type { EvaluationSetRunsRetrieveRequest } from "./EvaluationSetRunsRetrieveRequest";
@@ -1 +1,2 @@
1
1
  export * from "./client";
2
+ export * from "./types";
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./client"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,9 @@
1
+ import type * as Extend from "../../../index";
2
+ /**
3
+ * Optional processor and version to run against the evaluation set. If omitted, the evaluation set's processor is run at its draft version.
4
+ */
5
+ export interface EvaluationSetRunsCreateRequestEntity {
6
+ /** The ID of the extractor, classifier, or splitter to evaluate. */
7
+ id: string;
8
+ version?: Extend.ProcessorVersionString;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./EvaluationSetRunsCreateRequestEntity";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./EvaluationSetRunsCreateRequestEntity"), exports);
@@ -37,6 +37,8 @@ export declare class ExtractorsClient {
37
37
  /**
38
38
  * Create a new extractor.
39
39
  *
40
+ * You can optionally provide a `generate` object to automatically generate an extraction schema from sample documents using AI. `generate` is mutually exclusive with `config` and `cloneExtractorId`.
41
+ *
40
42
  * @param {Extend.ExtractorsCreateRequest} request
41
43
  * @param {ExtractorsClient.RequestOptions} requestOptions - Request-specific configuration.
42
44
  *
@@ -57,21 +59,41 @@ export declare class ExtractorsClient {
57
59
  * "type": "object",
58
60
  * "properties": {
59
61
  * "vendor_name": {
60
- * "type": "string",
62
+ * "type": [
63
+ * "string",
64
+ * "null"
65
+ * ],
61
66
  * "description": "The name of the vendor"
62
67
  * },
63
68
  * "invoice_number": {
64
- * "type": "string",
69
+ * "type": [
70
+ * "string",
71
+ * "null"
72
+ * ],
65
73
  * "description": "The invoice number"
66
74
  * },
67
75
  * "total_amount": {
68
- * "type": "number",
76
+ * "type": [
77
+ * "number",
78
+ * "null"
79
+ * ],
69
80
  * "description": "The total amount due"
70
81
  * }
71
82
  * }
72
83
  * }
73
84
  * }
74
85
  * })
86
+ *
87
+ * @example
88
+ * await client.extractors.create({
89
+ * name: "Invoice Extractor",
90
+ * generate: {
91
+ * files: [{
92
+ * url: "https://example.com/sample-invoice.pdf"
93
+ * }],
94
+ * instructions: "US tax invoice with line items, vendor details, and total amount"
95
+ * }
96
+ * })
75
97
  */
76
98
  create(request: Extend.ExtractorsCreateRequest, requestOptions?: ExtractorsClient.RequestOptions): core.HttpResponsePromise<Extend.Extractor>;
77
99
  private __create;
@@ -152,6 +152,8 @@ class ExtractorsClient {
152
152
  /**
153
153
  * Create a new extractor.
154
154
  *
155
+ * You can optionally provide a `generate` object to automatically generate an extraction schema from sample documents using AI. `generate` is mutually exclusive with `config` and `cloneExtractorId`.
156
+ *
155
157
  * @param {Extend.ExtractorsCreateRequest} request
156
158
  * @param {ExtractorsClient.RequestOptions} requestOptions - Request-specific configuration.
157
159
  *
@@ -172,21 +174,41 @@ class ExtractorsClient {
172
174
  * "type": "object",
173
175
  * "properties": {
174
176
  * "vendor_name": {
175
- * "type": "string",
177
+ * "type": [
178
+ * "string",
179
+ * "null"
180
+ * ],
176
181
  * "description": "The name of the vendor"
177
182
  * },
178
183
  * "invoice_number": {
179
- * "type": "string",
184
+ * "type": [
185
+ * "string",
186
+ * "null"
187
+ * ],
180
188
  * "description": "The invoice number"
181
189
  * },
182
190
  * "total_amount": {
183
- * "type": "number",
191
+ * "type": [
192
+ * "number",
193
+ * "null"
194
+ * ],
184
195
  * "description": "The total amount due"
185
196
  * }
186
197
  * }
187
198
  * }
188
199
  * }
189
200
  * })
201
+ *
202
+ * @example
203
+ * await client.extractors.create({
204
+ * name: "Invoice Extractor",
205
+ * generate: {
206
+ * files: [{
207
+ * url: "https://example.com/sample-invoice.pdf"
208
+ * }],
209
+ * instructions: "US tax invoice with line items, vendor details, and total amount"
210
+ * }
211
+ * })
190
212
  */
191
213
  create(request, requestOptions) {
192
214
  return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
@@ -8,31 +8,57 @@ import type * as Extend from "../../../../index";
8
8
  * "type": "object",
9
9
  * "properties": {
10
10
  * "vendor_name": {
11
- * "type": "string",
11
+ * "type": [
12
+ * "string",
13
+ * "null"
14
+ * ],
12
15
  * "description": "The name of the vendor"
13
16
  * },
14
17
  * "invoice_number": {
15
- * "type": "string",
18
+ * "type": [
19
+ * "string",
20
+ * "null"
21
+ * ],
16
22
  * "description": "The invoice number"
17
23
  * },
18
24
  * "total_amount": {
19
- * "type": "number",
25
+ * "type": [
26
+ * "number",
27
+ * "null"
28
+ * ],
20
29
  * "description": "The total amount due"
21
30
  * }
22
31
  * }
23
32
  * }
24
33
  * }
25
34
  * }
35
+ *
36
+ * @example
37
+ * {
38
+ * name: "Invoice Extractor",
39
+ * generate: {
40
+ * files: [{
41
+ * url: "https://example.com/sample-invoice.pdf"
42
+ * }],
43
+ * instructions: "US tax invoice with line items, vendor details, and total amount"
44
+ * }
45
+ * }
26
46
  */
27
47
  export interface ExtractorsCreateRequest {
28
48
  /** The name of the extractor. */
29
49
  name: string;
30
50
  /**
31
- * The ID of an existing extractor to clone. If provided, the new extractor will be created with the same config as the extractor with this ID. Cannot be provided together with `config`.
51
+ * The ID of an existing extractor to clone. If provided, the new extractor will be created with the same config as the extractor with this ID. Cannot be provided together with `config` or `generate`.
32
52
  *
33
53
  * Example: `"ex_BMdfq_yWM3sT-ZzvCnA3f"`
34
54
  */
35
55
  cloneExtractorId?: string;
36
- /** The configuration for the extractor. Cannot be provided together with `cloneExtractorId`. */
56
+ /** The configuration for the extractor. Cannot be provided together with `cloneExtractorId` or `generate`. */
37
57
  config?: Extend.ExtractConfigJson;
58
+ /**
59
+ * If provided, an extraction schema is automatically generated from the supplied sample documents and applied to the extractor's draft. The response includes the extractor with the generated schema already in place.
60
+ *
61
+ * Cannot be provided together with `config` or `cloneExtractorId`.
62
+ */
63
+ generate?: Extend.ExtractorsCreateRequestGenerate;
38
64
  }
@@ -0,0 +1,12 @@
1
+ import type * as Extend from "../../../index";
2
+ /**
3
+ * If provided, an extraction schema is automatically generated from the supplied sample documents and applied to the extractor's draft. The response includes the extractor with the generated schema already in place.
4
+ *
5
+ * Cannot be provided together with `config` or `cloneExtractorId`.
6
+ */
7
+ export interface ExtractorsCreateRequestGenerate {
8
+ /** One to five sample documents used to generate the schema. Each item is either a file URL (downloaded inline) or an existing Extend file ID. */
9
+ files: Extend.ExtractorsCreateRequestGenerateFilesItem[];
10
+ /** Optional, but recommended. Describe the type of document, kinds of fields you want to extract, key requirements, and rules to follow. More context is better. */
11
+ instructions?: string;
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import type * as Extend from "../../../index";
2
+ export type ExtractorsCreateRequestGenerateFilesItem = Extend.FileFromUrl | Extend.FileFromId;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,3 @@
1
+ export * from "./ExtractorsCreateRequestGenerate";
2
+ export * from "./ExtractorsCreateRequestGenerateFilesItem";
1
3
  export * from "./ExtractorsListResponse";
@@ -14,4 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ExtractorsCreateRequestGenerate"), exports);
18
+ __exportStar(require("./ExtractorsCreateRequestGenerateFilesItem"), exports);
17
19
  __exportStar(require("./ExtractorsListResponse"), exports);
@@ -24,6 +24,7 @@ export * from "./evaluationSetItems/client/requests";
24
24
  export * from "./evaluationSetItems/types";
25
25
  export * as evaluationSetRuns from "./evaluationSetRuns";
26
26
  export * from "./evaluationSetRuns/client/requests";
27
+ export * from "./evaluationSetRuns/types";
27
28
  export * as evaluationSets from "./evaluationSets";
28
29
  export * from "./evaluationSets/client/requests";
29
30
  export * from "./evaluationSets/types";
@@ -63,6 +63,7 @@ __exportStar(require("./evaluationSetItems/client/requests"), exports);
63
63
  __exportStar(require("./evaluationSetItems/types"), exports);
64
64
  exports.evaluationSetRuns = __importStar(require("./evaluationSetRuns"));
65
65
  __exportStar(require("./evaluationSetRuns/client/requests"), exports);
66
+ __exportStar(require("./evaluationSetRuns/types"), exports);
66
67
  exports.evaluationSets = __importStar(require("./evaluationSets"));
67
68
  __exportStar(require("./evaluationSets/client/requests"), exports);
68
69
  __exportStar(require("./evaluationSets/types"), exports);
@@ -4,5 +4,7 @@ export interface ClassifyAdvancedOptions {
4
4
  context?: Extend.ClassifyAdvancedOptionsContext;
5
5
  /** Enable advanced multimodal processing for better handling of visual elements during classification. */
6
6
  advancedMultimodalEnabled?: boolean;
7
+ /** Enable memory for enhanced processing by learning from past successful classifications. */
8
+ memoryEnabled?: boolean;
7
9
  pageRanges?: Extend.PageRanges;
8
10
  }
@@ -11,6 +11,13 @@ export interface ClassifyRun {
11
11
  * Example: `"clr_Xj8mK2pL9nR4vT7qY5wZ"`
12
12
  */
13
13
  id: string;
14
+ status: Extend.ProcessorRunStatus;
15
+ /**
16
+ * The final output, either reviewed or initial.
17
+ *
18
+ * **Availability:** Present when `status` is `"PROCESSED"`.
19
+ */
20
+ output: Extend.ClassifyOutput | null;
14
21
  /**
15
22
  * The classifier that was used for this run.
16
23
  *
@@ -23,13 +30,6 @@ export interface ClassifyRun {
23
30
  * **Availability:** Present when a classifier reference was provided. Not present when using inline `config`.
24
31
  */
25
32
  classifierVersion: Extend.ClassifierVersionSummary | null;
26
- status: Extend.ProcessorRunStatus;
27
- /**
28
- * The final output, either reviewed or initial.
29
- *
30
- * **Availability:** Present when `status` is `"PROCESSED"`.
31
- */
32
- output: Extend.ClassifyOutput | null;
33
33
  /**
34
34
  * The initial output from the classify run, before any review edits.
35
35
  *
@@ -6,8 +6,13 @@ export interface ExtractAdvancedOptions {
6
6
  advancedMultimodalEnabled?: boolean;
7
7
  /** Whether to enable citations in the output. */
8
8
  citationsEnabled?: boolean;
9
- /** Whether to include the current date as context for the model during extraction. Defaults to `false`. */
10
- currentDateEnabled?: boolean;
9
+ /**
10
+ * Controls the granularity of citations returned alongside extracted values. Requires `citationsEnabled=true` and a base processor version that supports bounding box citations.
11
+ * - `line`: Use OCR lines for citations. This can return one or more relevant OCR lines for each citation. This is the default mode.
12
+ * - `word`: Narrow each matched citation down to the relevant OCR word span when possible. Note: this might still return line citations in cases where the citation model is unable to reliably narrow down to a word-level citation. Typically, this only makes sense when you are doing array extraction and want precise word citations from a given cell in a table to match an array property, e.g. `line_items.total`.
13
+ * - `block`: Use parser blocks (e.g. full paragraphs, key-val regions, tables, lists, etc.) and return block-level polygons for each citation. Will have highest recall in terms of overlap with the extracted value source, but least granularity.
14
+ */
15
+ citationMode?: Extend.ExtractAdvancedOptionsCitationMode;
11
16
  /** Granularity for array citations. This requires citationsEnabled=true and a base processor version that supports property-level array citations (extraction_performance ≥ 4.4.0). */
12
17
  arrayCitationStrategy?: Extend.ExtractAdvancedOptionsArrayCitationStrategy;
13
18
  /** Strategy for handling large arrays in documents. */
@@ -27,4 +32,6 @@ export interface ExtractAdvancedOptions {
27
32
  * To learn more, view the [Review Agent Documentation](https://docs.extend.ai/2026-02-09/product/extraction/review-agent)
28
33
  */
29
34
  reviewAgent?: Extend.ExtractAdvancedOptionsReviewAgent;
35
+ /** Whether to include the current date as context for the model during extraction. Defaults to `false`. */
36
+ currentDateEnabled?: boolean;
30
37
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Controls the granularity of citations returned alongside extracted values. Requires `citationsEnabled=true` and a base processor version that supports bounding box citations.
3
+ * - `line`: Use OCR lines for citations. This can return one or more relevant OCR lines for each citation. This is the default mode.
4
+ * - `word`: Narrow each matched citation down to the relevant OCR word span when possible. Note: this might still return line citations in cases where the citation model is unable to reliably narrow down to a word-level citation. Typically, this only makes sense when you are doing array extraction and want precise word citations from a given cell in a table to match an array property, e.g. `line_items.total`.
5
+ * - `block`: Use parser blocks (e.g. full paragraphs, key-val regions, tables, lists, etc.) and return block-level polygons for each citation. Will have highest recall in terms of overlap with the extracted value source, but least granularity.
6
+ */
7
+ export declare const ExtractAdvancedOptionsCitationMode: {
8
+ readonly Line: "line";
9
+ readonly Word: "word";
10
+ readonly Block: "block";
11
+ };
12
+ export type ExtractAdvancedOptionsCitationMode = (typeof ExtractAdvancedOptionsCitationMode)[keyof typeof ExtractAdvancedOptionsCitationMode] | string;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ExtractAdvancedOptionsCitationMode = void 0;
5
+ /**
6
+ * Controls the granularity of citations returned alongside extracted values. Requires `citationsEnabled=true` and a base processor version that supports bounding box citations.
7
+ * - `line`: Use OCR lines for citations. This can return one or more relevant OCR lines for each citation. This is the default mode.
8
+ * - `word`: Narrow each matched citation down to the relevant OCR word span when possible. Note: this might still return line citations in cases where the citation model is unable to reliably narrow down to a word-level citation. Typically, this only makes sense when you are doing array extraction and want precise word citations from a given cell in a table to match an array property, e.g. `line_items.total`.
9
+ * - `block`: Use parser blocks (e.g. full paragraphs, key-val regions, tables, lists, etc.) and return block-level polygons for each citation. Will have highest recall in terms of overlap with the extracted value source, but least granularity.
10
+ */
11
+ exports.ExtractAdvancedOptionsCitationMode = {
12
+ Line: "line",
13
+ Word: "word",
14
+ Block: "block",
15
+ };
@@ -11,18 +11,6 @@ export interface ExtractRun {
11
11
  * Example: `"exr_Xj8mK2pL9nR4vT7qY5wZ"`
12
12
  */
13
13
  id: string;
14
- /**
15
- * The extractor that was used for this run.
16
- *
17
- * **Availability:** Present when an extractor reference was provided. Not present when using inline `config`.
18
- */
19
- extractor: Extend.ExtractorSummary | null;
20
- /**
21
- * The version of the extractor that was used for this run.
22
- *
23
- * **Availability:** Present when an extractor reference was provided. Not present when using inline `config`.
24
- */
25
- extractorVersion: Extend.ExtractorVersionSummary | null;
26
14
  status: Extend.ProcessorRunStatus;
27
15
  /**
28
16
  * The final output, either reviewed or initial. This is a union of two possible shapes:
@@ -93,6 +81,18 @@ export interface ExtractRun {
93
81
  * - **[Legacy config](https://docs.extend.ai/2025-04-21/product/legacy/legacy-schema):** A fields-array config from a previous API version. This shape is only returned when retrieving runs that were originally created with the legacy format. This API version does not support creating runs with legacy configs.
94
82
  */
95
83
  config: Extend.ExtractConfig;
84
+ /**
85
+ * The extractor that was used for this run.
86
+ *
87
+ * **Availability:** Present when an extractor reference was provided. Not present when using inline `config`.
88
+ */
89
+ extractor: Extend.ExtractorSummary | null;
90
+ /**
91
+ * The version of the extractor that was used for this run.
92
+ *
93
+ * **Availability:** Present when an extractor reference was provided. Not present when using inline `config`.
94
+ */
95
+ extractorVersion: Extend.ExtractorVersionSummary | null;
96
96
  /** The file that was processed. */
97
97
  file: Extend.FileSummary;
98
98
  /**
@@ -11,6 +11,13 @@ export interface SplitRun {
11
11
  * Example: `"splr_Xj8mK2pL9nR4vT7qY5wZ"`
12
12
  */
13
13
  id: string;
14
+ status: Extend.ProcessorRunStatus;
15
+ /**
16
+ * The final output, either reviewed or initial.
17
+ *
18
+ * **Availability:** Present when `status` is `"PROCESSED"`.
19
+ */
20
+ output: Extend.SplitOutput | null;
14
21
  /**
15
22
  * The splitter that was used for this run.
16
23
  *
@@ -23,13 +30,6 @@ export interface SplitRun {
23
30
  * **Availability:** Present when a splitter reference was provided. Not present when using inline `config`.
24
31
  */
25
32
  splitterVersion: Extend.SplitterVersionSummary | null;
26
- status: Extend.ProcessorRunStatus;
27
- /**
28
- * The final output, either reviewed or initial.
29
- *
30
- * **Availability:** Present when `status` is `"PROCESSED"`.
31
- */
32
- output: Extend.SplitOutput | null;
33
33
  /**
34
34
  * The initial output from the split run, before any review edits.
35
35
  *
@@ -1,5 +1,31 @@
1
1
  import type * as Extend from "../index";
2
2
  /**
3
- * A workflow step run. The shape of the `result` field depends on the `step.type`.
3
+ * A workflow step run. The shape of the `result` field depends on the `stepType`.
4
4
  */
5
- export type StepRun = Extend.ParseStepRun | Extend.ExtractStepRun | Extend.ClassifyStepRun | Extend.SplitStepRun | Extend.MergeExtractStepRun | Extend.ConditionalExtractStepRun | Extend.RuleValidationStepRun | Extend.ExternalDataValidationStepRun;
5
+ export type StepRun = Extend.StepRun.Parse | Extend.StepRun.Extract | Extend.StepRun.Classify | Extend.StepRun.Split | Extend.StepRun.MergeExtract | Extend.StepRun.ConditionalExtract | Extend.StepRun.RuleValidation | Extend.StepRun.ExternalDataValidation;
6
+ export declare namespace StepRun {
7
+ interface Parse extends Extend.ParseStepRun {
8
+ stepType: "PARSE";
9
+ }
10
+ interface Extract extends Extend.ExtractStepRun {
11
+ stepType: "EXTRACT";
12
+ }
13
+ interface Classify extends Extend.ClassifyStepRun {
14
+ stepType: "CLASSIFY";
15
+ }
16
+ interface Split extends Extend.SplitStepRun {
17
+ stepType: "SPLIT";
18
+ }
19
+ interface MergeExtract extends Extend.MergeExtractStepRun {
20
+ stepType: "MERGE_EXTRACT";
21
+ }
22
+ interface ConditionalExtract extends Extend.ConditionalExtractStepRun {
23
+ stepType: "CONDITIONAL_EXTRACT";
24
+ }
25
+ interface RuleValidation extends Extend.RuleValidationStepRun {
26
+ stepType: "RULE_VALIDATION";
27
+ }
28
+ interface ExternalDataValidation extends Extend.ExternalDataValidationStepRun {
29
+ stepType: "EXTERNAL_DATA_VALIDATION";
30
+ }
31
+ }
@@ -119,6 +119,7 @@ export * from "./ExternalDataValidationStepRun";
119
119
  export * from "./ExternalDataValidationStepRunStep";
120
120
  export * from "./ExtractAdvancedOptions";
121
121
  export * from "./ExtractAdvancedOptionsArrayCitationStrategy";
122
+ export * from "./ExtractAdvancedOptionsCitationMode";
122
123
  export * from "./ExtractAdvancedOptionsExcelSheetSelectionStrategy";
123
124
  export * from "./ExtractAdvancedOptionsReviewAgent";
124
125
  export * from "./ExtractBaseProcessor";
@@ -135,6 +135,7 @@ __exportStar(require("./ExternalDataValidationStepRun"), exports);
135
135
  __exportStar(require("./ExternalDataValidationStepRunStep"), exports);
136
136
  __exportStar(require("./ExtractAdvancedOptions"), exports);
137
137
  __exportStar(require("./ExtractAdvancedOptionsArrayCitationStrategy"), exports);
138
+ __exportStar(require("./ExtractAdvancedOptionsCitationMode"), exports);
138
139
  __exportStar(require("./ExtractAdvancedOptionsExcelSheetSelectionStrategy"), exports);
139
140
  __exportStar(require("./ExtractAdvancedOptionsReviewAgent"), exports);
140
141
  __exportStar(require("./ExtractBaseProcessor"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "extend-ai",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -2047,6 +2047,8 @@ await client.extractors.list({
2047
2047
  <dd>
2048
2048
 
2049
2049
  Create a new extractor.
2050
+
2051
+ You can optionally provide a `generate` object to automatically generate an extraction schema from sample documents using AI. `generate` is mutually exclusive with `config` and `cloneExtractorId`.
2050
2052
  </dd>
2051
2053
  </dl>
2052
2054
  </dd>
@@ -2068,15 +2070,24 @@ await client.extractors.create({
2068
2070
  "type": "object",
2069
2071
  "properties": {
2070
2072
  "vendor_name": {
2071
- "type": "string",
2073
+ "type": [
2074
+ "string",
2075
+ "null"
2076
+ ],
2072
2077
  "description": "The name of the vendor"
2073
2078
  },
2074
2079
  "invoice_number": {
2075
- "type": "string",
2080
+ "type": [
2081
+ "string",
2082
+ "null"
2083
+ ],
2076
2084
  "description": "The invoice number"
2077
2085
  },
2078
2086
  "total_amount": {
2079
- "type": "number",
2087
+ "type": [
2088
+ "number",
2089
+ "null"
2090
+ ],
2080
2091
  "description": "The total amount due"
2081
2092
  }
2082
2093
  }
@@ -7230,6 +7241,77 @@ Example: `"evi_kR9mNP12Qw4yTv8BdR3H"`
7230
7241
  </details>
7231
7242
 
7232
7243
  ## EvaluationSetRuns
7244
+ <details><summary><code>client.evaluationSetRuns.<a href="/src/api/resources/evaluationSetRuns/client/Client.ts">create</a>({ ...params }) -> Extend.EvaluationSetRun</code></summary>
7245
+ <dl>
7246
+ <dd>
7247
+
7248
+ #### 📝 Description
7249
+
7250
+ <dl>
7251
+ <dd>
7252
+
7253
+ <dl>
7254
+ <dd>
7255
+
7256
+ Create and start an async evaluation set run. The response returns the evaluation set run object with its initial status; use `GET /evaluation_set_runs/{id}` to poll for completion.
7257
+
7258
+ Evaluation set runs are currently supported for document processor evaluation sets.
7259
+ </dd>
7260
+ </dl>
7261
+ </dd>
7262
+ </dl>
7263
+
7264
+ #### 🔌 Usage
7265
+
7266
+ <dl>
7267
+ <dd>
7268
+
7269
+ <dl>
7270
+ <dd>
7271
+
7272
+ ```typescript
7273
+ await client.evaluationSetRuns.create({
7274
+ evaluationSetId: "ev_2LcgeY_mp2T5yPaEuq5Lw",
7275
+ entity: {
7276
+ id: "ex_Xj8mK2pL9nR4vT7qY5wZ",
7277
+ version: "1.0"
7278
+ }
7279
+ });
7280
+
7281
+ ```
7282
+ </dd>
7283
+ </dl>
7284
+ </dd>
7285
+ </dl>
7286
+
7287
+ #### ⚙️ Parameters
7288
+
7289
+ <dl>
7290
+ <dd>
7291
+
7292
+ <dl>
7293
+ <dd>
7294
+
7295
+ **request:** `Extend.EvaluationSetRunsCreateRequest`
7296
+
7297
+ </dd>
7298
+ </dl>
7299
+
7300
+ <dl>
7301
+ <dd>
7302
+
7303
+ **requestOptions:** `EvaluationSetRunsClient.RequestOptions`
7304
+
7305
+ </dd>
7306
+ </dl>
7307
+ </dd>
7308
+ </dl>
7309
+
7310
+
7311
+ </dd>
7312
+ </dl>
7313
+ </details>
7314
+
7233
7315
  <details><summary><code>client.evaluationSetRuns.<a href="/src/api/resources/evaluationSetRuns/client/Client.ts">retrieve</a>(id, { ...params }) -> Extend.EvaluationSetRun</code></summary>
7234
7316
  <dl>
7235
7317
  <dd>
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.10.0";
1
+ export declare const SDK_VERSION = "1.11.0";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.10.0";
4
+ exports.SDK_VERSION = "1.11.0";