@anyformat/sdk 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -3
- package/dist/index.d.ts +63 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -637,6 +637,50 @@ type ConfidenceCheck = {
|
|
|
637
637
|
*/
|
|
638
638
|
type: 'confidence';
|
|
639
639
|
};
|
|
640
|
+
/**
|
|
641
|
+
* Consolidation
|
|
642
|
+
*
|
|
643
|
+
* Why a field of a long document has no value: its parts gave answers that could not be combined.
|
|
644
|
+
*/
|
|
645
|
+
type Consolidation = {
|
|
646
|
+
/**
|
|
647
|
+
* Candidates
|
|
648
|
+
*
|
|
649
|
+
* Each part's answer, to compare against the document before entering the value.
|
|
650
|
+
*/
|
|
651
|
+
candidates: Array<ConsolidationCandidate>;
|
|
652
|
+
/**
|
|
653
|
+
* Status
|
|
654
|
+
*
|
|
655
|
+
* Always `unresolved`: no value could be chosen.
|
|
656
|
+
*/
|
|
657
|
+
status: 'unresolved';
|
|
658
|
+
};
|
|
659
|
+
/**
|
|
660
|
+
* ConsolidationCandidate
|
|
661
|
+
*
|
|
662
|
+
* One part of a long document's answer for a field whose parts disagreed.
|
|
663
|
+
*/
|
|
664
|
+
type ConsolidationCandidate = {
|
|
665
|
+
/**
|
|
666
|
+
* Evidence
|
|
667
|
+
*
|
|
668
|
+
* Source-text snippets this part cited. Empty when it cited none.
|
|
669
|
+
*/
|
|
670
|
+
evidence?: Array<Evidence>;
|
|
671
|
+
/**
|
|
672
|
+
* Value
|
|
673
|
+
*
|
|
674
|
+
* The value this part of the document gave.
|
|
675
|
+
*/
|
|
676
|
+
value?: unknown | null;
|
|
677
|
+
/**
|
|
678
|
+
* Value Unit
|
|
679
|
+
*
|
|
680
|
+
* The unit of `value`, when it has one.
|
|
681
|
+
*/
|
|
682
|
+
value_unit?: string | null;
|
|
683
|
+
};
|
|
640
684
|
/**
|
|
641
685
|
* DatasetUploadFileV3
|
|
642
686
|
*
|
|
@@ -1170,12 +1214,22 @@ type ExtractedField$1 = {
|
|
|
1170
1214
|
* Model confidence in the extracted value, on a 0-100 scale. `null` when the backend did not produce a confidence (e.g. manual entry).
|
|
1171
1215
|
*/
|
|
1172
1216
|
confidence?: number | null;
|
|
1217
|
+
/**
|
|
1218
|
+
* Set when a long document's parts gave answers that could not be combined; `value` is then `null`. Omitted otherwise.
|
|
1219
|
+
*/
|
|
1220
|
+
consolidation?: Consolidation | null;
|
|
1173
1221
|
/**
|
|
1174
1222
|
* Evidence
|
|
1175
1223
|
*
|
|
1176
1224
|
* Source-text snippets the model used to derive this value.
|
|
1177
1225
|
*/
|
|
1178
1226
|
evidence?: Array<Evidence>;
|
|
1227
|
+
/**
|
|
1228
|
+
* Lookup Check
|
|
1229
|
+
*
|
|
1230
|
+
* Whether the lookup `confirmed` the document value or was in `conflict` with it (the document value is kept). Omitted when no lookup compared the two.
|
|
1231
|
+
*/
|
|
1232
|
+
lookup_check?: 'confirmed' | 'conflict' | null;
|
|
1179
1233
|
/**
|
|
1180
1234
|
* Value
|
|
1181
1235
|
*
|
|
@@ -1188,6 +1242,12 @@ type ExtractedField$1 = {
|
|
|
1188
1242
|
* A human-supplied override of the extracted `value`, if one was set during verification. `null` when no override exists.
|
|
1189
1243
|
*/
|
|
1190
1244
|
value_override?: unknown | null;
|
|
1245
|
+
/**
|
|
1246
|
+
* Value Source
|
|
1247
|
+
*
|
|
1248
|
+
* Where a smart-lookup field's value came from. Omitted for other fields.
|
|
1249
|
+
*/
|
|
1250
|
+
value_source?: 'document' | 'lookup' | null;
|
|
1191
1251
|
/**
|
|
1192
1252
|
* Verification Status
|
|
1193
1253
|
*
|
|
@@ -1229,7 +1289,7 @@ type Extraction = {
|
|
|
1229
1289
|
/**
|
|
1230
1290
|
* Validations
|
|
1231
1291
|
*
|
|
1232
|
-
*
|
|
1292
|
+
* Verdicts of the workflow's validate nodes.
|
|
1233
1293
|
*/
|
|
1234
1294
|
validations?: Array<Validation>;
|
|
1235
1295
|
};
|
|
@@ -2151,7 +2211,7 @@ type StringField = {
|
|
|
2151
2211
|
/**
|
|
2152
2212
|
* Validation
|
|
2153
2213
|
*
|
|
2154
|
-
* A configured rule verdict
|
|
2214
|
+
* A configured rule verdict.
|
|
2155
2215
|
*/
|
|
2156
2216
|
type Validation = {
|
|
2157
2217
|
/**
|
|
@@ -2177,7 +2237,7 @@ type Validation = {
|
|
|
2177
2237
|
/**
|
|
2178
2238
|
* Rule Id
|
|
2179
2239
|
*
|
|
2180
|
-
* The configured rule ID
|
|
2240
|
+
* The configured rule ID.
|
|
2181
2241
|
*/
|
|
2182
2242
|
rule_id: string;
|
|
2183
2243
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -637,6 +637,50 @@ type ConfidenceCheck = {
|
|
|
637
637
|
*/
|
|
638
638
|
type: 'confidence';
|
|
639
639
|
};
|
|
640
|
+
/**
|
|
641
|
+
* Consolidation
|
|
642
|
+
*
|
|
643
|
+
* Why a field of a long document has no value: its parts gave answers that could not be combined.
|
|
644
|
+
*/
|
|
645
|
+
type Consolidation = {
|
|
646
|
+
/**
|
|
647
|
+
* Candidates
|
|
648
|
+
*
|
|
649
|
+
* Each part's answer, to compare against the document before entering the value.
|
|
650
|
+
*/
|
|
651
|
+
candidates: Array<ConsolidationCandidate>;
|
|
652
|
+
/**
|
|
653
|
+
* Status
|
|
654
|
+
*
|
|
655
|
+
* Always `unresolved`: no value could be chosen.
|
|
656
|
+
*/
|
|
657
|
+
status: 'unresolved';
|
|
658
|
+
};
|
|
659
|
+
/**
|
|
660
|
+
* ConsolidationCandidate
|
|
661
|
+
*
|
|
662
|
+
* One part of a long document's answer for a field whose parts disagreed.
|
|
663
|
+
*/
|
|
664
|
+
type ConsolidationCandidate = {
|
|
665
|
+
/**
|
|
666
|
+
* Evidence
|
|
667
|
+
*
|
|
668
|
+
* Source-text snippets this part cited. Empty when it cited none.
|
|
669
|
+
*/
|
|
670
|
+
evidence?: Array<Evidence>;
|
|
671
|
+
/**
|
|
672
|
+
* Value
|
|
673
|
+
*
|
|
674
|
+
* The value this part of the document gave.
|
|
675
|
+
*/
|
|
676
|
+
value?: unknown | null;
|
|
677
|
+
/**
|
|
678
|
+
* Value Unit
|
|
679
|
+
*
|
|
680
|
+
* The unit of `value`, when it has one.
|
|
681
|
+
*/
|
|
682
|
+
value_unit?: string | null;
|
|
683
|
+
};
|
|
640
684
|
/**
|
|
641
685
|
* DatasetUploadFileV3
|
|
642
686
|
*
|
|
@@ -1170,12 +1214,22 @@ type ExtractedField$1 = {
|
|
|
1170
1214
|
* Model confidence in the extracted value, on a 0-100 scale. `null` when the backend did not produce a confidence (e.g. manual entry).
|
|
1171
1215
|
*/
|
|
1172
1216
|
confidence?: number | null;
|
|
1217
|
+
/**
|
|
1218
|
+
* Set when a long document's parts gave answers that could not be combined; `value` is then `null`. Omitted otherwise.
|
|
1219
|
+
*/
|
|
1220
|
+
consolidation?: Consolidation | null;
|
|
1173
1221
|
/**
|
|
1174
1222
|
* Evidence
|
|
1175
1223
|
*
|
|
1176
1224
|
* Source-text snippets the model used to derive this value.
|
|
1177
1225
|
*/
|
|
1178
1226
|
evidence?: Array<Evidence>;
|
|
1227
|
+
/**
|
|
1228
|
+
* Lookup Check
|
|
1229
|
+
*
|
|
1230
|
+
* Whether the lookup `confirmed` the document value or was in `conflict` with it (the document value is kept). Omitted when no lookup compared the two.
|
|
1231
|
+
*/
|
|
1232
|
+
lookup_check?: 'confirmed' | 'conflict' | null;
|
|
1179
1233
|
/**
|
|
1180
1234
|
* Value
|
|
1181
1235
|
*
|
|
@@ -1188,6 +1242,12 @@ type ExtractedField$1 = {
|
|
|
1188
1242
|
* A human-supplied override of the extracted `value`, if one was set during verification. `null` when no override exists.
|
|
1189
1243
|
*/
|
|
1190
1244
|
value_override?: unknown | null;
|
|
1245
|
+
/**
|
|
1246
|
+
* Value Source
|
|
1247
|
+
*
|
|
1248
|
+
* Where a smart-lookup field's value came from. Omitted for other fields.
|
|
1249
|
+
*/
|
|
1250
|
+
value_source?: 'document' | 'lookup' | null;
|
|
1191
1251
|
/**
|
|
1192
1252
|
* Verification Status
|
|
1193
1253
|
*
|
|
@@ -1229,7 +1289,7 @@ type Extraction = {
|
|
|
1229
1289
|
/**
|
|
1230
1290
|
* Validations
|
|
1231
1291
|
*
|
|
1232
|
-
*
|
|
1292
|
+
* Verdicts of the workflow's validate nodes.
|
|
1233
1293
|
*/
|
|
1234
1294
|
validations?: Array<Validation>;
|
|
1235
1295
|
};
|
|
@@ -2151,7 +2211,7 @@ type StringField = {
|
|
|
2151
2211
|
/**
|
|
2152
2212
|
* Validation
|
|
2153
2213
|
*
|
|
2154
|
-
* A configured rule verdict
|
|
2214
|
+
* A configured rule verdict.
|
|
2155
2215
|
*/
|
|
2156
2216
|
type Validation = {
|
|
2157
2217
|
/**
|
|
@@ -2177,7 +2237,7 @@ type Validation = {
|
|
|
2177
2237
|
/**
|
|
2178
2238
|
* Rule Id
|
|
2179
2239
|
*
|
|
2180
|
-
* The configured rule ID
|
|
2240
|
+
* The configured rule ID.
|
|
2181
2241
|
*/
|
|
2182
2242
|
rule_id: string;
|
|
2183
2243
|
/**
|