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