@anyformat/sdk 1.3.0 → 1.5.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.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
- * Configured validation verdicts and automatic extraction review warnings. Unresolved chunk fields have a null value and an inconclusive warning with candidate values and evidence, even without a validate node.
1292
+ * Verdicts of the workflow's validate nodes.
1233
1293
  */
1234
1294
  validations?: Array<Validation>;
1235
1295
  };
@@ -1389,8 +1449,8 @@ type KnowledgeNode = {
1389
1449
  * Inline lookup-file content carried on the typed create call.
1390
1450
  *
1391
1451
  * The backend reads ``filename`` + ``content`` (base64-encoded bytes),
1392
- * uploads the file, and stores the resulting URI in
1393
- * ``ExtractNode.lookup_files``. Create-input only — not persisted on
1452
+ * uploads the file, and appends the new lookup file's id to
1453
+ * ``ExtractNode.lookup_file_ids``. Create-input only — not persisted on
1394
1454
  * the node after upload.
1395
1455
  */
1396
1456
  type LookupFileUpload = {
@@ -1604,17 +1664,17 @@ type PublicExtractNode = {
1604
1664
  */
1605
1665
  id: string;
1606
1666
  /**
1607
- * Lookup File Uploads
1667
+ * Lookup File Ids
1608
1668
  *
1609
- * Inline lookup-file content for the typed create call. Each entry is uploaded and the resulting URI is appended to ``lookup_files``; this field is create-input only.
1669
+ * Ids of the workflow's smart-lookup reference files this node looks values up in. Read it back from GET and echo it to keep the files; write lookup_file_uploads to add one.
1610
1670
  */
1611
- lookup_file_uploads?: Array<LookupFileUpload>;
1671
+ lookup_file_ids?: Array<string>;
1612
1672
  /**
1613
- * Lookup Files
1673
+ * Lookup File Uploads
1614
1674
  *
1615
- * Smart-lookup reference document URIs persisted on the extract node.
1675
+ * Inline lookup-file content for the typed create call. Each entry is uploaded and its new id is appended to ``lookup_file_ids``; this field is create-input only.
1616
1676
  */
1617
- lookup_files?: Array<string>;
1677
+ lookup_file_uploads?: Array<LookupFileUpload>;
1618
1678
  /**
1619
1679
  * Lookup Reasoning Effort
1620
1680
  *
@@ -2151,7 +2211,7 @@ type StringField = {
2151
2211
  /**
2152
2212
  * Validation
2153
2213
  *
2154
- * A configured rule verdict or an automatic extraction review warning.
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, or an `extract.consolidation:` ID for an automatic review warning.
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
- * Configured validation verdicts and automatic extraction review warnings. Unresolved chunk fields have a null value and an inconclusive warning with candidate values and evidence, even without a validate node.
1292
+ * Verdicts of the workflow's validate nodes.
1233
1293
  */
1234
1294
  validations?: Array<Validation>;
1235
1295
  };
@@ -1389,8 +1449,8 @@ type KnowledgeNode = {
1389
1449
  * Inline lookup-file content carried on the typed create call.
1390
1450
  *
1391
1451
  * The backend reads ``filename`` + ``content`` (base64-encoded bytes),
1392
- * uploads the file, and stores the resulting URI in
1393
- * ``ExtractNode.lookup_files``. Create-input only — not persisted on
1452
+ * uploads the file, and appends the new lookup file's id to
1453
+ * ``ExtractNode.lookup_file_ids``. Create-input only — not persisted on
1394
1454
  * the node after upload.
1395
1455
  */
1396
1456
  type LookupFileUpload = {
@@ -1604,17 +1664,17 @@ type PublicExtractNode = {
1604
1664
  */
1605
1665
  id: string;
1606
1666
  /**
1607
- * Lookup File Uploads
1667
+ * Lookup File Ids
1608
1668
  *
1609
- * Inline lookup-file content for the typed create call. Each entry is uploaded and the resulting URI is appended to ``lookup_files``; this field is create-input only.
1669
+ * Ids of the workflow's smart-lookup reference files this node looks values up in. Read it back from GET and echo it to keep the files; write lookup_file_uploads to add one.
1610
1670
  */
1611
- lookup_file_uploads?: Array<LookupFileUpload>;
1671
+ lookup_file_ids?: Array<string>;
1612
1672
  /**
1613
- * Lookup Files
1673
+ * Lookup File Uploads
1614
1674
  *
1615
- * Smart-lookup reference document URIs persisted on the extract node.
1675
+ * Inline lookup-file content for the typed create call. Each entry is uploaded and its new id is appended to ``lookup_file_ids``; this field is create-input only.
1616
1676
  */
1617
- lookup_files?: Array<string>;
1677
+ lookup_file_uploads?: Array<LookupFileUpload>;
1618
1678
  /**
1619
1679
  * Lookup Reasoning Effort
1620
1680
  *
@@ -2151,7 +2211,7 @@ type StringField = {
2151
2211
  /**
2152
2212
  * Validation
2153
2213
  *
2154
- * A configured rule verdict or an automatic extraction review warning.
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, or an `extract.consolidation:` ID for an automatic review warning.
2240
+ * The configured rule ID.
2181
2241
  */
2182
2242
  rule_id: string;
2183
2243
  /**
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@anyformat/sdk",
4
- version: "1.3.0",
4
+ version: "1.5.0",
5
5
  description: "TypeScript SDK for the AnyFormat API",
6
6
  license: "MIT",
7
7
  author: "Anyformat <info@anyformat.ai>",