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