@kortexya/reasoninglayer 7.0.0 → 7.1.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 +164 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +299 -22
- package/dist/index.d.ts +299 -22
- package/dist/index.js +164 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var __export = (target, all) => {
|
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// src/config.ts
|
|
8
|
-
var SDK_VERSION = "7.
|
|
8
|
+
var SDK_VERSION = "7.1.0";
|
|
9
9
|
function resolveConfig(config) {
|
|
10
10
|
if (!config.baseUrl) {
|
|
11
11
|
throw new Error("ClientConfig.baseUrl is required");
|
|
@@ -9488,6 +9488,21 @@ var Namespaces = class {
|
|
|
9488
9488
|
format: "json",
|
|
9489
9489
|
...params
|
|
9490
9490
|
});
|
|
9491
|
+
/**
|
|
9492
|
+
* No description
|
|
9493
|
+
*
|
|
9494
|
+
* @tags namespaces
|
|
9495
|
+
* @name GetNamespaceAnswerCacheSavings
|
|
9496
|
+
* @request GET:/api/v1/namespaces/{id}/answer-cache-savings
|
|
9497
|
+
* @secure
|
|
9498
|
+
*/
|
|
9499
|
+
getNamespaceAnswerCacheSavings = (id, params = {}) => this.http.request({
|
|
9500
|
+
path: `/api/v1/namespaces/${id}/answer-cache-savings`,
|
|
9501
|
+
method: "GET",
|
|
9502
|
+
secure: true,
|
|
9503
|
+
format: "json",
|
|
9504
|
+
...params
|
|
9505
|
+
});
|
|
9491
9506
|
/**
|
|
9492
9507
|
* No description
|
|
9493
9508
|
*
|
|
@@ -16819,7 +16834,7 @@ var Vocabulary = class {
|
|
|
16819
16834
|
*
|
|
16820
16835
|
* @tags vocabulary
|
|
16821
16836
|
* @name GetVocabularyCollection
|
|
16822
|
-
* @summary `GET /api/v1/vocabulary/collections/{collection_id}` — one collection with its labels, its member occurrences and its
|
|
16837
|
+
* @summary `GET /api/v1/vocabulary/collections/{collection_id}` — one collection with its labels, its member occurrences, its nested collections and its documentation notes.
|
|
16823
16838
|
* @request GET:/api/v1/vocabulary/collections/{collection_id}
|
|
16824
16839
|
* @secure
|
|
16825
16840
|
*/
|
|
@@ -16922,7 +16937,7 @@ var Vocabulary = class {
|
|
|
16922
16937
|
*
|
|
16923
16938
|
* @tags vocabulary
|
|
16924
16939
|
* @name ListSchemes
|
|
16925
|
-
* @summary `GET /api/v1/vocabulary/schemes` — the schemes of a view.
|
|
16940
|
+
* @summary `GET /api/v1/vocabulary/schemes` — the schemes of a view, each with its languages and its documentation notes.
|
|
16926
16941
|
* @request GET:/api/v1/vocabulary/schemes
|
|
16927
16942
|
* @secure
|
|
16928
16943
|
*/
|
|
@@ -20054,6 +20069,7 @@ var RESPONSE_COMPONENTS = {
|
|
|
20054
20069
|
object: {
|
|
20055
20070
|
collection: [1, "CollectionRecordDto"],
|
|
20056
20071
|
context: [2, "ContextRefDto"],
|
|
20072
|
+
documentation: [1, { array: "DocumentationRecordDto" }],
|
|
20057
20073
|
labels: [1, { array: "CollectionLabelViewDto" }],
|
|
20058
20074
|
members: [1, { array: "CollectionMemberViewDto" }],
|
|
20059
20075
|
nested_collections: [1, { array: 0 }],
|
|
@@ -20246,14 +20262,16 @@ var RESPONSE_COMPONENTS = {
|
|
|
20246
20262
|
term_versions: [1, { array: "TermVersionEntryDto" }]
|
|
20247
20263
|
}
|
|
20248
20264
|
},
|
|
20249
|
-
|
|
20265
|
+
ConceptMappingViewDto: {
|
|
20250
20266
|
object: {
|
|
20251
20267
|
change_reason: [1, 0],
|
|
20252
20268
|
mapping_kind: [1, 0],
|
|
20253
20269
|
record_id: [1, 0],
|
|
20254
20270
|
revision: [1, 0],
|
|
20255
20271
|
status: [1, 0],
|
|
20256
|
-
subject: [1, 0]
|
|
20272
|
+
subject: [1, 0],
|
|
20273
|
+
target_display_label: [2, "DisplayLabelDto"],
|
|
20274
|
+
target_external_concept: [2, "ExternalConceptRecordDto"]
|
|
20257
20275
|
}
|
|
20258
20276
|
},
|
|
20259
20277
|
ConceptMatchDto: {
|
|
@@ -20368,12 +20386,12 @@ var RESPONSE_COMPONENTS = {
|
|
|
20368
20386
|
evidence: [1, { array: "EvidenceViewDto" }],
|
|
20369
20387
|
identity_decisions: [1, { array: "IdentityDecisionRecordDto" }],
|
|
20370
20388
|
labels: [1, { array: "LabelUseViewDto" }],
|
|
20371
|
-
mappings: [1, { array: "
|
|
20389
|
+
mappings: [1, { array: "ConceptMappingViewDto" }],
|
|
20372
20390
|
memberships: [1, { array: "MembershipViewDto" }],
|
|
20373
20391
|
notations: [1, { array: "NotationRecordDto" }],
|
|
20374
20392
|
relations: [1, { array: "ConceptRelationRecordDto" }],
|
|
20375
20393
|
source_associations: [1, { array: "SourceAssociationRecordDto" }],
|
|
20376
|
-
xl_labels: [1, { array: "
|
|
20394
|
+
xl_labels: [1, { array: "XlLabelViewDto" }]
|
|
20377
20395
|
}
|
|
20378
20396
|
},
|
|
20379
20397
|
ConditionalIndependenceResponse: { object: { explanation: [1, 0], independent: [1, 0] } },
|
|
@@ -21916,6 +21934,17 @@ var RESPONSE_COMPONENTS = {
|
|
|
21916
21934
|
webhook_url: [1, 0]
|
|
21917
21935
|
}
|
|
21918
21936
|
},
|
|
21937
|
+
ExternalConceptRecordDto: {
|
|
21938
|
+
object: {
|
|
21939
|
+
authority: [1, 0],
|
|
21940
|
+
change_reason: [1, 0],
|
|
21941
|
+
dataset_version: [1, 0],
|
|
21942
|
+
iri: [1, 0],
|
|
21943
|
+
record_id: [1, 0],
|
|
21944
|
+
resolution: [1, 0],
|
|
21945
|
+
revision: [1, 0]
|
|
21946
|
+
}
|
|
21947
|
+
},
|
|
21919
21948
|
ExternalMatchDto: { object: { match_type: [1, 0], ontology_id: [1, 0], source: [1, 0] } },
|
|
21920
21949
|
ExternalMatchProposalDto: {
|
|
21921
21950
|
object: {
|
|
@@ -23078,7 +23107,16 @@ var RESPONSE_COMPONENTS = {
|
|
|
23078
23107
|
sorts_reused: [1, 0],
|
|
23079
23108
|
sota_extraction_gate: [0, "SotaExtractionGateStatsDto"],
|
|
23080
23109
|
term_ids: [1, { array: 0 }],
|
|
23081
|
-
token_usage: [0, "TokenUsageDto"]
|
|
23110
|
+
token_usage: [0, "TokenUsageDto"],
|
|
23111
|
+
work_cache: [0, "IngestionWorkCacheDto"]
|
|
23112
|
+
}
|
|
23113
|
+
},
|
|
23114
|
+
IngestionWorkCacheDto: {
|
|
23115
|
+
object: {
|
|
23116
|
+
model_calls: [1, 0],
|
|
23117
|
+
reused_model_calls: [1, 0],
|
|
23118
|
+
reused_recorded_token_usage: [1, "TokenUsageDto"],
|
|
23119
|
+
unkeyed_model_calls: [1, 0]
|
|
23082
23120
|
}
|
|
23083
23121
|
},
|
|
23084
23122
|
InheritedFeatureChangeDto: {
|
|
@@ -23270,6 +23308,15 @@ var RESPONSE_COMPONENTS = {
|
|
|
23270
23308
|
wake_trigger: [1, 0]
|
|
23271
23309
|
}
|
|
23272
23310
|
},
|
|
23311
|
+
LabelRelationViewDto: {
|
|
23312
|
+
object: {
|
|
23313
|
+
object: [1, 0],
|
|
23314
|
+
record_id: [1, 0],
|
|
23315
|
+
relation: [1, 0],
|
|
23316
|
+
subject: [1, 0],
|
|
23317
|
+
other_xl_label_id: [1, 0]
|
|
23318
|
+
}
|
|
23319
|
+
},
|
|
23273
23320
|
LabelSearchHitDto: {
|
|
23274
23321
|
object: {
|
|
23275
23322
|
concept_id: [1, 0],
|
|
@@ -24199,6 +24246,18 @@ var RESPONSE_COMPONENTS = {
|
|
|
24199
24246
|
NamespaceAnswerCachePolicyDto: {
|
|
24200
24247
|
object: { enabled: [1, 0], revision: [1, 0], ttl_seconds: [1, 0] }
|
|
24201
24248
|
},
|
|
24249
|
+
NamespaceAnswerCacheSavingsDto: {
|
|
24250
|
+
object: {
|
|
24251
|
+
bypassed: [1, 0],
|
|
24252
|
+
counted_since: [1, 0],
|
|
24253
|
+
disabled: [1, 0],
|
|
24254
|
+
fresh_model_calls: [1, 0],
|
|
24255
|
+
reused_model_calls: [1, 0],
|
|
24256
|
+
token_usage_measured: [1, 0],
|
|
24257
|
+
unavailable: [1, 0],
|
|
24258
|
+
unqualified: [1, 0]
|
|
24259
|
+
}
|
|
24260
|
+
},
|
|
24202
24261
|
NamespaceDto: {
|
|
24203
24262
|
object: { id: [1, 0], name: [1, 0], path: [1, 0], tags: [1, { array: 0 }], visibility: [1, 0] }
|
|
24204
24263
|
},
|
|
@@ -25983,6 +26042,7 @@ var RESPONSE_COMPONENTS = {
|
|
|
25983
26042
|
SchemeViewDto: {
|
|
25984
26043
|
object: {
|
|
25985
26044
|
display_name: [1, 0],
|
|
26045
|
+
documentation: [1, { array: "DocumentationRecordDto" }],
|
|
25986
26046
|
languages: [1, { array: "SchemeLanguageViewDto" }],
|
|
25987
26047
|
purpose: [1, 0],
|
|
25988
26048
|
revision: [1, 0],
|
|
@@ -27640,7 +27700,7 @@ var RESPONSE_COMPONENTS = {
|
|
|
27640
27700
|
}
|
|
27641
27701
|
},
|
|
27642
27702
|
WorldModelTransitionDto: { object: { probability: [1, 0] } },
|
|
27643
|
-
|
|
27703
|
+
XlLabelViewDto: {
|
|
27644
27704
|
object: {
|
|
27645
27705
|
change_reason: [1, 0],
|
|
27646
27706
|
concept: [1, 0],
|
|
@@ -27649,7 +27709,9 @@ var RESPONSE_COMPONENTS = {
|
|
|
27649
27709
|
resource_key: [1, 0],
|
|
27650
27710
|
revision: [1, 0],
|
|
27651
27711
|
role: [1, 0],
|
|
27652
|
-
scheme: [1, 0]
|
|
27712
|
+
scheme: [1, 0],
|
|
27713
|
+
incoming_relations: [1, { array: "LabelRelationViewDto" }],
|
|
27714
|
+
outgoing_relations: [1, { array: "LabelRelationViewDto" }]
|
|
27653
27715
|
}
|
|
27654
27716
|
},
|
|
27655
27717
|
YankResponse: { object: { plugin_id: [1, 0], yanked: [1, 0] } }
|
|
@@ -29550,6 +29612,11 @@ var RESPONSE_OPERATIONS = {
|
|
|
29550
29612
|
path: "/api/v1/namespaces/{id}/answer-cache-policy",
|
|
29551
29613
|
responses: { 200: "NamespaceAnswerCachePolicyDto" }
|
|
29552
29614
|
},
|
|
29615
|
+
getNamespaceAnswerCacheSavings: {
|
|
29616
|
+
method: "GET",
|
|
29617
|
+
path: "/api/v1/namespaces/{id}/answer-cache-savings",
|
|
29618
|
+
responses: { 200: "NamespaceAnswerCacheSavingsDto" }
|
|
29619
|
+
},
|
|
29553
29620
|
getNamespaceByPath: {
|
|
29554
29621
|
method: "GET",
|
|
29555
29622
|
path: "/api/v1/namespaces/path/{tenant_id}/{path}",
|
|
@@ -39121,6 +39188,18 @@ function NamespaceListResponseFromApiToFront(dto) {
|
|
|
39121
39188
|
function UpdateNamespaceAnswerCachePolicyRequestFromFrontToApi(model) {
|
|
39122
39189
|
return { enabled: model.enabled, ttl_seconds: model.ttlSeconds };
|
|
39123
39190
|
}
|
|
39191
|
+
function NamespaceAnswerCacheSavingsDtoFromApiToFront(dto) {
|
|
39192
|
+
return {
|
|
39193
|
+
countedSince: dto.counted_since,
|
|
39194
|
+
freshModelCalls: dto.fresh_model_calls,
|
|
39195
|
+
reusedModelCalls: dto.reused_model_calls,
|
|
39196
|
+
bypassed: dto.bypassed,
|
|
39197
|
+
disabled: dto.disabled,
|
|
39198
|
+
unavailable: dto.unavailable,
|
|
39199
|
+
unqualified: dto.unqualified,
|
|
39200
|
+
tokenUsageMeasured: dto.token_usage_measured
|
|
39201
|
+
};
|
|
39202
|
+
}
|
|
39124
39203
|
function NamespaceAnswerCachePolicyDtoFromApiToFront(dto) {
|
|
39125
39204
|
return {
|
|
39126
39205
|
enabled: dto.enabled,
|
|
@@ -39189,6 +39268,34 @@ var NamespacesClient = class {
|
|
|
39189
39268
|
);
|
|
39190
39269
|
return decodeResponse(response, NamespaceAnswerCachePolicyDtoFromApiToFront);
|
|
39191
39270
|
}
|
|
39271
|
+
/**
|
|
39272
|
+
* Read the answer-cache outcomes the engine counted for a namespace.
|
|
39273
|
+
*
|
|
39274
|
+
* @param namespaceId - Namespace UUID.
|
|
39275
|
+
* @param requestOptions - Per-call options (timeout, retries, signal, headers).
|
|
39276
|
+
* @returns The counters of this engine process since `countedSince`.
|
|
39277
|
+
* @throws {ForbiddenError} 403 without a native `manage_answer_cache` grant.
|
|
39278
|
+
* @throws {NotFoundError} 404 for a namespace not in this tenant.
|
|
39279
|
+
* @throws {ServiceUnavailableError} 503 when the namespace state or authority is unavailable.
|
|
39280
|
+
*
|
|
39281
|
+
* @remarks
|
|
39282
|
+
* `GET /api/v1/namespaces/{id}/answer-cache-savings`. The counters are
|
|
39283
|
+
* process-local and not durable; token savings are not measured
|
|
39284
|
+
* (`tokenUsageMeasured: false`). Response mapped from snake_case.
|
|
39285
|
+
*
|
|
39286
|
+
* @example
|
|
39287
|
+
* ```typescript
|
|
39288
|
+
* const savings = await client.namespaces.getAnswerCacheSavings(namespaceId);
|
|
39289
|
+
* console.log(savings.reusedModelCalls, 'of', savings.freshModelCalls + savings.reusedModelCalls);
|
|
39290
|
+
* ```
|
|
39291
|
+
*/
|
|
39292
|
+
async getAnswerCacheSavings(namespaceId, requestOptions) {
|
|
39293
|
+
const response = await this.api.getNamespaceAnswerCacheSavings(
|
|
39294
|
+
namespaceId,
|
|
39295
|
+
toRequestParams(requestOptions)
|
|
39296
|
+
);
|
|
39297
|
+
return decodeResponse(response, NamespaceAnswerCacheSavingsDtoFromApiToFront);
|
|
39298
|
+
}
|
|
39192
39299
|
/** Save settings in OSFKB; policy validation and cache admission stay in the engine. */
|
|
39193
39300
|
async updateAnswerCachePolicy(namespaceId, request, requestOptions) {
|
|
39194
39301
|
const response = await this.api.updateNamespaceAnswerCachePolicy(
|
|
@@ -42103,6 +42210,14 @@ function TokenUsageDtoFromApiToFront(dto) {
|
|
|
42103
42210
|
totalTokens: dto.total_tokens
|
|
42104
42211
|
};
|
|
42105
42212
|
}
|
|
42213
|
+
function IngestionWorkCacheDtoFromApiToFront(dto) {
|
|
42214
|
+
return {
|
|
42215
|
+
modelCalls: dto.model_calls,
|
|
42216
|
+
reusedModelCalls: dto.reused_model_calls,
|
|
42217
|
+
unkeyedModelCalls: dto.unkeyed_model_calls,
|
|
42218
|
+
reusedRecordedTokenUsage: TokenUsageDtoFromApiToFront(dto.reused_recorded_token_usage)
|
|
42219
|
+
};
|
|
42220
|
+
}
|
|
42106
42221
|
function AlignmentStatsDtoFromApiToFront(dto) {
|
|
42107
42222
|
return {
|
|
42108
42223
|
avgFuzzyRatio: dto.avg_fuzzy_ratio,
|
|
@@ -42200,6 +42315,7 @@ function IngestionStatsDtoFromApiToFront(dto) {
|
|
|
42200
42315
|
sotaExtractionGate: dto.sota_extraction_gate ? SotaExtractionGateStatsDtoFromApiToFront(dto.sota_extraction_gate) : void 0,
|
|
42201
42316
|
termIds: dto.term_ids,
|
|
42202
42317
|
tokenUsage: dto.token_usage ? TokenUsageDtoFromApiToFront(dto.token_usage) : void 0,
|
|
42318
|
+
workCache: dto.work_cache ? IngestionWorkCacheDtoFromApiToFront(dto.work_cache) : void 0,
|
|
42203
42319
|
fcaDiscovery: dto.fca_discovery ? FcaIngestionReportFromApiToFront(dto.fca_discovery) : void 0
|
|
42204
42320
|
};
|
|
42205
42321
|
}
|
|
@@ -71404,7 +71520,8 @@ function SchemeViewFromApiToFront(dto) {
|
|
|
71404
71520
|
revision: dto.revision,
|
|
71405
71521
|
displayName: dto.display_name,
|
|
71406
71522
|
purpose: dto.purpose,
|
|
71407
|
-
languages: dto.languages.map(SchemeLanguageViewFromApiToFront)
|
|
71523
|
+
languages: dto.languages.map(SchemeLanguageViewFromApiToFront),
|
|
71524
|
+
documentation: dto.documentation.map(VocabularyDocumentationRecordFromApiToFront)
|
|
71408
71525
|
};
|
|
71409
71526
|
if (present(dto.scope_note)) out.scopeNote = dto.scope_note;
|
|
71410
71527
|
if (present(dto.exclusions)) out.exclusions = dto.exclusions;
|
|
@@ -71489,6 +71606,38 @@ function DefinitionGuidanceFromApiToFront(dto) {
|
|
|
71489
71606
|
parentEdgeCreated: dto.parent_edge_created
|
|
71490
71607
|
};
|
|
71491
71608
|
}
|
|
71609
|
+
function LabelRelationViewFromApiToFront(dto) {
|
|
71610
|
+
const out = {
|
|
71611
|
+
...VocabularyLabelRelationRecordFromApiToFront(dto),
|
|
71612
|
+
otherXlLabelId: dto.other_xl_label_id
|
|
71613
|
+
};
|
|
71614
|
+
if (present(dto.other_resource_key)) out.otherResourceKey = dto.other_resource_key;
|
|
71615
|
+
if (present(dto.other_text)) out.otherText = dto.other_text;
|
|
71616
|
+
if (present(dto.other_language)) out.otherLanguage = dto.other_language;
|
|
71617
|
+
return out;
|
|
71618
|
+
}
|
|
71619
|
+
function XlLabelViewFromApiToFront(dto) {
|
|
71620
|
+
const out = {
|
|
71621
|
+
...VocabularyXlLabelRecordFromApiToFront(dto),
|
|
71622
|
+
outgoingRelations: dto.outgoing_relations.map(LabelRelationViewFromApiToFront),
|
|
71623
|
+
incomingRelations: dto.incoming_relations.map(LabelRelationViewFromApiToFront)
|
|
71624
|
+
};
|
|
71625
|
+
if (present(dto.text)) out.text = dto.text;
|
|
71626
|
+
if (present(dto.language)) out.language = dto.language;
|
|
71627
|
+
return out;
|
|
71628
|
+
}
|
|
71629
|
+
function ConceptMappingViewFromApiToFront(dto) {
|
|
71630
|
+
const out = VocabularyConceptMappingRecordFromApiToFront(dto);
|
|
71631
|
+
if (present(dto.target_external_concept)) {
|
|
71632
|
+
out.targetExternalConcept = VocabularyExternalConceptRecordFromApiToFront(
|
|
71633
|
+
dto.target_external_concept
|
|
71634
|
+
);
|
|
71635
|
+
}
|
|
71636
|
+
if (present(dto.target_display_label)) {
|
|
71637
|
+
out.targetDisplayLabel = VocabularyDisplayLabelFromApiToFront(dto.target_display_label);
|
|
71638
|
+
}
|
|
71639
|
+
return out;
|
|
71640
|
+
}
|
|
71492
71641
|
function ConceptViewFromApiToFront(dto) {
|
|
71493
71642
|
const out = {
|
|
71494
71643
|
concept: VocabularyConceptRecordFromApiToFront(dto.concept),
|
|
@@ -71503,10 +71652,10 @@ function ConceptViewFromApiToFront(dto) {
|
|
|
71503
71652
|
),
|
|
71504
71653
|
aboutness: dto.aboutness.map(VocabularyAboutnessRecordFromApiToFront),
|
|
71505
71654
|
relations: dto.relations.map(VocabularyConceptRelationRecordFromApiToFront),
|
|
71506
|
-
mappings: dto.mappings.map(
|
|
71655
|
+
mappings: dto.mappings.map(ConceptMappingViewFromApiToFront),
|
|
71507
71656
|
documentation: dto.documentation.map(VocabularyDocumentationRecordFromApiToFront),
|
|
71508
71657
|
notations: dto.notations.map(VocabularyNotationRecordFromApiToFront),
|
|
71509
|
-
xlLabels: dto.xl_labels.map(
|
|
71658
|
+
xlLabels: dto.xl_labels.map(XlLabelViewFromApiToFront),
|
|
71510
71659
|
collections: dto.collections,
|
|
71511
71660
|
sourceAssociations: dto.source_associations.map(
|
|
71512
71661
|
VocabularySourceAssociationRecordFromApiToFront
|
|
@@ -72113,7 +72262,8 @@ function VocabularyCollectionDetailFromApiToFront(dto) {
|
|
|
72113
72262
|
collection: VocabularyCollectionRecordFromApiToFront(dto.collection),
|
|
72114
72263
|
labels: dto.labels.map(CollectionLabelViewFromApiToFront),
|
|
72115
72264
|
members: dto.members.map(CollectionMemberViewFromApiToFront),
|
|
72116
|
-
nestedCollections: dto.nested_collections
|
|
72265
|
+
nestedCollections: dto.nested_collections,
|
|
72266
|
+
documentation: dto.documentation.map(VocabularyDocumentationRecordFromApiToFront)
|
|
72117
72267
|
};
|
|
72118
72268
|
if (present(dto.context)) out.context = VocabularyContextRefFromApiToFront(dto.context);
|
|
72119
72269
|
return out;
|