@kortexya/reasoninglayer 0.13.0 → 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 +50 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +434 -11
- package/dist/index.d.ts +434 -11
- package/dist/index.js +50 -4
- 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");
|
|
@@ -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;
|