@kortexya/reasoninglayer 0.12.1 → 0.14.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 +71 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +503 -23
- package/dist/index.d.ts +503 -23
- package/dist/index.js +71 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// src/config.ts
|
|
4
|
-
var SDK_VERSION = "0.
|
|
4
|
+
var SDK_VERSION = "0.14.0";
|
|
5
5
|
function resolveConfig(config) {
|
|
6
6
|
if (!config.baseUrl) {
|
|
7
7
|
throw new Error("ClientConfig.baseUrl is required");
|
|
@@ -8523,11 +8523,12 @@ function toUntaggedValue(value) {
|
|
|
8523
8523
|
return { name: value.name, constraint };
|
|
8524
8524
|
}
|
|
8525
8525
|
if (isPsiTermInput(value)) {
|
|
8526
|
+
const sortKey = "sortId" in value && value.sortId ? { sortId: value.sortId } : { sortName: value.sortName };
|
|
8526
8527
|
if (!value.features) {
|
|
8527
|
-
return
|
|
8528
|
+
return sortKey;
|
|
8528
8529
|
}
|
|
8529
8530
|
return {
|
|
8530
|
-
|
|
8531
|
+
...sortKey,
|
|
8531
8532
|
features: toUntaggedFeatures(value.features)
|
|
8532
8533
|
};
|
|
8533
8534
|
}
|
|
@@ -8547,13 +8548,12 @@ function toTermInputDto(input) {
|
|
|
8547
8548
|
if (!isPsiTermInput(input)) {
|
|
8548
8549
|
return input;
|
|
8549
8550
|
}
|
|
8550
|
-
|
|
8551
|
-
|
|
8551
|
+
const features = input.features ? toUntaggedFeatures(input.features) : void 0;
|
|
8552
|
+
if ("sortId" in input && input.sortId) {
|
|
8553
|
+
return { sortId: input.sortId, features: features ?? {} };
|
|
8552
8554
|
}
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
features: toUntaggedFeatures(input.features)
|
|
8556
|
-
};
|
|
8555
|
+
const { sortName } = input;
|
|
8556
|
+
return features ? { sortName, features } : { sortName };
|
|
8557
8557
|
}
|
|
8558
8558
|
|
|
8559
8559
|
// src/normalizers/values.ts
|
|
@@ -13116,6 +13116,40 @@ function OcrConfigDtoFromFrontToApi(model) {
|
|
|
13116
13116
|
use_llm_enhancement: model.useLlmEnhancement
|
|
13117
13117
|
};
|
|
13118
13118
|
}
|
|
13119
|
+
function ExtractionStrategyFromFrontToApi(model) {
|
|
13120
|
+
switch (model.type) {
|
|
13121
|
+
case "llm":
|
|
13122
|
+
return { type: "llm" };
|
|
13123
|
+
case "local_ner":
|
|
13124
|
+
return { type: "local_ner" };
|
|
13125
|
+
case "hybrid":
|
|
13126
|
+
return {
|
|
13127
|
+
type: "hybrid",
|
|
13128
|
+
ner_confidence_threshold: model.nerConfidenceThreshold
|
|
13129
|
+
};
|
|
13130
|
+
case "schema_guided":
|
|
13131
|
+
return {
|
|
13132
|
+
type: "schema_guided",
|
|
13133
|
+
ner_confidence_threshold: model.nerConfidenceThreshold,
|
|
13134
|
+
relation_confidence_threshold: model.relationConfidenceThreshold,
|
|
13135
|
+
escalate_unknown_types: model.escalateUnknownTypes
|
|
13136
|
+
};
|
|
13137
|
+
case "adaptive":
|
|
13138
|
+
return {
|
|
13139
|
+
type: "adaptive",
|
|
13140
|
+
fallback: ExtractionStrategyFromFrontToApi(model.fallback)
|
|
13141
|
+
};
|
|
13142
|
+
}
|
|
13143
|
+
}
|
|
13144
|
+
function EvidenceDerivationConfigDtoFromFrontToApi(model) {
|
|
13145
|
+
return {
|
|
13146
|
+
context_dependent_relations: model.contextDependentRelations,
|
|
13147
|
+
default_quality_weight: model.defaultQualityWeight,
|
|
13148
|
+
evidence_sort_name: model.evidenceSortName,
|
|
13149
|
+
negative_relations: model.negativeRelations,
|
|
13150
|
+
positive_relations: model.positiveRelations
|
|
13151
|
+
};
|
|
13152
|
+
}
|
|
13119
13153
|
function IngestionConfigDtoFromFrontToApi(model) {
|
|
13120
13154
|
return {
|
|
13121
13155
|
auto_create_sorts: model.autoCreateSorts,
|
|
@@ -13125,16 +13159,20 @@ function IngestionConfigDtoFromFrontToApi(model) {
|
|
|
13125
13159
|
domain_instructions: model.domainInstructions,
|
|
13126
13160
|
enable_description_consolidation: model.enableDescriptionConsolidation,
|
|
13127
13161
|
enable_entity_filtering: model.enableEntityFiltering,
|
|
13162
|
+
enable_evidence_enrichment: model.enableEvidenceEnrichment,
|
|
13128
13163
|
enable_focused_extraction: model.enableFocusedExtraction,
|
|
13129
13164
|
enable_schema_discovery: model.enableSchemaDiscovery,
|
|
13130
13165
|
enable_zero_degree_filtering: model.enableZeroDegreeFiltering,
|
|
13166
|
+
evidence_derivation_config: model.evidenceDerivationConfig ? EvidenceDerivationConfigDtoFromFrontToApi(model.evidenceDerivationConfig) : model.evidenceDerivationConfig,
|
|
13131
13167
|
extract_relations: model.extractRelations,
|
|
13132
|
-
extraction_strategy: model.extractionStrategy,
|
|
13168
|
+
extraction_strategy: model.extractionStrategy ? ExtractionStrategyFromFrontToApi(model.extractionStrategy) : void 0,
|
|
13169
|
+
force_extraction_strategy: model.forceExtractionStrategy,
|
|
13133
13170
|
max_schema_tokens: model.maxSchemaTokens,
|
|
13134
13171
|
ner_confidence_threshold: model.nerConfidenceThreshold,
|
|
13135
13172
|
ner_entity_labels: model.nerEntityLabels,
|
|
13136
13173
|
ner_relation_confidence_threshold: model.nerRelationConfidenceThreshold,
|
|
13137
13174
|
ner_relation_labels: model.nerRelationLabels,
|
|
13175
|
+
reject_anonymized_references: model.rejectAnonymizedReferences,
|
|
13138
13176
|
skip_fingerprint: model.skipFingerprint,
|
|
13139
13177
|
skip_relation_completion: model.skipRelationCompletion
|
|
13140
13178
|
};
|
|
@@ -13358,6 +13396,14 @@ function IngestDocumentBatchResponseFromApiToFront(dto) {
|
|
|
13358
13396
|
totalTimeMs: dto.total_time_ms
|
|
13359
13397
|
};
|
|
13360
13398
|
}
|
|
13399
|
+
function IngestMarkdownResponseFromApiToFront(dto) {
|
|
13400
|
+
return {
|
|
13401
|
+
pendingReview: dto.pending_review?.map(PendingReviewDtoFromApiToFront),
|
|
13402
|
+
sessionId: dto.session_id ?? void 0,
|
|
13403
|
+
stats: IngestionStatsDtoFromApiToFront(dto.stats),
|
|
13404
|
+
success: dto.success
|
|
13405
|
+
};
|
|
13406
|
+
}
|
|
13361
13407
|
function IngestRdfResponseFromApiToFront(dto) {
|
|
13362
13408
|
return {
|
|
13363
13409
|
shapesParsed: dto.shapes_parsed,
|
|
@@ -13672,7 +13718,7 @@ var IngestionClient = class {
|
|
|
13672
13718
|
type: "application/json" /* Json */,
|
|
13673
13719
|
format: "json"
|
|
13674
13720
|
});
|
|
13675
|
-
return response.data;
|
|
13721
|
+
return IngestMarkdownResponseFromApiToFront(response.data);
|
|
13676
13722
|
}
|
|
13677
13723
|
/**
|
|
13678
13724
|
* Ingest a batch of markdown documents.
|
|
@@ -13691,7 +13737,7 @@ var IngestionClient = class {
|
|
|
13691
13737
|
type: "application/json" /* Json */,
|
|
13692
13738
|
format: "json"
|
|
13693
13739
|
});
|
|
13694
|
-
return response.data;
|
|
13740
|
+
return IngestMarkdownResponseFromApiToFront(response.data);
|
|
13695
13741
|
}
|
|
13696
13742
|
async ingestDocument(request, options) {
|
|
13697
13743
|
const sync = options?.sync ?? true;
|
|
@@ -22468,13 +22514,23 @@ var SortBuilder = class _SortBuilder {
|
|
|
22468
22514
|
};
|
|
22469
22515
|
|
|
22470
22516
|
// src/builders/psi.ts
|
|
22471
|
-
function psi(
|
|
22517
|
+
function psi(sortOrName, features) {
|
|
22518
|
+
if (typeof sortOrName === "string") {
|
|
22519
|
+
if (!features) {
|
|
22520
|
+
return { __psiTerm: true, sortName: sortOrName };
|
|
22521
|
+
}
|
|
22522
|
+
return {
|
|
22523
|
+
__psiTerm: true,
|
|
22524
|
+
sortName: sortOrName,
|
|
22525
|
+
features
|
|
22526
|
+
};
|
|
22527
|
+
}
|
|
22472
22528
|
if (!features) {
|
|
22473
|
-
return { __psiTerm: true,
|
|
22529
|
+
return { __psiTerm: true, sortId: sortOrName.sortId };
|
|
22474
22530
|
}
|
|
22475
22531
|
return {
|
|
22476
22532
|
__psiTerm: true,
|
|
22477
|
-
|
|
22533
|
+
sortId: sortOrName.sortId,
|
|
22478
22534
|
features
|
|
22479
22535
|
};
|
|
22480
22536
|
}
|