@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.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");
|
|
@@ -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;
|