@kortexya/reasoninglayer 6.0.0 → 6.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 +46 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +101 -7
- package/dist/index.d.ts +101 -7
- package/dist/index.js +46 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -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 = "6.
|
|
10
|
+
var SDK_VERSION = "6.1.0";
|
|
11
11
|
function resolveConfig(config) {
|
|
12
12
|
if (!config.baseUrl) {
|
|
13
13
|
throw new Error("ClientConfig.baseUrl is required");
|
|
@@ -49704,6 +49704,7 @@ function StartExplorationRequestFromFrontToApi(model) {
|
|
|
49704
49704
|
min_intent_size: model.minIntentSize,
|
|
49705
49705
|
max_terms: model.maxTerms,
|
|
49706
49706
|
...model.sortNames !== void 0 ? { sort_names: model.sortNames } : {},
|
|
49707
|
+
...model.semantics !== void 0 ? { semantics: DiscoverySemanticsFromFrontToApi(model.semantics) } : {},
|
|
49707
49708
|
...explorationSearchBoundsFromFrontToApi(model)
|
|
49708
49709
|
};
|
|
49709
49710
|
}
|
|
@@ -49738,6 +49739,7 @@ function RefuteRequestFromFrontToApi(model) {
|
|
|
49738
49739
|
question_id: model.questionId,
|
|
49739
49740
|
label: model.label,
|
|
49740
49741
|
features: model.features,
|
|
49742
|
+
...model.values !== void 0 ? { values: featuresFromFrontToApi(model.values) } : {},
|
|
49741
49743
|
...explorationSearchBoundsFromFrontToApi(model)
|
|
49742
49744
|
};
|
|
49743
49745
|
}
|
|
@@ -49848,13 +49850,39 @@ var AnalysisClient = class {
|
|
|
49848
49850
|
/**
|
|
49849
49851
|
* Start an interactive attribute exploration session.
|
|
49850
49852
|
*
|
|
49851
|
-
* @param request - Exploration parameters
|
|
49852
|
-
*
|
|
49853
|
+
* @param request - Exploration parameters: the sort scope (`sortNames`),
|
|
49854
|
+
* the attribute `semantics`, and the search bounds.
|
|
49855
|
+
* @param requestOptions - Per-call request options.
|
|
49856
|
+
* @returns Session ID, the formal context's attribute and object counts,
|
|
49857
|
+
* the first question, and the search report.
|
|
49858
|
+
* @throws {ForbiddenError} 403 with code `exploration_actor_required` when
|
|
49859
|
+
* the request carries no gateway human actor (`authenticatedUser`).
|
|
49860
|
+
* @throws {BadRequestError} 400 for an unknown sort name, a refused
|
|
49861
|
+
* population bound (`exploration_population_limit`), native-predicate
|
|
49862
|
+
* semantics, or a scaled interpretation that is not complete.
|
|
49863
|
+
*
|
|
49864
|
+
* @remarks
|
|
49865
|
+
* The converted body is sent verbatim (no further key conversion): the
|
|
49866
|
+
* feature names that key a `scaled` semantics' `schemes` reach the engine
|
|
49867
|
+
* exactly as written. A missing `question` does not mean the basis is
|
|
49868
|
+
* complete: read `search.stop`.
|
|
49869
|
+
*
|
|
49870
|
+
* @example
|
|
49871
|
+
* ```typescript
|
|
49872
|
+
* const started = await client.analysis.startExploration({
|
|
49873
|
+
* sortNames: ['member'],
|
|
49874
|
+
* semantics: {
|
|
49875
|
+
* kind: 'scaled',
|
|
49876
|
+
* schemes: { age: { kind: 'interordinal', thresholds: [65] } },
|
|
49877
|
+
* },
|
|
49878
|
+
* });
|
|
49879
|
+
* console.log(started.attributeCount, started.objectCount, started.search.stop);
|
|
49880
|
+
* ```
|
|
49853
49881
|
*/
|
|
49854
49882
|
async startExploration(request, requestOptions) {
|
|
49855
49883
|
const response = await this.api.startExploration(
|
|
49856
49884
|
StartExplorationRequestFromFrontToApi(request),
|
|
49857
|
-
|
|
49885
|
+
mergeRequestParams({ headers: { [RAW_BODY_HEADER]: "1" } }, requestOptions)
|
|
49858
49886
|
);
|
|
49859
49887
|
return decodeResponse(response, StartExplorationResponseFromApiToFront);
|
|
49860
49888
|
}
|
|
@@ -49923,7 +49951,13 @@ var AnalysisClient = class {
|
|
|
49923
49951
|
* @throws {NotFoundError} 404 when the session does not exist.
|
|
49924
49952
|
*
|
|
49925
49953
|
* @remarks
|
|
49926
|
-
* Body `{ question_id, label, features }`; `questionId` is
|
|
49954
|
+
* Body `{ question_id, label, features, values? }`; `questionId` is
|
|
49955
|
+
* required. A presence session takes the counterexample's feature names in
|
|
49956
|
+
* `features`. A scaled session takes `features: []` and the counterexample
|
|
49957
|
+
* as a record of tagged values in `values`, which the session's scales
|
|
49958
|
+
* project into attributes; the engine refuses a label list or an
|
|
49959
|
+
* unreadable value there with `400`, and refuses `values` in a presence
|
|
49960
|
+
* session.
|
|
49927
49961
|
*
|
|
49928
49962
|
* The exploration continues after an answered question and poses one
|
|
49929
49963
|
* question for each pseudo-intent, so a session asks every implication of
|
|
@@ -49936,6 +49970,13 @@ var AnalysisClient = class {
|
|
|
49936
49970
|
* label: 'penguin',
|
|
49937
49971
|
* features: ['bird'],
|
|
49938
49972
|
* });
|
|
49973
|
+
* // In a scaled session:
|
|
49974
|
+
* await client.analysis.refuteImplication(sessionId, {
|
|
49975
|
+
* questionId: question.questionId,
|
|
49976
|
+
* label: 'young cardholder',
|
|
49977
|
+
* features: [],
|
|
49978
|
+
* values: toTaggedFeatures({ age: 30, senior_card: true }),
|
|
49979
|
+
* });
|
|
49939
49980
|
* ```
|
|
49940
49981
|
*/
|
|
49941
49982
|
async refuteImplication(sessionId, request, requestOptions) {
|