unstructured-transform-client 0.18.107 → 0.18.109

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.
@@ -53,10 +53,6 @@ export interface ParseRunRequest {
53
53
  * Optional JSON object of advanced options. The only supported option is enrichments.image_description, a boolean that defaults to false.
54
54
  */
55
55
  advancedOptions?: string;
56
- /**
57
- * Enable field-level Extract confidence when schema is supplied.
58
- */
59
- extractConfidence?: boolean;
60
56
  }
61
57
  /**
62
58
  *
@@ -78,9 +78,6 @@ export class ParseApi extends runtime.BaseAPI {
78
78
  if (requestParameters['advancedOptions'] != null) {
79
79
  formParams.append('advanced_options', requestParameters['advancedOptions']);
80
80
  }
81
- if (requestParameters['extractConfidence'] != null) {
82
- formParams.append('extract_confidence', requestParameters['extractConfidence']);
83
- }
84
81
  let urlPath = `/api/v2/parse`;
85
82
  return {
86
83
  path: urlPath,
@@ -20,10 +20,6 @@ export interface AdvancedOptions {
20
20
  *
21
21
  */
22
22
  enrichments: Enrichments;
23
- /**
24
- * Whether field-level Extract confidence was enabled for the job.
25
- */
26
- extractConfidence?: boolean;
27
23
  }
28
24
  /**
29
25
  * Check if a given object implements the AdvancedOptions interface.
@@ -29,7 +29,6 @@ export function AdvancedOptionsFromJSONTyped(json, ignoreDiscriminator) {
29
29
  }
30
30
  return {
31
31
  'enrichments': EnrichmentsFromJSON(json['enrichments']),
32
- 'extractConfidence': json['extract_confidence'] == null ? undefined : json['extract_confidence'],
33
32
  };
34
33
  }
35
34
  export function AdvancedOptionsToJSON(json) {
@@ -41,6 +40,5 @@ export function AdvancedOptionsToJSONTyped(value, ignoreDiscriminator = false) {
41
40
  }
42
41
  return {
43
42
  'enrichments': EnrichmentsToJSON(value['enrichments']),
44
- 'extract_confidence': value['extractConfidence'],
45
43
  };
46
44
  }
@@ -23,6 +23,7 @@ export declare const ErrorCode: {
23
23
  readonly InvalidSchema: "invalid_schema";
24
24
  readonly Unauthorized: "unauthorized";
25
25
  readonly QuotaExceeded: "quota_exceeded";
26
+ readonly InsufficientBalance: "insufficient_balance";
26
27
  readonly FileTooLarge: "file_too_large";
27
28
  readonly UnsupportedFileType: "unsupported_file_type";
28
29
  readonly CouldNotParse: "could_not_parse";
@@ -25,6 +25,7 @@ export const ErrorCode = {
25
25
  InvalidSchema: 'invalid_schema',
26
26
  Unauthorized: 'unauthorized',
27
27
  QuotaExceeded: 'quota_exceeded',
28
+ InsufficientBalance: 'insufficient_balance',
28
29
  FileTooLarge: 'file_too_large',
29
30
  UnsupportedFileType: 'unsupported_file_type',
30
31
  CouldNotParse: 'could_not_parse',
@@ -29,10 +29,6 @@ export interface ExtractRequest {
29
29
  * Optional free-text guidance that shapes how extracted fields are filled. Limited to 1,048,576 bytes when encoded as UTF-8.
30
30
  */
31
31
  prompt?: string;
32
- /**
33
- * Enable field-level Extract confidence for this request.
34
- */
35
- extractConfidence?: boolean;
36
32
  }
37
33
  /**
38
34
  * Check if a given object implements the ExtractRequest interface.
@@ -32,7 +32,6 @@ export function ExtractRequestFromJSONTyped(json, ignoreDiscriminator) {
32
32
  'parseId': json['parse_id'],
33
33
  'schema': json['schema'],
34
34
  'prompt': json['prompt'] == null ? undefined : json['prompt'],
35
- 'extractConfidence': json['extract_confidence'] == null ? undefined : json['extract_confidence'],
36
35
  };
37
36
  }
38
37
  export function ExtractRequestToJSON(json) {
@@ -46,6 +45,5 @@ export function ExtractRequestToJSONTyped(value, ignoreDiscriminator = false) {
46
45
  'parse_id': value['parseId'],
47
46
  'schema': value['schema'],
48
47
  'prompt': value['prompt'],
49
- 'extract_confidence': value['extractConfidence'],
50
48
  };
51
49
  }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Unstructured Transform API
3
+ * One document in, the parsed document back. A single call takes a document and returns structured output — no job graph, no strategy selection, no model provider setup, and no polling loop. An optional schema switches the request from parse-only to parse-then-extract.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { ErrorCode } from './ErrorCode.js';
13
+ /**
14
+ * The Error envelope for a spent balance, with the account's balance and running work.
15
+ * @export
16
+ * @interface InsufficientBalanceError
17
+ */
18
+ export interface InsufficientBalanceError {
19
+ /**
20
+ *
21
+ */
22
+ code: ErrorCode;
23
+ /**
24
+ * What went wrong, and what to do about it.
25
+ */
26
+ message: string;
27
+ /**
28
+ * The account's available balance in US dollars.
29
+ */
30
+ balanceUsd: number;
31
+ /**
32
+ * How many of the account's jobs are still running; they finish normally.
33
+ */
34
+ jobsStillRunning: number;
35
+ /**
36
+ * Always null, because no job was created.
37
+ */
38
+ jobId: string | null;
39
+ }
40
+ /**
41
+ * Check if a given object implements the InsufficientBalanceError interface.
42
+ */
43
+ export declare function instanceOfInsufficientBalanceError(value: object): value is InsufficientBalanceError;
44
+ export declare function InsufficientBalanceErrorFromJSON(json: any): InsufficientBalanceError;
45
+ export declare function InsufficientBalanceErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): InsufficientBalanceError;
46
+ export declare function InsufficientBalanceErrorToJSON(json: any): InsufficientBalanceError;
47
+ export declare function InsufficientBalanceErrorToJSONTyped(value?: InsufficientBalanceError | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,60 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Unstructured Transform API
5
+ * One document in, the parsed document back. A single call takes a document and returns structured output — no job graph, no strategy selection, no model provider setup, and no polling loop. An optional schema switches the request from parse-only to parse-then-extract.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ import { ErrorCodeFromJSON, ErrorCodeToJSON, } from './ErrorCode.js';
15
+ /**
16
+ * Check if a given object implements the InsufficientBalanceError interface.
17
+ */
18
+ export function instanceOfInsufficientBalanceError(value) {
19
+ if (!('code' in value) || value['code'] === undefined)
20
+ return false;
21
+ if (!('message' in value) || value['message'] === undefined)
22
+ return false;
23
+ if ((!('balanceUsd' in value) && !('balance_usd' in value)) || (value['balanceUsd'] === undefined && value['balance_usd'] === undefined))
24
+ return false;
25
+ if ((!('jobsStillRunning' in value) && !('jobs_still_running' in value)) || (value['jobsStillRunning'] === undefined && value['jobs_still_running'] === undefined))
26
+ return false;
27
+ if ((!('jobId' in value) && !('job_id' in value)) || (value['jobId'] === undefined && value['job_id'] === undefined))
28
+ return false;
29
+ return true;
30
+ }
31
+ export function InsufficientBalanceErrorFromJSON(json) {
32
+ return InsufficientBalanceErrorFromJSONTyped(json, false);
33
+ }
34
+ export function InsufficientBalanceErrorFromJSONTyped(json, ignoreDiscriminator) {
35
+ if (json == null) {
36
+ return json;
37
+ }
38
+ return {
39
+ 'code': ErrorCodeFromJSON(json['code']),
40
+ 'message': json['message'],
41
+ 'balanceUsd': json['balance_usd'],
42
+ 'jobsStillRunning': json['jobs_still_running'],
43
+ 'jobId': json['job_id'],
44
+ };
45
+ }
46
+ export function InsufficientBalanceErrorToJSON(json) {
47
+ return InsufficientBalanceErrorToJSONTyped(json, false);
48
+ }
49
+ export function InsufficientBalanceErrorToJSONTyped(value, ignoreDiscriminator = false) {
50
+ if (value == null) {
51
+ return value;
52
+ }
53
+ return {
54
+ 'code': ErrorCodeToJSON(value['code']),
55
+ 'message': value['message'],
56
+ 'balance_usd': value['balanceUsd'],
57
+ 'jobs_still_running': value['jobsStillRunning'],
58
+ 'job_id': value['jobId'],
59
+ };
60
+ }
@@ -40,7 +40,7 @@ export interface ParseResult {
40
40
  */
41
41
  markdown: string | null;
42
42
  /**
43
- * The document envelope version. Version 2.1 is returned only when extract_confidence was enabled and uses value/confidence wrappers.
43
+ * The document envelope version. Version 2.1 is returned for an Extract on a deployment that scores fields, and uses value/extract_confidence wrappers.
44
44
  */
45
45
  formatVersion: string;
46
46
  /**
@@ -10,6 +10,7 @@ export * from './ExtractRequest.js';
10
10
  export * from './ExtractionResult.js';
11
11
  export * from './FailedPage.js';
12
12
  export * from './FieldMetadata.js';
13
+ export * from './InsufficientBalanceError.js';
13
14
  export * from './JobAccepted.js';
14
15
  export * from './JobConfiguration.js';
15
16
  export * from './JobOperation.js';
@@ -12,6 +12,7 @@ export * from './ExtractRequest.js';
12
12
  export * from './ExtractionResult.js';
13
13
  export * from './FailedPage.js';
14
14
  export * from './FieldMetadata.js';
15
+ export * from './InsufficientBalanceError.js';
15
16
  export * from './JobAccepted.js';
16
17
  export * from './JobConfiguration.js';
17
18
  export * from './JobOperation.js';
package/dist/client.d.ts CHANGED
@@ -79,8 +79,6 @@ export interface ParseOptions extends RequestOptions {
79
79
  profile?: ParseRunProfileEnum;
80
80
  /** `{ enrichments: { imageDescription: true } }` describes the images in the document. */
81
81
  advancedOptions?: AdvancedOptions;
82
- /** Return field-level Extract confidence with the 2.1 response shape. */
83
- extractConfidence?: boolean;
84
82
  waitSeconds?: number;
85
83
  }
86
84
  declare class ParseNamespace {
@@ -99,7 +97,6 @@ export interface ExtractOptions extends RequestOptions {
99
97
  parseId: string;
100
98
  schema: Record<string, unknown>;
101
99
  prompt?: string;
102
- extractConfidence?: boolean;
103
100
  waitSeconds?: number;
104
101
  }
105
102
  export interface ExtractFromDocumentOptions extends RequestOptions {
@@ -110,7 +107,6 @@ export interface ExtractFromDocumentOptions extends RequestOptions {
110
107
  schema: Record<string, unknown>;
111
108
  prompt?: string;
112
109
  profile?: ParseRunProfileEnum;
113
- extractConfidence?: boolean;
114
110
  waitSeconds?: number;
115
111
  }
116
112
  declare class ExtractNamespace {
package/dist/client.js CHANGED
@@ -163,7 +163,6 @@ class ParseNamespace {
163
163
  prompt: options.prompt,
164
164
  profile: options.profile,
165
165
  advancedOptions: advancedOptionsToWire(options.advancedOptions),
166
- ...(options.extractConfidence ? { extractConfidence: true } : {}),
167
166
  }, requestInit(options)));
168
167
  }
169
168
  }
@@ -179,7 +178,6 @@ class ExtractNamespace {
179
178
  parseId: options.parseId,
180
179
  schema: options.schema,
181
180
  prompt: options.prompt,
182
- ...(options.extractConfidence ? { extractConfidence: true } : {}),
183
181
  },
184
182
  prefer: prefer(options.waitSeconds),
185
183
  }, requestInit(options)));
@@ -212,7 +210,6 @@ class ExtractNamespace {
212
210
  schema: JSON.stringify(options.schema),
213
211
  prompt: options.prompt,
214
212
  profile: options.profile,
215
- extract_confidence: options.extractConfidence ? "true" : undefined,
216
213
  },
217
214
  waitSeconds: options.waitSeconds,
218
215
  signal: options.signal,
package/dist/index.d.ts CHANGED
@@ -21,6 +21,7 @@ export { isAccepted, type Outcome } from "./outcome.js";
21
21
  export { VERSION } from "./version.js";
22
22
  export { FetchError, RequiredError, ResponseError } from "./_generated/runtime.js";
23
23
  export type { ModelError as TransformErrorBody } from "./_generated/models/index.js";
24
+ export type { InsufficientBalanceError } from "./_generated/models/index.js";
24
25
  export { ErrorCode, JobStatus, OutputFormat, } from "./_generated/models/index.js";
25
26
  export { ParseRunProfileEnum as Profile } from "./_generated/apis/ParseApi.js";
26
27
  export type { Element, ExtractionResult, JobAccepted, JobConfiguration, JobPage, JobResult, JobSummary, ParseResult, UploadResult, } from "./_generated/models/index.js";
package/dist/version.d.ts CHANGED
@@ -12,4 +12,4 @@
12
12
  * (tools/release/derived_versions.py); change the series only for a
13
13
  * deliberate minor or major release.
14
14
  */
15
- export declare const VERSION = "0.18.107";
15
+ export declare const VERSION = "0.18.109";
package/dist/version.js CHANGED
@@ -12,4 +12,4 @@
12
12
  * (tools/release/derived_versions.py); change the series only for a
13
13
  * deliberate minor or major release.
14
14
  */
15
- export const VERSION = "0.18.107";
15
+ export const VERSION = "0.18.109";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unstructured-transform-client",
3
- "version": "0.18.107",
3
+ "version": "0.18.109",
4
4
  "description": "TypeScript client for the Unstructured Transform v2 API — one document in, structured output back.",
5
5
  "license": "MIT",
6
6
  "author": "Unstructured",