unstructured-transform-client 0.18.30 → 0.18.31
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 +11 -0
- package/dist/_generated/apis/ParseApi.d.ts +4 -0
- package/dist/_generated/apis/ParseApi.js +3 -0
- package/dist/_generated/models/AdvancedOptions.d.ts +31 -0
- package/dist/_generated/models/AdvancedOptions.js +44 -0
- package/dist/_generated/models/Enrichments.d.ts +30 -0
- package/dist/_generated/models/Enrichments.js +43 -0
- package/dist/_generated/models/JobConfiguration.d.ts +44 -0
- package/dist/_generated/models/JobConfiguration.js +56 -0
- package/dist/_generated/models/JobResult.d.ts +5 -0
- package/dist/_generated/models/JobResult.js +3 -0
- package/dist/_generated/models/index.d.ts +3 -0
- package/dist/_generated/models/index.js +3 -0
- package/dist/client.d.ts +11 -0
- package/dist/client.js +20 -0
- package/dist/index.d.ts +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.18.31
|
|
4
|
+
|
|
5
|
+
- Add `advancedOptions` to `parse.run`: `{ enrichments: { imageDescription: true } }`
|
|
6
|
+
describes the images in the document (off by default). The facade sends the
|
|
7
|
+
service's snake_case wire form, and the service rejects any other option
|
|
8
|
+
rather than ignoring it.
|
|
9
|
+
- `jobs.get` and the job stream now carry `configuration` (`profile` and
|
|
10
|
+
`advancedOptions`), the settings a job ran with. `advancedOptions` is null for
|
|
11
|
+
a job created before options were saved, and `configuration` itself is null for
|
|
12
|
+
an extraction over an existing parse.
|
|
13
|
+
|
|
3
14
|
## 0.18.28
|
|
4
15
|
|
|
5
16
|
- Add a 60 second per-request timeout for ordinary requests, with per-client
|
|
@@ -49,6 +49,10 @@ export interface ParseRunRequest {
|
|
|
49
49
|
* Optional customer-facing outcome profile. Omit it to use the current deployment default, balanced, or select one explicitly.
|
|
50
50
|
*/
|
|
51
51
|
profile?: ParseRunProfileEnum;
|
|
52
|
+
/**
|
|
53
|
+
* Optional JSON object of advanced options. The only supported option is enrichments.image_description, a boolean that defaults to false.
|
|
54
|
+
*/
|
|
55
|
+
advancedOptions?: string;
|
|
52
56
|
}
|
|
53
57
|
/**
|
|
54
58
|
*
|
|
@@ -75,6 +75,9 @@ export class ParseApi extends runtime.BaseAPI {
|
|
|
75
75
|
if (requestParameters['profile'] != null) {
|
|
76
76
|
formParams.append('profile', requestParameters['profile']);
|
|
77
77
|
}
|
|
78
|
+
if (requestParameters['advancedOptions'] != null) {
|
|
79
|
+
formParams.append('advanced_options', requestParameters['advancedOptions']);
|
|
80
|
+
}
|
|
78
81
|
let urlPath = `/api/v2/parse`;
|
|
79
82
|
return {
|
|
80
83
|
path: urlPath,
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { Enrichments } from './Enrichments.js';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface AdvancedOptions
|
|
17
|
+
*/
|
|
18
|
+
export interface AdvancedOptions {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
enrichments: Enrichments;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Check if a given object implements the AdvancedOptions interface.
|
|
26
|
+
*/
|
|
27
|
+
export declare function instanceOfAdvancedOptions(value: object): value is AdvancedOptions;
|
|
28
|
+
export declare function AdvancedOptionsFromJSON(json: any): AdvancedOptions;
|
|
29
|
+
export declare function AdvancedOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdvancedOptions;
|
|
30
|
+
export declare function AdvancedOptionsToJSON(json: any): AdvancedOptions;
|
|
31
|
+
export declare function AdvancedOptionsToJSONTyped(value?: AdvancedOptions | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,44 @@
|
|
|
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 { EnrichmentsFromJSON, EnrichmentsToJSON, } from './Enrichments.js';
|
|
15
|
+
/**
|
|
16
|
+
* Check if a given object implements the AdvancedOptions interface.
|
|
17
|
+
*/
|
|
18
|
+
export function instanceOfAdvancedOptions(value) {
|
|
19
|
+
if (!('enrichments' in value) || value['enrichments'] === undefined)
|
|
20
|
+
return false;
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
export function AdvancedOptionsFromJSON(json) {
|
|
24
|
+
return AdvancedOptionsFromJSONTyped(json, false);
|
|
25
|
+
}
|
|
26
|
+
export function AdvancedOptionsFromJSONTyped(json, ignoreDiscriminator) {
|
|
27
|
+
if (json == null) {
|
|
28
|
+
return json;
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
'enrichments': EnrichmentsFromJSON(json['enrichments']),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function AdvancedOptionsToJSON(json) {
|
|
35
|
+
return AdvancedOptionsToJSONTyped(json, false);
|
|
36
|
+
}
|
|
37
|
+
export function AdvancedOptionsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
38
|
+
if (value == null) {
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
'enrichments': EnrichmentsToJSON(value['enrichments']),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface Enrichments
|
|
16
|
+
*/
|
|
17
|
+
export interface Enrichments {
|
|
18
|
+
/**
|
|
19
|
+
* Whether descriptions were generated for images in the document.
|
|
20
|
+
*/
|
|
21
|
+
imageDescription: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Check if a given object implements the Enrichments interface.
|
|
25
|
+
*/
|
|
26
|
+
export declare function instanceOfEnrichments(value: object): value is Enrichments;
|
|
27
|
+
export declare function EnrichmentsFromJSON(json: any): Enrichments;
|
|
28
|
+
export declare function EnrichmentsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Enrichments;
|
|
29
|
+
export declare function EnrichmentsToJSON(json: any): Enrichments;
|
|
30
|
+
export declare function EnrichmentsToJSONTyped(value?: Enrichments | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
/**
|
|
15
|
+
* Check if a given object implements the Enrichments interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfEnrichments(value) {
|
|
18
|
+
if ((!('imageDescription' in value) && !('image_description' in value)) || (value['imageDescription'] === undefined && value['image_description'] === undefined))
|
|
19
|
+
return false;
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
export function EnrichmentsFromJSON(json) {
|
|
23
|
+
return EnrichmentsFromJSONTyped(json, false);
|
|
24
|
+
}
|
|
25
|
+
export function EnrichmentsFromJSONTyped(json, ignoreDiscriminator) {
|
|
26
|
+
if (json == null) {
|
|
27
|
+
return json;
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
'imageDescription': json['image_description'],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function EnrichmentsToJSON(json) {
|
|
34
|
+
return EnrichmentsToJSONTyped(json, false);
|
|
35
|
+
}
|
|
36
|
+
export function EnrichmentsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
37
|
+
if (value == null) {
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
'image_description': value['imageDescription'],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 { AdvancedOptions } from './AdvancedOptions.js';
|
|
13
|
+
/**
|
|
14
|
+
* The saved settings of one Parse job.
|
|
15
|
+
* @export
|
|
16
|
+
* @interface JobConfiguration
|
|
17
|
+
*/
|
|
18
|
+
export interface JobConfiguration {
|
|
19
|
+
/**
|
|
20
|
+
* The effective profile used for raw-document partitioning.
|
|
21
|
+
*/
|
|
22
|
+
profile: JobConfigurationProfileEnum | null;
|
|
23
|
+
/**
|
|
24
|
+
* The effective advanced options. Null only for a job created before options were saved, which keeps it distinguishable from a new job that ran with every option off.
|
|
25
|
+
*/
|
|
26
|
+
advancedOptions: AdvancedOptions | null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @export
|
|
30
|
+
*/
|
|
31
|
+
export declare const JobConfigurationProfileEnum: {
|
|
32
|
+
readonly Balanced: "balanced";
|
|
33
|
+
readonly Best: "best";
|
|
34
|
+
readonly Fast: "fast";
|
|
35
|
+
};
|
|
36
|
+
export type JobConfigurationProfileEnum = typeof JobConfigurationProfileEnum[keyof typeof JobConfigurationProfileEnum];
|
|
37
|
+
/**
|
|
38
|
+
* Check if a given object implements the JobConfiguration interface.
|
|
39
|
+
*/
|
|
40
|
+
export declare function instanceOfJobConfiguration(value: object): value is JobConfiguration;
|
|
41
|
+
export declare function JobConfigurationFromJSON(json: any): JobConfiguration;
|
|
42
|
+
export declare function JobConfigurationFromJSONTyped(json: any, ignoreDiscriminator: boolean): JobConfiguration;
|
|
43
|
+
export declare function JobConfigurationToJSON(json: any): JobConfiguration;
|
|
44
|
+
export declare function JobConfigurationToJSONTyped(value?: JobConfiguration | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,56 @@
|
|
|
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 { AdvancedOptionsFromJSON, AdvancedOptionsToJSON, } from './AdvancedOptions.js';
|
|
15
|
+
/**
|
|
16
|
+
* @export
|
|
17
|
+
*/
|
|
18
|
+
export const JobConfigurationProfileEnum = {
|
|
19
|
+
Balanced: 'balanced',
|
|
20
|
+
Best: 'best',
|
|
21
|
+
Fast: 'fast',
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Check if a given object implements the JobConfiguration interface.
|
|
25
|
+
*/
|
|
26
|
+
export function instanceOfJobConfiguration(value) {
|
|
27
|
+
if (!('profile' in value) || value['profile'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
if ((!('advancedOptions' in value) && !('advanced_options' in value)) || (value['advancedOptions'] === undefined && value['advanced_options'] === undefined))
|
|
30
|
+
return false;
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
export function JobConfigurationFromJSON(json) {
|
|
34
|
+
return JobConfigurationFromJSONTyped(json, false);
|
|
35
|
+
}
|
|
36
|
+
export function JobConfigurationFromJSONTyped(json, ignoreDiscriminator) {
|
|
37
|
+
if (json == null) {
|
|
38
|
+
return json;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
'profile': json['profile'],
|
|
42
|
+
'advancedOptions': AdvancedOptionsFromJSON(json['advanced_options']),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function JobConfigurationToJSON(json) {
|
|
46
|
+
return JobConfigurationToJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
export function JobConfigurationToJSONTyped(value, ignoreDiscriminator = false) {
|
|
49
|
+
if (value == null) {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
'profile': value['profile'],
|
|
54
|
+
'advanced_options': AdvancedOptionsToJSON(value['advancedOptions']),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -13,6 +13,7 @@ import type { JobStatus } from './JobStatus.js';
|
|
|
13
13
|
import type { ParseResult } from './ParseResult.js';
|
|
14
14
|
import type { JobRequestSource } from './JobRequestSource.js';
|
|
15
15
|
import type { SourceFile } from './SourceFile.js';
|
|
16
|
+
import type { JobConfiguration } from './JobConfiguration.js';
|
|
16
17
|
/**
|
|
17
18
|
* A job's state, carrying parsed content as soon as it is available.
|
|
18
19
|
* @export
|
|
@@ -47,6 +48,10 @@ export interface JobResult {
|
|
|
47
48
|
*
|
|
48
49
|
*/
|
|
49
50
|
error?: Error;
|
|
51
|
+
/**
|
|
52
|
+
* The settings this job ran with, available in every status. Null for extraction jobs, which run no partitioner of their own.
|
|
53
|
+
*/
|
|
54
|
+
configuration?: JobConfiguration | null;
|
|
50
55
|
/**
|
|
51
56
|
*
|
|
52
57
|
*/
|
|
@@ -15,6 +15,7 @@ import { JobStatusFromJSON, JobStatusToJSON, } from './JobStatus.js';
|
|
|
15
15
|
import { ParseResultFromJSON, ParseResultToJSON, } from './ParseResult.js';
|
|
16
16
|
import { JobRequestSourceFromJSON, JobRequestSourceToJSON, } from './JobRequestSource.js';
|
|
17
17
|
import { SourceFileFromJSON, SourceFileToJSON, } from './SourceFile.js';
|
|
18
|
+
import { JobConfigurationFromJSON, JobConfigurationToJSON, } from './JobConfiguration.js';
|
|
18
19
|
/**
|
|
19
20
|
* Check if a given object implements the JobResult interface.
|
|
20
21
|
*/
|
|
@@ -44,6 +45,7 @@ export function JobResultFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
44
45
|
'cancellationRequested': json['cancellation_requested'] == null ? undefined : json['cancellation_requested'],
|
|
45
46
|
'source': json['source'] === undefined ? undefined : json['source'] === null ? null : SourceFileFromJSON(json['source']),
|
|
46
47
|
'error': json['error'] == null ? undefined : json['error'],
|
|
48
|
+
'configuration': json['configuration'] === undefined ? undefined : json['configuration'] === null ? null : JobConfigurationFromJSON(json['configuration']),
|
|
47
49
|
'result': json['result'] == null ? undefined : ParseResultFromJSON(json['result']),
|
|
48
50
|
'requestSource': JobRequestSourceFromJSON(json['request_source']),
|
|
49
51
|
};
|
|
@@ -63,6 +65,7 @@ export function JobResultToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
63
65
|
'cancellation_requested': value['cancellationRequested'],
|
|
64
66
|
'source': SourceFileToJSON(value['source']),
|
|
65
67
|
'error': value['error'],
|
|
68
|
+
'configuration': JobConfigurationToJSON(value['configuration']),
|
|
66
69
|
'result': ParseResultToJSON(value['result']),
|
|
67
70
|
'request_source': JobRequestSourceToJSON(value['requestSource']),
|
|
68
71
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
export * from './AdvancedOptions.js';
|
|
1
2
|
export * from './Citation.js';
|
|
2
3
|
export * from './DocumentMetadata.js';
|
|
3
4
|
export * from './Element.js';
|
|
4
5
|
export * from './ElementMetadata.js';
|
|
6
|
+
export * from './Enrichments.js';
|
|
5
7
|
export * from './ErrorCode.js';
|
|
6
8
|
export * from './ExtractRequest.js';
|
|
7
9
|
export * from './ExtractionResult.js';
|
|
8
10
|
export * from './FieldMetadata.js';
|
|
9
11
|
export * from './JobAccepted.js';
|
|
12
|
+
export * from './JobConfiguration.js';
|
|
10
13
|
export * from './JobOperation.js';
|
|
11
14
|
export * from './JobPage.js';
|
|
12
15
|
export * from './JobRequestSource.js';
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export * from './AdvancedOptions.js';
|
|
3
4
|
export * from './Citation.js';
|
|
4
5
|
export * from './DocumentMetadata.js';
|
|
5
6
|
export * from './Element.js';
|
|
6
7
|
export * from './ElementMetadata.js';
|
|
8
|
+
export * from './Enrichments.js';
|
|
7
9
|
export * from './ErrorCode.js';
|
|
8
10
|
export * from './ExtractRequest.js';
|
|
9
11
|
export * from './ExtractionResult.js';
|
|
10
12
|
export * from './FieldMetadata.js';
|
|
11
13
|
export * from './JobAccepted.js';
|
|
14
|
+
export * from './JobConfiguration.js';
|
|
12
15
|
export * from './JobOperation.js';
|
|
13
16
|
export * from './JobPage.js';
|
|
14
17
|
export * from './JobRequestSource.js';
|
package/dist/client.d.ts
CHANGED
|
@@ -60,6 +60,15 @@ export declare class TransformClient {
|
|
|
60
60
|
/** @internal */ readonly retries: Required<RetryConfig> | undefined;
|
|
61
61
|
constructor(options?: TransformClientOptions);
|
|
62
62
|
}
|
|
63
|
+
/** Enrichments to run on the parsed document. Every option is off by default. */
|
|
64
|
+
export interface Enrichments {
|
|
65
|
+
/** Describe the images in the document. Off unless `true`. */
|
|
66
|
+
imageDescription?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** Optional settings for `parse.run`. Anything unset keeps its default. */
|
|
69
|
+
export interface AdvancedOptions {
|
|
70
|
+
enrichments?: Enrichments;
|
|
71
|
+
}
|
|
63
72
|
export interface ParseOptions extends RequestOptions {
|
|
64
73
|
input?: FileInput;
|
|
65
74
|
fileId?: string;
|
|
@@ -68,6 +77,8 @@ export interface ParseOptions extends RequestOptions {
|
|
|
68
77
|
output?: OutputFormat;
|
|
69
78
|
include?: string[];
|
|
70
79
|
profile?: ParseRunProfileEnum;
|
|
80
|
+
/** `{ enrichments: { imageDescription: true } }` describes the images in the document. */
|
|
81
|
+
advancedOptions?: AdvancedOptions;
|
|
71
82
|
waitSeconds?: number;
|
|
72
83
|
}
|
|
73
84
|
declare class ParseNamespace {
|
package/dist/client.js
CHANGED
|
@@ -114,6 +114,25 @@ function validateTimeoutMs(timeoutMs) {
|
|
|
114
114
|
}
|
|
115
115
|
return timeoutMs;
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* The wire form of {@link AdvancedOptions}: a JSON string with snake_case keys.
|
|
119
|
+
* Only keys the caller set are sent, so the service sees exactly what was asked
|
|
120
|
+
* for and rejects anything it does not define instead of ignoring it.
|
|
121
|
+
*/
|
|
122
|
+
function advancedOptionsToWire(options) {
|
|
123
|
+
if (options === undefined)
|
|
124
|
+
return undefined;
|
|
125
|
+
const { enrichments, ...rest } = options;
|
|
126
|
+
const wire = { ...rest };
|
|
127
|
+
if (enrichments !== undefined) {
|
|
128
|
+
const { imageDescription, ...otherEnrichments } = enrichments;
|
|
129
|
+
wire.enrichments = {
|
|
130
|
+
...otherEnrichments,
|
|
131
|
+
...(imageDescription === undefined ? {} : { image_description: imageDescription }),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
return JSON.stringify(wire);
|
|
135
|
+
}
|
|
117
136
|
class ParseNamespace {
|
|
118
137
|
client;
|
|
119
138
|
constructor(client) {
|
|
@@ -143,6 +162,7 @@ class ParseNamespace {
|
|
|
143
162
|
: options.schema,
|
|
144
163
|
prompt: options.prompt,
|
|
145
164
|
profile: options.profile,
|
|
165
|
+
advancedOptions: advancedOptionsToWire(options.advancedOptions),
|
|
146
166
|
}, requestInit(options)));
|
|
147
167
|
}
|
|
148
168
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* response types this SDK returns, so a caller needs to be able to name them.
|
|
14
14
|
*/
|
|
15
15
|
export { DEFAULT_SERVER_URL, TransformClient } from "./client.js";
|
|
16
|
-
export type { ExtractFromDocumentOptions, ExtractOptions, JobsGetOptions, JobsListOptions, JobsStreamOptions, ParseOptions, RequestOptions, TransformClientOptions, } from "./client.js";
|
|
16
|
+
export type { AdvancedOptions, Enrichments, ExtractFromDocumentOptions, ExtractOptions, JobsGetOptions, JobsListOptions, JobsStreamOptions, ParseOptions, RequestOptions, TransformClientOptions, } from "./client.js";
|
|
17
17
|
export { RequestTimeoutError, type RetryConfig } from "./retry.js";
|
|
18
18
|
export { isTerminal, type JobEvent } from "./sse.js";
|
|
19
19
|
export { asFile, type FileInput } from "./files.js";
|
|
@@ -23,4 +23,4 @@ export { FetchError, RequiredError, ResponseError } from "./_generated/runtime.j
|
|
|
23
23
|
export type { ModelError as TransformErrorBody } from "./_generated/models/index.js";
|
|
24
24
|
export { ErrorCode, JobStatus, OutputFormat, } from "./_generated/models/index.js";
|
|
25
25
|
export { ParseRunProfileEnum as Profile } from "./_generated/apis/ParseApi.js";
|
|
26
|
-
export type { Element, ExtractionResult, JobAccepted, JobPage, JobResult, JobSummary, ParseResult, UploadResult, } from "./_generated/models/index.js";
|
|
26
|
+
export type { Element, ExtractionResult, JobAccepted, JobConfiguration, JobPage, JobResult, JobSummary, ParseResult, UploadResult, } from "./_generated/models/index.js";
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED