unstructured-transform-client 0.18.18
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/LICENSE +21 -0
- package/README.md +210 -0
- package/dist/_generated/apis/ExtractApi.d.ts +43 -0
- package/dist/_generated/apis/ExtractApi.js +70 -0
- package/dist/_generated/apis/JobsApi.d.ts +117 -0
- package/dist/_generated/apis/JobsApi.js +211 -0
- package/dist/_generated/apis/ParseApi.d.ts +79 -0
- package/dist/_generated/apis/ParseApi.js +111 -0
- package/dist/_generated/apis/UploadApi.d.ts +78 -0
- package/dist/_generated/apis/UploadApi.js +172 -0
- package/dist/_generated/apis/index.d.ts +4 -0
- package/dist/_generated/apis/index.js +6 -0
- package/dist/_generated/index.d.ts +3 -0
- package/dist/_generated/index.js +5 -0
- package/dist/_generated/models/Citation.d.ts +31 -0
- package/dist/_generated/models/Citation.js +44 -0
- package/dist/_generated/models/DocumentMetadata.d.ts +30 -0
- package/dist/_generated/models/DocumentMetadata.js +43 -0
- package/dist/_generated/models/Element.d.ts +43 -0
- package/dist/_generated/models/Element.js +56 -0
- package/dist/_generated/models/ElementMetadata.d.ts +40 -0
- package/dist/_generated/models/ElementMetadata.js +51 -0
- package/dist/_generated/models/ErrorCode.d.ts +46 -0
- package/dist/_generated/models/ErrorCode.js +64 -0
- package/dist/_generated/models/ExtractRequest.d.ts +40 -0
- package/dist/_generated/models/ExtractRequest.js +49 -0
- package/dist/_generated/models/ExtractionResult.d.ts +37 -0
- package/dist/_generated/models/ExtractionResult.js +47 -0
- package/dist/_generated/models/FieldMetadata.d.ts +31 -0
- package/dist/_generated/models/FieldMetadata.js +42 -0
- package/dist/_generated/models/JobAccepted.d.ts +67 -0
- package/dist/_generated/models/JobAccepted.js +73 -0
- package/dist/_generated/models/JobOperation.d.ts +25 -0
- package/dist/_generated/models/JobOperation.js +43 -0
- package/dist/_generated/models/JobPage.d.ts +35 -0
- package/dist/_generated/models/JobPage.js +48 -0
- package/dist/_generated/models/JobResult.d.ts +61 -0
- package/dist/_generated/models/JobResult.js +64 -0
- package/dist/_generated/models/JobResultState.d.ts +26 -0
- package/dist/_generated/models/JobResultState.js +44 -0
- package/dist/_generated/models/JobStatus.d.ts +29 -0
- package/dist/_generated/models/JobStatus.js +47 -0
- package/dist/_generated/models/JobSummary.d.ts +74 -0
- package/dist/_generated/models/JobSummary.js +86 -0
- package/dist/_generated/models/Locator.d.ts +45 -0
- package/dist/_generated/models/Locator.js +57 -0
- package/dist/_generated/models/ModelError.d.ts +35 -0
- package/dist/_generated/models/ModelError.js +48 -0
- package/dist/_generated/models/OutputFormat.d.ts +25 -0
- package/dist/_generated/models/OutputFormat.js +43 -0
- package/dist/_generated/models/ParseResult.d.ts +87 -0
- package/dist/_generated/models/ParseResult.js +98 -0
- package/dist/_generated/models/SourceFile.d.ts +42 -0
- package/dist/_generated/models/SourceFile.js +56 -0
- package/dist/_generated/models/TransformStatus.d.ts +26 -0
- package/dist/_generated/models/TransformStatus.js +44 -0
- package/dist/_generated/models/TransformWarning.d.ts +34 -0
- package/dist/_generated/models/TransformWarning.js +47 -0
- package/dist/_generated/models/UploadResult.d.ts +38 -0
- package/dist/_generated/models/UploadResult.js +52 -0
- package/dist/_generated/models/index.d.ts +23 -0
- package/dist/_generated/models/index.js +25 -0
- package/dist/_generated/runtime.d.ts +196 -0
- package/dist/_generated/runtime.js +398 -0
- package/dist/client.d.ts +145 -0
- package/dist/client.js +259 -0
- package/dist/files.d.ts +32 -0
- package/dist/files.js +46 -0
- package/dist/hostHeaders.d.ts +36 -0
- package/dist/hostHeaders.js +133 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +35 -0
- package/dist/multipart.d.ts +50 -0
- package/dist/multipart.js +65 -0
- package/dist/outcome.d.ts +45 -0
- package/dist/outcome.js +40 -0
- package/dist/retry.d.ts +16 -0
- package/dist/retry.js +181 -0
- package/dist/sse.d.ts +50 -0
- package/dist/sse.js +140 -0
- package/dist/version.d.ts +10 -0
- package/dist/version.js +10 -0
- package/package.json +41 -0
|
@@ -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 { ElementMetadataFromJSON, ElementMetadataToJSON, } from './ElementMetadata.js';
|
|
15
|
+
/**
|
|
16
|
+
* Check if a given object implements the Element interface.
|
|
17
|
+
*/
|
|
18
|
+
export function instanceOfElement(value) {
|
|
19
|
+
if ((!('elementId' in value) && !('element_id' in value)) || (value['elementId'] === undefined && value['element_id'] === undefined))
|
|
20
|
+
return false;
|
|
21
|
+
if (!('type' in value) || value['type'] === undefined)
|
|
22
|
+
return false;
|
|
23
|
+
if (!('text' in value) || value['text'] === undefined)
|
|
24
|
+
return false;
|
|
25
|
+
if (!('metadata' in value) || value['metadata'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
export function ElementFromJSON(json) {
|
|
30
|
+
return ElementFromJSONTyped(json, false);
|
|
31
|
+
}
|
|
32
|
+
export function ElementFromJSONTyped(json, ignoreDiscriminator) {
|
|
33
|
+
if (json == null) {
|
|
34
|
+
return json;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
'elementId': json['element_id'],
|
|
38
|
+
'type': json['type'],
|
|
39
|
+
'text': json['text'],
|
|
40
|
+
'metadata': ElementMetadataFromJSON(json['metadata']),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function ElementToJSON(json) {
|
|
44
|
+
return ElementToJSONTyped(json, false);
|
|
45
|
+
}
|
|
46
|
+
export function ElementToJSONTyped(value, ignoreDiscriminator = false) {
|
|
47
|
+
if (value == null) {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
'element_id': value['elementId'],
|
|
52
|
+
'type': value['type'],
|
|
53
|
+
'text': value['text'],
|
|
54
|
+
'metadata': ElementMetadataToJSON(value['metadata']),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
* Public per-element metadata.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface ElementMetadata
|
|
16
|
+
*/
|
|
17
|
+
export interface ElementMetadata {
|
|
18
|
+
/**
|
|
19
|
+
* One-based source page number.
|
|
20
|
+
*/
|
|
21
|
+
pageNumber: number | null;
|
|
22
|
+
/**
|
|
23
|
+
* Coordinate projection when requested.
|
|
24
|
+
*/
|
|
25
|
+
coordinates: {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
} | null;
|
|
28
|
+
/**
|
|
29
|
+
* Table HTML projection when requested.
|
|
30
|
+
*/
|
|
31
|
+
textAsHtml: string | null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Check if a given object implements the ElementMetadata interface.
|
|
35
|
+
*/
|
|
36
|
+
export declare function instanceOfElementMetadata(value: object): value is ElementMetadata;
|
|
37
|
+
export declare function ElementMetadataFromJSON(json: any): ElementMetadata;
|
|
38
|
+
export declare function ElementMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): ElementMetadata;
|
|
39
|
+
export declare function ElementMetadataToJSON(json: any): ElementMetadata;
|
|
40
|
+
export declare function ElementMetadataToJSONTyped(value?: ElementMetadata | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,51 @@
|
|
|
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 ElementMetadata interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfElementMetadata(value) {
|
|
18
|
+
if ((!('pageNumber' in value) && !('page_number' in value)) || (value['pageNumber'] === undefined && value['page_number'] === undefined))
|
|
19
|
+
return false;
|
|
20
|
+
if (!('coordinates' in value) || value['coordinates'] === undefined)
|
|
21
|
+
return false;
|
|
22
|
+
if ((!('textAsHtml' in value) && !('text_as_html' in value)) || (value['textAsHtml'] === undefined && value['text_as_html'] === undefined))
|
|
23
|
+
return false;
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
export function ElementMetadataFromJSON(json) {
|
|
27
|
+
return ElementMetadataFromJSONTyped(json, false);
|
|
28
|
+
}
|
|
29
|
+
export function ElementMetadataFromJSONTyped(json, ignoreDiscriminator) {
|
|
30
|
+
if (json == null) {
|
|
31
|
+
return json;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
'pageNumber': json['page_number'],
|
|
35
|
+
'coordinates': json['coordinates'],
|
|
36
|
+
'textAsHtml': json['text_as_html'],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export function ElementMetadataToJSON(json) {
|
|
40
|
+
return ElementMetadataToJSONTyped(json, false);
|
|
41
|
+
}
|
|
42
|
+
export function ElementMetadataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
43
|
+
if (value == null) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
'page_number': value['pageNumber'],
|
|
48
|
+
'coordinates': value['coordinates'],
|
|
49
|
+
'text_as_html': value['textAsHtml'],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
*/
|
|
16
|
+
export declare const ErrorCode: {
|
|
17
|
+
readonly InvalidInput: "invalid_input";
|
|
18
|
+
readonly MissingInput: "missing_input";
|
|
19
|
+
readonly InvalidOutputFormat: "invalid_output_format";
|
|
20
|
+
readonly OutputOptionUnavailable: "output_option_unavailable";
|
|
21
|
+
readonly MalformedSchemaJson: "malformed_schema_json";
|
|
22
|
+
readonly SchemaTooLarge: "schema_too_large";
|
|
23
|
+
readonly InvalidSchema: "invalid_schema";
|
|
24
|
+
readonly Unauthorized: "unauthorized";
|
|
25
|
+
readonly QuotaExceeded: "quota_exceeded";
|
|
26
|
+
readonly FileTooLarge: "file_too_large";
|
|
27
|
+
readonly UnsupportedFileType: "unsupported_file_type";
|
|
28
|
+
readonly CouldNotParse: "could_not_parse";
|
|
29
|
+
readonly RateLimited: "rate_limited";
|
|
30
|
+
readonly ParseJobFailed: "parse_job_failed";
|
|
31
|
+
readonly ProfileUnavailable: "profile_unavailable";
|
|
32
|
+
readonly ResultExpired: "result_expired";
|
|
33
|
+
readonly ParseNotComplete: "parse_not_complete";
|
|
34
|
+
readonly ParseExpired: "parse_expired";
|
|
35
|
+
readonly InternalError: "internal_error";
|
|
36
|
+
readonly NotFound: "not_found";
|
|
37
|
+
readonly MethodNotAllowed: "method_not_allowed";
|
|
38
|
+
readonly JobNotTerminal: "job_not_terminal";
|
|
39
|
+
readonly Forbidden: "forbidden";
|
|
40
|
+
};
|
|
41
|
+
export type ErrorCode = typeof ErrorCode[keyof typeof ErrorCode];
|
|
42
|
+
export declare function instanceOfErrorCode(value: any): boolean;
|
|
43
|
+
export declare function ErrorCodeFromJSON(json: any): ErrorCode;
|
|
44
|
+
export declare function ErrorCodeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorCode;
|
|
45
|
+
export declare function ErrorCodeToJSON(value?: ErrorCode | null): any;
|
|
46
|
+
export declare function ErrorCodeToJSONTyped(value: any, ignoreDiscriminator: boolean): ErrorCode;
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
*/
|
|
18
|
+
export const ErrorCode = {
|
|
19
|
+
InvalidInput: 'invalid_input',
|
|
20
|
+
MissingInput: 'missing_input',
|
|
21
|
+
InvalidOutputFormat: 'invalid_output_format',
|
|
22
|
+
OutputOptionUnavailable: 'output_option_unavailable',
|
|
23
|
+
MalformedSchemaJson: 'malformed_schema_json',
|
|
24
|
+
SchemaTooLarge: 'schema_too_large',
|
|
25
|
+
InvalidSchema: 'invalid_schema',
|
|
26
|
+
Unauthorized: 'unauthorized',
|
|
27
|
+
QuotaExceeded: 'quota_exceeded',
|
|
28
|
+
FileTooLarge: 'file_too_large',
|
|
29
|
+
UnsupportedFileType: 'unsupported_file_type',
|
|
30
|
+
CouldNotParse: 'could_not_parse',
|
|
31
|
+
RateLimited: 'rate_limited',
|
|
32
|
+
ParseJobFailed: 'parse_job_failed',
|
|
33
|
+
ProfileUnavailable: 'profile_unavailable',
|
|
34
|
+
ResultExpired: 'result_expired',
|
|
35
|
+
ParseNotComplete: 'parse_not_complete',
|
|
36
|
+
ParseExpired: 'parse_expired',
|
|
37
|
+
InternalError: 'internal_error',
|
|
38
|
+
NotFound: 'not_found',
|
|
39
|
+
MethodNotAllowed: 'method_not_allowed',
|
|
40
|
+
JobNotTerminal: 'job_not_terminal',
|
|
41
|
+
Forbidden: 'forbidden',
|
|
42
|
+
};
|
|
43
|
+
export function instanceOfErrorCode(value) {
|
|
44
|
+
for (const key in ErrorCode) {
|
|
45
|
+
if (Object.prototype.hasOwnProperty.call(ErrorCode, key)) {
|
|
46
|
+
if (ErrorCode[key] === value) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
export function ErrorCodeFromJSON(json) {
|
|
54
|
+
return ErrorCodeFromJSONTyped(json, false);
|
|
55
|
+
}
|
|
56
|
+
export function ErrorCodeFromJSONTyped(json, ignoreDiscriminator) {
|
|
57
|
+
return json;
|
|
58
|
+
}
|
|
59
|
+
export function ErrorCodeToJSON(value) {
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
export function ErrorCodeToJSONTyped(value, ignoreDiscriminator) {
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
* A parse ID to extract from, and the shape to extract into.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface ExtractRequest
|
|
16
|
+
*/
|
|
17
|
+
export interface ExtractRequest {
|
|
18
|
+
/**
|
|
19
|
+
* The ID of the parse to extract against. It is not parsed again.
|
|
20
|
+
*/
|
|
21
|
+
parseId: string;
|
|
22
|
+
/**
|
|
23
|
+
* A JSON Schema. Subject to the same engine constraints as `schema` on the parse call, so `required` must list every key in `properties`, `additionalProperties` must be false, and the serialized schema is limited to 1,048,576 bytes.
|
|
24
|
+
*/
|
|
25
|
+
schema: {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Optional free-text guidance that shapes how extracted fields are filled. Limited to 1,048,576 bytes when encoded as UTF-8.
|
|
30
|
+
*/
|
|
31
|
+
prompt?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Check if a given object implements the ExtractRequest interface.
|
|
35
|
+
*/
|
|
36
|
+
export declare function instanceOfExtractRequest(value: object): value is ExtractRequest;
|
|
37
|
+
export declare function ExtractRequestFromJSON(json: any): ExtractRequest;
|
|
38
|
+
export declare function ExtractRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExtractRequest;
|
|
39
|
+
export declare function ExtractRequestToJSON(json: any): ExtractRequest;
|
|
40
|
+
export declare function ExtractRequestToJSONTyped(value?: ExtractRequest | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,49 @@
|
|
|
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 ExtractRequest interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfExtractRequest(value) {
|
|
18
|
+
if ((!('parseId' in value) && !('parse_id' in value)) || (value['parseId'] === undefined && value['parse_id'] === undefined))
|
|
19
|
+
return false;
|
|
20
|
+
if (!('schema' in value) || value['schema'] === undefined)
|
|
21
|
+
return false;
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
export function ExtractRequestFromJSON(json) {
|
|
25
|
+
return ExtractRequestFromJSONTyped(json, false);
|
|
26
|
+
}
|
|
27
|
+
export function ExtractRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
28
|
+
if (json == null) {
|
|
29
|
+
return json;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
'parseId': json['parse_id'],
|
|
33
|
+
'schema': json['schema'],
|
|
34
|
+
'prompt': json['prompt'] == null ? undefined : json['prompt'],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function ExtractRequestToJSON(json) {
|
|
38
|
+
return ExtractRequestToJSONTyped(json, false);
|
|
39
|
+
}
|
|
40
|
+
export function ExtractRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
41
|
+
if (value == null) {
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
'parse_id': value['parseId'],
|
|
46
|
+
'schema': value['schema'],
|
|
47
|
+
'prompt': value['prompt'],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { FieldMetadata } from './FieldMetadata.js';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface ExtractionResult
|
|
17
|
+
*/
|
|
18
|
+
export interface ExtractionResult {
|
|
19
|
+
/**
|
|
20
|
+
* Extracted value conforming to the caller's schema.
|
|
21
|
+
*/
|
|
22
|
+
data: any | null;
|
|
23
|
+
/**
|
|
24
|
+
* Per-field evidence keyed by RFC 6901 JSON Pointer.
|
|
25
|
+
*/
|
|
26
|
+
fieldMetadata?: {
|
|
27
|
+
[key: string]: FieldMetadata;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the ExtractionResult interface.
|
|
32
|
+
*/
|
|
33
|
+
export declare function instanceOfExtractionResult(value: object): value is ExtractionResult;
|
|
34
|
+
export declare function ExtractionResultFromJSON(json: any): ExtractionResult;
|
|
35
|
+
export declare function ExtractionResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExtractionResult;
|
|
36
|
+
export declare function ExtractionResultToJSON(json: any): ExtractionResult;
|
|
37
|
+
export declare function ExtractionResultToJSONTyped(value?: ExtractionResult | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { mapValues } from '../runtime.js';
|
|
15
|
+
import { FieldMetadataFromJSON, FieldMetadataToJSON, } from './FieldMetadata.js';
|
|
16
|
+
/**
|
|
17
|
+
* Check if a given object implements the ExtractionResult interface.
|
|
18
|
+
*/
|
|
19
|
+
export function instanceOfExtractionResult(value) {
|
|
20
|
+
if (!('data' in value) || value['data'] === undefined)
|
|
21
|
+
return false;
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
export function ExtractionResultFromJSON(json) {
|
|
25
|
+
return ExtractionResultFromJSONTyped(json, false);
|
|
26
|
+
}
|
|
27
|
+
export function ExtractionResultFromJSONTyped(json, ignoreDiscriminator) {
|
|
28
|
+
if (json == null) {
|
|
29
|
+
return json;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
'data': json['data'],
|
|
33
|
+
'fieldMetadata': json['field_metadata'] == null ? undefined : (mapValues(json['field_metadata'], FieldMetadataFromJSON)),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export function ExtractionResultToJSON(json) {
|
|
37
|
+
return ExtractionResultToJSONTyped(json, false);
|
|
38
|
+
}
|
|
39
|
+
export function ExtractionResultToJSONTyped(value, ignoreDiscriminator = false) {
|
|
40
|
+
if (value == null) {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
'data': value['data'],
|
|
45
|
+
'field_metadata': value['fieldMetadata'] == null ? undefined : (mapValues(value['fieldMetadata'], FieldMetadataToJSON)),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -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 { Citation } from './Citation.js';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface FieldMetadata
|
|
17
|
+
*/
|
|
18
|
+
export interface FieldMetadata {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
citation?: Citation;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Check if a given object implements the FieldMetadata interface.
|
|
26
|
+
*/
|
|
27
|
+
export declare function instanceOfFieldMetadata(value: object): value is FieldMetadata;
|
|
28
|
+
export declare function FieldMetadataFromJSON(json: any): FieldMetadata;
|
|
29
|
+
export declare function FieldMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): FieldMetadata;
|
|
30
|
+
export declare function FieldMetadataToJSON(json: any): FieldMetadata;
|
|
31
|
+
export declare function FieldMetadataToJSONTyped(value?: FieldMetadata | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { CitationFromJSON, CitationToJSON, } from './Citation.js';
|
|
15
|
+
/**
|
|
16
|
+
* Check if a given object implements the FieldMetadata interface.
|
|
17
|
+
*/
|
|
18
|
+
export function instanceOfFieldMetadata(value) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
export function FieldMetadataFromJSON(json) {
|
|
22
|
+
return FieldMetadataFromJSONTyped(json, false);
|
|
23
|
+
}
|
|
24
|
+
export function FieldMetadataFromJSONTyped(json, ignoreDiscriminator) {
|
|
25
|
+
if (json == null) {
|
|
26
|
+
return json;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
'citation': json['citation'] == null ? undefined : CitationFromJSON(json['citation']),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function FieldMetadataToJSON(json) {
|
|
33
|
+
return FieldMetadataToJSONTyped(json, false);
|
|
34
|
+
}
|
|
35
|
+
export function FieldMetadataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
36
|
+
if (value == null) {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
'citation': CitationToJSON(value['citation']),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 { SourceFile } from './SourceFile.js';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface JobAccepted
|
|
17
|
+
*/
|
|
18
|
+
export interface JobAccepted {
|
|
19
|
+
/**
|
|
20
|
+
* Identifies one piece of work, whichever path submitted it. The same id the blocking call returns.
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
status: JobAcceptedStatusEnum;
|
|
27
|
+
/**
|
|
28
|
+
* Where to retrieve this job. Saves the caller building the URL.
|
|
29
|
+
*/
|
|
30
|
+
pollUrl?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The effective profile used for raw-document partitioning.
|
|
33
|
+
* @deprecated
|
|
34
|
+
*/
|
|
35
|
+
profile?: JobAcceptedProfileEnum | null;
|
|
36
|
+
/**
|
|
37
|
+
* The effective prompt used to shape how extracted fields were filled, echoed in this submission response. Later job retrieval cannot recover it from the current platform job metadata.
|
|
38
|
+
*/
|
|
39
|
+
prompt?: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* The associated original uploaded source file, when known.
|
|
42
|
+
*/
|
|
43
|
+
source: SourceFile | null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @export
|
|
47
|
+
*/
|
|
48
|
+
export declare const JobAcceptedStatusEnum: {
|
|
49
|
+
readonly Queued: "queued";
|
|
50
|
+
};
|
|
51
|
+
export type JobAcceptedStatusEnum = typeof JobAcceptedStatusEnum[keyof typeof JobAcceptedStatusEnum];
|
|
52
|
+
/**
|
|
53
|
+
* @export
|
|
54
|
+
*/
|
|
55
|
+
export declare const JobAcceptedProfileEnum: {
|
|
56
|
+
readonly Balanced: "balanced";
|
|
57
|
+
readonly Best: "best";
|
|
58
|
+
};
|
|
59
|
+
export type JobAcceptedProfileEnum = typeof JobAcceptedProfileEnum[keyof typeof JobAcceptedProfileEnum];
|
|
60
|
+
/**
|
|
61
|
+
* Check if a given object implements the JobAccepted interface.
|
|
62
|
+
*/
|
|
63
|
+
export declare function instanceOfJobAccepted(value: object): value is JobAccepted;
|
|
64
|
+
export declare function JobAcceptedFromJSON(json: any): JobAccepted;
|
|
65
|
+
export declare function JobAcceptedFromJSONTyped(json: any, ignoreDiscriminator: boolean): JobAccepted;
|
|
66
|
+
export declare function JobAcceptedToJSON(json: any): JobAccepted;
|
|
67
|
+
export declare function JobAcceptedToJSONTyped(value?: JobAccepted | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,73 @@
|
|
|
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 { SourceFileFromJSON, SourceFileToJSON, } from './SourceFile.js';
|
|
15
|
+
/**
|
|
16
|
+
* @export
|
|
17
|
+
*/
|
|
18
|
+
export const JobAcceptedStatusEnum = {
|
|
19
|
+
Queued: 'queued',
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* @export
|
|
23
|
+
*/
|
|
24
|
+
export const JobAcceptedProfileEnum = {
|
|
25
|
+
Balanced: 'balanced',
|
|
26
|
+
Best: 'best',
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Check if a given object implements the JobAccepted interface.
|
|
30
|
+
*/
|
|
31
|
+
export function instanceOfJobAccepted(value) {
|
|
32
|
+
if (!('id' in value) || value['id'] === undefined)
|
|
33
|
+
return false;
|
|
34
|
+
if (!('status' in value) || value['status'] === undefined)
|
|
35
|
+
return false;
|
|
36
|
+
if (value['status'] !== 'queued')
|
|
37
|
+
return false;
|
|
38
|
+
if (!('source' in value) || value['source'] === undefined)
|
|
39
|
+
return false;
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
export function JobAcceptedFromJSON(json) {
|
|
43
|
+
return JobAcceptedFromJSONTyped(json, false);
|
|
44
|
+
}
|
|
45
|
+
export function JobAcceptedFromJSONTyped(json, ignoreDiscriminator) {
|
|
46
|
+
if (json == null) {
|
|
47
|
+
return json;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
'id': json['id'],
|
|
51
|
+
'status': json['status'],
|
|
52
|
+
'pollUrl': json['poll_url'] == null ? undefined : json['poll_url'],
|
|
53
|
+
'profile': json['profile'] === undefined ? undefined : json['profile'] === null ? null : json['profile'],
|
|
54
|
+
'prompt': json['prompt'] === undefined ? undefined : json['prompt'] === null ? null : json['prompt'],
|
|
55
|
+
'source': SourceFileFromJSON(json['source']),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export function JobAcceptedToJSON(json) {
|
|
59
|
+
return JobAcceptedToJSONTyped(json, false);
|
|
60
|
+
}
|
|
61
|
+
export function JobAcceptedToJSONTyped(value, ignoreDiscriminator = false) {
|
|
62
|
+
if (value == null) {
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
'id': value['id'],
|
|
67
|
+
'status': value['status'],
|
|
68
|
+
'poll_url': value['pollUrl'],
|
|
69
|
+
'profile': value['profile'],
|
|
70
|
+
'prompt': value['prompt'],
|
|
71
|
+
'source': SourceFileToJSON(value['source']),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
* The operation that created the job.
|
|
14
|
+
* @export
|
|
15
|
+
*/
|
|
16
|
+
export declare const JobOperation: {
|
|
17
|
+
readonly Parse: "parse";
|
|
18
|
+
readonly Extract: "extract";
|
|
19
|
+
};
|
|
20
|
+
export type JobOperation = typeof JobOperation[keyof typeof JobOperation];
|
|
21
|
+
export declare function instanceOfJobOperation(value: any): boolean;
|
|
22
|
+
export declare function JobOperationFromJSON(json: any): JobOperation;
|
|
23
|
+
export declare function JobOperationFromJSONTyped(json: any, ignoreDiscriminator: boolean): JobOperation;
|
|
24
|
+
export declare function JobOperationToJSON(value?: JobOperation | null): any;
|
|
25
|
+
export declare function JobOperationToJSONTyped(value: any, ignoreDiscriminator: boolean): JobOperation;
|