@memori.ai/memori-api-client 0.2.1 → 0.3.1
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/README.md +1 -1
- package/dist/apiFetcher.d.ts +1 -0
- package/dist/backend/consumptionLogs.d.ts +40 -0
- package/dist/backend/memori.d.ts +11 -0
- package/dist/backend/notifications.d.ts +20 -0
- package/dist/backend.d.ts +42 -0
- package/dist/engine/chatLogs.d.ts +31 -0
- package/dist/engine/customDictionary.d.ts +47 -0
- package/dist/engine/dialog.d.ts +3 -9
- package/dist/engine/importExport.d.ts +39 -14
- package/dist/engine/intents.d.ts +36 -11
- package/dist/engine/nlp.d.ts +42 -1
- package/dist/engine/stats.d.ts +68 -1
- package/dist/engine.d.ts +174 -38
- package/dist/index.d.ts +216 -38
- package/dist/memori-api-client.cjs.development.js +702 -67
- package/dist/memori-api-client.cjs.development.js.map +1 -1
- package/dist/memori-api-client.cjs.production.min.js +1 -1
- package/dist/memori-api-client.cjs.production.min.js.map +1 -1
- package/dist/memori-api-client.esm.js +702 -67
- package/dist/memori-api-client.esm.js.map +1 -1
- package/dist/types.d.ts +318 -1
- package/package.json +1 -1
- package/src/apiFetcher.ts +2 -1
- package/src/backend/consumptionLogs.ts +79 -0
- package/src/backend/memori.ts +20 -0
- package/src/backend/notifications.ts +24 -0
- package/src/backend.ts +6 -0
- package/src/engine/chatLogs.ts +63 -0
- package/src/engine/customDictionary.ts +85 -0
- package/src/engine/dialog.ts +3 -3
- package/src/engine/importExport.ts +56 -16
- package/src/engine/intents.ts +58 -21
- package/src/engine/nlp.ts +78 -1
- package/src/engine/stats.ts +117 -1
- package/src/engine.ts +6 -0
- package/src/types.ts +327 -1
package/src/engine/dialog.ts
CHANGED
|
@@ -130,7 +130,7 @@ export default (apiUrl: string) => ({
|
|
|
130
130
|
* Submits a Date Selected event to the session's Dialog State Machine.
|
|
131
131
|
* @param {string} sessionId The session ID
|
|
132
132
|
*/
|
|
133
|
-
postDateSelectedEvent: async (
|
|
133
|
+
postDateSelectedEvent: async (sessionId: string) =>
|
|
134
134
|
apiFetcher(`/DateSelectedEvent/${sessionId}`, {
|
|
135
135
|
method: 'GET',
|
|
136
136
|
apiUrl,
|
|
@@ -140,7 +140,7 @@ export default (apiUrl: string) => ({
|
|
|
140
140
|
* Submits a Place Selected event to the session's Dialog State Machine.
|
|
141
141
|
* @param {string} sessionId The session ID
|
|
142
142
|
*/
|
|
143
|
-
postPlaceSelectedEvent: async (
|
|
143
|
+
postPlaceSelectedEvent: async (sessionId: string) =>
|
|
144
144
|
apiFetcher(`/PlaceSelectedEvent/${sessionId}`, {
|
|
145
145
|
method: 'GET',
|
|
146
146
|
apiUrl,
|
|
@@ -150,7 +150,7 @@ export default (apiUrl: string) => ({
|
|
|
150
150
|
* Submits a Tag Selected event to the session's Dialog State Machine.
|
|
151
151
|
* @param {string} sessionId The session ID
|
|
152
152
|
*/
|
|
153
|
-
postTagSelectedEvent: async (
|
|
153
|
+
postTagSelectedEvent: async (sessionId: string) =>
|
|
154
154
|
apiFetcher(`/TagSelectedEvent/${sessionId}`, {
|
|
155
155
|
method: 'GET',
|
|
156
156
|
apiUrl,
|
|
@@ -1,24 +1,42 @@
|
|
|
1
1
|
import { ResponseSpec } from '../types';
|
|
2
2
|
import { apiFetcher } from '../apiFetcher';
|
|
3
3
|
|
|
4
|
-
export interface
|
|
5
|
-
|
|
4
|
+
export interface ImportCSVParams {
|
|
5
|
+
includedRows?: number[];
|
|
6
|
+
hasHeaders?: boolean;
|
|
7
|
+
headerNames?: string[];
|
|
8
|
+
forceImport?: boolean;
|
|
6
9
|
questionColumnName: string;
|
|
7
10
|
answerColumnName: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
csvSeparator
|
|
11
|
-
questionTitleVariantsSeparator
|
|
12
|
-
hasHeaders: boolean;
|
|
13
|
-
forceImport: boolean;
|
|
14
|
-
headerNames: string[];
|
|
11
|
+
contextVarsToMatchColumnName?: string;
|
|
12
|
+
contextVarsToSetColumnName?: string;
|
|
13
|
+
csvSeparator?: string;
|
|
14
|
+
questionTitleVariantsSeparator?: string;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export interface
|
|
17
|
+
export interface ExportCSVParams {
|
|
18
|
+
newLine: '\n' | '\r\n';
|
|
19
|
+
hasHeaders?: boolean;
|
|
20
|
+
questionColumnName: string;
|
|
21
|
+
answerColumnName: string;
|
|
22
|
+
contextVarsToMatchColumnName?: string;
|
|
23
|
+
contextVarsToSetColumnName?: string;
|
|
24
|
+
csvSeparator?: string;
|
|
25
|
+
questionTitleVariantsSeparator?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ImportReponse {
|
|
18
29
|
importID: string;
|
|
19
|
-
importedMemories
|
|
30
|
+
importedMemories?: number;
|
|
20
31
|
importWarnings?: {
|
|
21
|
-
warningType:
|
|
32
|
+
warningType: 'Existing Similar Memory' | 'Internal Error';
|
|
33
|
+
rowNumber?: number;
|
|
34
|
+
csvRow: string;
|
|
35
|
+
text?: string;
|
|
36
|
+
similarTexts?: {
|
|
37
|
+
text: string;
|
|
38
|
+
similarityLevel: 'HIGH' | 'MEDIUM' | 'LOW';
|
|
39
|
+
}[];
|
|
22
40
|
}[];
|
|
23
41
|
}
|
|
24
42
|
|
|
@@ -32,12 +50,34 @@ export default (apiUrl: string) => ({
|
|
|
32
50
|
/**
|
|
33
51
|
* Imports memories from a CSV file.
|
|
34
52
|
* @param {string} sessionId The session ID
|
|
35
|
-
* @param {
|
|
53
|
+
* @param {string[]} csvRows Rows of the CSV file.
|
|
54
|
+
* @param {ImportCSVParams} params The specifications and content of the CSV file
|
|
36
55
|
*/
|
|
37
|
-
|
|
56
|
+
importCSV: async (
|
|
57
|
+
sessionId: string,
|
|
58
|
+
csvRows: string[],
|
|
59
|
+
params: ImportCSVParams
|
|
60
|
+
) =>
|
|
38
61
|
apiFetcher(`/ImportExport/ImportCSV/${sessionId}`, {
|
|
39
62
|
method: 'POST',
|
|
40
63
|
apiUrl,
|
|
41
|
-
body:
|
|
42
|
-
|
|
64
|
+
body: {
|
|
65
|
+
csvRows,
|
|
66
|
+
...params,
|
|
67
|
+
},
|
|
68
|
+
}) as Promise<ResponseSpec & ImportReponse>,
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Exports memories to a CSV file.
|
|
72
|
+
* @param {string} sessionID The session ID
|
|
73
|
+
* @param {ExportCSVParams} params - The specifications of the CSV file
|
|
74
|
+
* @returns The CSV file content
|
|
75
|
+
*/
|
|
76
|
+
exportCSV: async (sessionID: string, params: ExportCSVParams) =>
|
|
77
|
+
apiFetcher(`/ImportExport/ExportCSV/${sessionID}`, {
|
|
78
|
+
method: 'POST',
|
|
79
|
+
apiUrl,
|
|
80
|
+
body: params,
|
|
81
|
+
text: true,
|
|
82
|
+
}) as Promise<string>,
|
|
43
83
|
});
|
package/src/engine/intents.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResponseSpec } from '../types';
|
|
1
|
+
import { ResponseSpec, Intent, IntentSlot } from '../types';
|
|
2
2
|
import { apiFetcher } from '../apiFetcher';
|
|
3
3
|
|
|
4
4
|
/*******************
|
|
@@ -16,7 +16,11 @@ export default (apiUrl: string) => ({
|
|
|
16
16
|
apiFetcher(`/Intents/${sessionId}`, {
|
|
17
17
|
method: 'GET',
|
|
18
18
|
apiUrl,
|
|
19
|
-
}) as Promise<
|
|
19
|
+
}) as Promise<
|
|
20
|
+
ResponseSpec & {
|
|
21
|
+
intents: (Intent & { intentID: string })[];
|
|
22
|
+
}
|
|
23
|
+
>,
|
|
20
24
|
|
|
21
25
|
/**
|
|
22
26
|
* Gets the details of an Intent object.
|
|
@@ -27,17 +31,25 @@ export default (apiUrl: string) => ({
|
|
|
27
31
|
apiFetcher(`/Intent/${sessionId}/${intentId}`, {
|
|
28
32
|
method: 'GET',
|
|
29
33
|
apiUrl,
|
|
30
|
-
}) as Promise<
|
|
34
|
+
}) as Promise<
|
|
35
|
+
ResponseSpec & {
|
|
36
|
+
intent: Intent & { intentID: string };
|
|
37
|
+
}
|
|
38
|
+
>,
|
|
31
39
|
|
|
32
40
|
/**
|
|
33
41
|
* Updates an existing Intent object.
|
|
34
42
|
* @param {string} sessionId The session ID
|
|
35
|
-
* @param {
|
|
43
|
+
* @param {Intent} intent The Intent object
|
|
36
44
|
*/
|
|
37
|
-
patchIntent: async (
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
patchIntent: async (
|
|
46
|
+
sessionId: string,
|
|
47
|
+
intent: Partial<Intent> & { intentID: string }
|
|
48
|
+
) =>
|
|
49
|
+
apiFetcher(`/Intent/${sessionId}/${intent.intentID}`, {
|
|
50
|
+
method: 'PATCH',
|
|
40
51
|
apiUrl,
|
|
52
|
+
body: intent,
|
|
41
53
|
}) as Promise<ResponseSpec>,
|
|
42
54
|
|
|
43
55
|
/**
|
|
@@ -47,19 +59,25 @@ export default (apiUrl: string) => ({
|
|
|
47
59
|
*/
|
|
48
60
|
deleteIntent: async (sessionId: string, intentId: string) =>
|
|
49
61
|
apiFetcher(`/Intent/${sessionId}/${intentId}`, {
|
|
50
|
-
method: '
|
|
62
|
+
method: 'DELETE',
|
|
51
63
|
apiUrl,
|
|
52
64
|
}) as Promise<ResponseSpec>,
|
|
53
65
|
|
|
54
66
|
/**
|
|
55
67
|
* Adds a new Intent object.
|
|
56
68
|
* @param {string} sessionId The session ID
|
|
69
|
+
* @param {Intent} intent The Intent object
|
|
57
70
|
*/
|
|
58
|
-
|
|
71
|
+
createIntent: async (sessionId: string, intent: Intent) =>
|
|
59
72
|
apiFetcher(`/Intent/${sessionId}`, {
|
|
60
|
-
method: '
|
|
73
|
+
method: 'POST',
|
|
61
74
|
apiUrl,
|
|
62
|
-
|
|
75
|
+
body: intent,
|
|
76
|
+
}) as Promise<
|
|
77
|
+
ResponseSpec & {
|
|
78
|
+
intentID: string;
|
|
79
|
+
}
|
|
80
|
+
>,
|
|
63
81
|
|
|
64
82
|
/**
|
|
65
83
|
* Lists all Intent Slot objects.
|
|
@@ -69,7 +87,13 @@ export default (apiUrl: string) => ({
|
|
|
69
87
|
apiFetcher(`/IntentSlots/${sessionId}`, {
|
|
70
88
|
method: 'GET',
|
|
71
89
|
apiUrl,
|
|
72
|
-
}) as Promise<
|
|
90
|
+
}) as Promise<
|
|
91
|
+
ResponseSpec & {
|
|
92
|
+
intentSlots: (IntentSlot & {
|
|
93
|
+
intentSlotID: string;
|
|
94
|
+
})[];
|
|
95
|
+
}
|
|
96
|
+
>,
|
|
73
97
|
|
|
74
98
|
/**
|
|
75
99
|
* Gets the details of an Intent Slot object.
|
|
@@ -80,17 +104,25 @@ export default (apiUrl: string) => ({
|
|
|
80
104
|
apiFetcher(`/IntentSlot/${sessionId}/${slotId}`, {
|
|
81
105
|
method: 'GET',
|
|
82
106
|
apiUrl,
|
|
83
|
-
}) as Promise<
|
|
107
|
+
}) as Promise<
|
|
108
|
+
ResponseSpec & {
|
|
109
|
+
intentSlot: IntentSlot & { intentSlotID: string };
|
|
110
|
+
}
|
|
111
|
+
>,
|
|
84
112
|
|
|
85
113
|
/**
|
|
86
114
|
* Updates an existing Intent Slot object.
|
|
87
115
|
* @param {string} sessionId The session ID
|
|
88
|
-
* @param {
|
|
116
|
+
* @param {IntentSlot} intentSlot The Intent Slot object
|
|
89
117
|
*/
|
|
90
|
-
patchIntentSlot: async (
|
|
91
|
-
|
|
92
|
-
|
|
118
|
+
patchIntentSlot: async (
|
|
119
|
+
sessionId: string,
|
|
120
|
+
intentSlot: Partial<IntentSlot> & { intentSlotID: string }
|
|
121
|
+
) =>
|
|
122
|
+
apiFetcher(`/IntentSlot/${sessionId}/${intentSlot.intentSlotID}`, {
|
|
123
|
+
method: 'PATCH',
|
|
93
124
|
apiUrl,
|
|
125
|
+
body: intentSlot,
|
|
94
126
|
}) as Promise<ResponseSpec>,
|
|
95
127
|
|
|
96
128
|
/**
|
|
@@ -100,7 +132,7 @@ export default (apiUrl: string) => ({
|
|
|
100
132
|
*/
|
|
101
133
|
deleteIntentSlot: async (sessionId: string, slotId: string) =>
|
|
102
134
|
apiFetcher(`/IntentSlot/${sessionId}/${slotId}`, {
|
|
103
|
-
method: '
|
|
135
|
+
method: 'DELETE',
|
|
104
136
|
apiUrl,
|
|
105
137
|
}) as Promise<ResponseSpec>,
|
|
106
138
|
|
|
@@ -108,9 +140,14 @@ export default (apiUrl: string) => ({
|
|
|
108
140
|
* Adds a new Intent Slot object.
|
|
109
141
|
* @param {string} sessionId The session ID
|
|
110
142
|
*/
|
|
111
|
-
|
|
143
|
+
createIntentSlot: async (sessionId: string, intentSlot: IntentSlot) =>
|
|
112
144
|
apiFetcher(`/IntentSlot/${sessionId}`, {
|
|
113
|
-
method: '
|
|
145
|
+
method: 'POST',
|
|
114
146
|
apiUrl,
|
|
115
|
-
|
|
147
|
+
body: intentSlot,
|
|
148
|
+
}) as Promise<
|
|
149
|
+
ResponseSpec & {
|
|
150
|
+
intentSlotID: string;
|
|
151
|
+
}
|
|
152
|
+
>,
|
|
116
153
|
});
|
package/src/engine/nlp.ts
CHANGED
|
@@ -17,7 +17,26 @@ export default (apiUrl: string) => ({
|
|
|
17
17
|
apiFetcher(`/WordVector/${sessionId}/${word}`, {
|
|
18
18
|
method: 'GET',
|
|
19
19
|
apiUrl,
|
|
20
|
-
}) as Promise<
|
|
20
|
+
}) as Promise<
|
|
21
|
+
ResponseSpec & {
|
|
22
|
+
vector: number[];
|
|
23
|
+
}
|
|
24
|
+
>,
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Searches for the 10 words most semantically similar words to the specified word.
|
|
28
|
+
* @param {string} sessionId The session ID
|
|
29
|
+
* @param {string} word Word to be looked up
|
|
30
|
+
*/
|
|
31
|
+
getSimilarWords: async (sessionId: string, word: string) =>
|
|
32
|
+
apiFetcher(`/SimilarWords/${sessionId}/${word}`, {
|
|
33
|
+
method: 'GET',
|
|
34
|
+
apiUrl,
|
|
35
|
+
}) as Promise<
|
|
36
|
+
ResponseSpec & {
|
|
37
|
+
similarWords: string[];
|
|
38
|
+
}
|
|
39
|
+
>,
|
|
21
40
|
|
|
22
41
|
/**
|
|
23
42
|
* Tries to guess the language of a sentence by analyzing key word occurrences.
|
|
@@ -36,4 +55,62 @@ export default (apiUrl: string) => ({
|
|
|
36
55
|
};
|
|
37
56
|
}
|
|
38
57
|
>,
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Computes the similarity between a reference and a comparison sentences.
|
|
61
|
+
* @param {string} sessionId The session ID
|
|
62
|
+
* @param {string} referenceText Text of the reference sentence.
|
|
63
|
+
* @param {'QUESTION' | 'ANSWER'} referenceTextType Type of reference text, i.e. question or answer. Only types supported are: 'QUESTION' and 'ANSWER'.
|
|
64
|
+
* @param {string} comparisonText Text of the comparison sentence.
|
|
65
|
+
* @param {'QUESTION' | 'ANSWER'} comparisonTextType Type of comparison text, i.e. question or answer. Only types supported are: 'QUESTION' and 'ANSWER'.
|
|
66
|
+
*/
|
|
67
|
+
computeSimilarity: async (
|
|
68
|
+
sessionId: string,
|
|
69
|
+
referenceText: string,
|
|
70
|
+
referenceTextType: 'QUESTION' | 'ANSWER',
|
|
71
|
+
comparisonText: string,
|
|
72
|
+
comparisonTextType: 'QUESTION' | 'ANSWER'
|
|
73
|
+
) =>
|
|
74
|
+
apiFetcher(`/ComputeSimilarity/${sessionId}`, {
|
|
75
|
+
method: 'POST',
|
|
76
|
+
apiUrl,
|
|
77
|
+
body: {
|
|
78
|
+
referenceText,
|
|
79
|
+
referenceTextType,
|
|
80
|
+
comparisonText,
|
|
81
|
+
comparisonTextType,
|
|
82
|
+
},
|
|
83
|
+
}) as Promise<
|
|
84
|
+
ResponseSpec & {
|
|
85
|
+
/**
|
|
86
|
+
* Similarity index, between 0.0 (totally different) and 1.0 (identical).
|
|
87
|
+
*/
|
|
88
|
+
similarity: number;
|
|
89
|
+
/**
|
|
90
|
+
* Similarity level, i.e. none, low, medium or high.
|
|
91
|
+
* Currently supported similarity levels are:
|
|
92
|
+
* NONE, LOW, MEDIUM, HIGH
|
|
93
|
+
*/
|
|
94
|
+
similarityLevel: 'NONE' | 'LOW' | 'MEDIUM' | 'HIGH';
|
|
95
|
+
}
|
|
96
|
+
>,
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Checks the words of a sentence for their definition in the word vector dictionary.
|
|
100
|
+
* @param {string} sessionId The session ID
|
|
101
|
+
* @param {string} text Text of the sentence.
|
|
102
|
+
*/
|
|
103
|
+
checkWords: async (sessionId: string, text: string) =>
|
|
104
|
+
apiFetcher(`/CheckWords/${sessionId}`, {
|
|
105
|
+
method: 'POST',
|
|
106
|
+
apiUrl,
|
|
107
|
+
body: { text },
|
|
108
|
+
}) as Promise<
|
|
109
|
+
ResponseSpec & {
|
|
110
|
+
/**
|
|
111
|
+
* List of words missing from the word vector dictionary.
|
|
112
|
+
*/
|
|
113
|
+
undefinedWords: string[];
|
|
114
|
+
}
|
|
115
|
+
>,
|
|
39
116
|
});
|
package/src/engine/stats.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResponseSpec, Stats, EventLog } from '../types';
|
|
1
|
+
import { ResponseSpec, Stats, Memory, EventLog } from '../types';
|
|
2
2
|
import { apiFetcher } from '../apiFetcher';
|
|
3
3
|
|
|
4
4
|
/*****************
|
|
@@ -22,6 +22,72 @@ export default (apiUrl: string) => ({
|
|
|
22
22
|
}
|
|
23
23
|
>,
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Computes content quality indexes for a Memori.
|
|
27
|
+
* @param {string} memoriID - The Memori object ID
|
|
28
|
+
*/
|
|
29
|
+
getContentQualityIndexes: async (memoriID: string) =>
|
|
30
|
+
apiFetcher(`/ContentQualityIndexes/${memoriID}`, {
|
|
31
|
+
method: 'GET',
|
|
32
|
+
apiUrl,
|
|
33
|
+
}) as Promise<
|
|
34
|
+
ResponseSpec & {
|
|
35
|
+
/**
|
|
36
|
+
* @type {number}
|
|
37
|
+
* An index of content quality of this Memori. The more content is added (and especially content with media, or stories with dates and places) the more the index grows.
|
|
38
|
+
*/
|
|
39
|
+
contentQualityIndex: number;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @type {number}
|
|
43
|
+
* An index of answer quality of this Memori. It is the ratio of the number of successful answer vs. the total of answers (successful, wrongful or missing).
|
|
44
|
+
*/
|
|
45
|
+
answerQualityIndex: number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @type {number}
|
|
49
|
+
* The current number of unanswered questions.
|
|
50
|
+
*/
|
|
51
|
+
unansweredQuestions: number;
|
|
52
|
+
}
|
|
53
|
+
>,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Computes text quality indexes for a Memori.
|
|
57
|
+
* @param {string} sessionId - The session ID
|
|
58
|
+
*/
|
|
59
|
+
getTextQualityIndexes: async (sessionId: string) =>
|
|
60
|
+
apiFetcher(`/TextQualityIndexes/${sessionId}`, {
|
|
61
|
+
method: 'GET',
|
|
62
|
+
apiUrl,
|
|
63
|
+
}) as Promise<
|
|
64
|
+
ResponseSpec & {
|
|
65
|
+
/**
|
|
66
|
+
* @type {number}
|
|
67
|
+
* An index of text quality of this Memori. It is the ratio of the defined words vs. the total of unique words used in question texts and story titles. A value of 1.0 means that no words are undefined, a value of 0.0 means that all words are undefined. Undefined words in a question text or story title have a profound negative impact on the ability to match them with user input.
|
|
68
|
+
*/
|
|
69
|
+
textQualityIndex: number;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @type {string[]}
|
|
73
|
+
* List of undefined words found in question texts and story titles.
|
|
74
|
+
*/
|
|
75
|
+
undefinedWords: string[];
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @type {number}
|
|
79
|
+
* An index of text quality of the content of this Memori. It is the ratio of correct question texts and stories titles vs. the total number of question texts and story titles. A value of 1.0 means that all question texts and story titles are correct, a value of 0.0 means that no question text or story title is correct. A question text or story title is defined incorrect (or "faulty") if it contains 25% or more of undefined words. Undefined words in a question text or story title have a profound negative impact on the ability to match them with user input.
|
|
80
|
+
*/
|
|
81
|
+
contentTextQualityIndex: number;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @type {Memory[]}
|
|
85
|
+
* List of faulty Memory objects (questions and stories). A question or story is defined as "faulty" if it contains at least one undefined word.
|
|
86
|
+
*/
|
|
87
|
+
faultyMemories?: Memory[];
|
|
88
|
+
}
|
|
89
|
+
>,
|
|
90
|
+
|
|
25
91
|
/**
|
|
26
92
|
* Get the Event Log objects for the Memori of the current session in a specific date interval
|
|
27
93
|
* @param {string} sessionId The session ID
|
|
@@ -41,4 +107,54 @@ export default (apiUrl: string) => ({
|
|
|
41
107
|
eventLogs: EventLog[];
|
|
42
108
|
}
|
|
43
109
|
>,
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Gets the Event Log objects for a specific Memory object in a specific date interval.
|
|
113
|
+
* @param {string} sessionId - The session ID
|
|
114
|
+
* @param {string} memoryId - The Memory object ID
|
|
115
|
+
* @param {string} strDateFrom - The optional begin of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
|
|
116
|
+
* @param {string} strDateTo - The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
|
|
117
|
+
*/
|
|
118
|
+
getMemoryEventLogs: async (
|
|
119
|
+
sessionId: string,
|
|
120
|
+
memoryId: string,
|
|
121
|
+
strDateFrom: string,
|
|
122
|
+
strDateTo: string
|
|
123
|
+
) =>
|
|
124
|
+
apiFetcher(
|
|
125
|
+
`/EventLogs/${sessionId}/${memoryId}/${strDateFrom}/${strDateTo}`,
|
|
126
|
+
{
|
|
127
|
+
method: 'GET',
|
|
128
|
+
apiUrl,
|
|
129
|
+
}
|
|
130
|
+
) as Promise<
|
|
131
|
+
ResponseSpec & {
|
|
132
|
+
eventLogs: EventLog[];
|
|
133
|
+
}
|
|
134
|
+
>,
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Gets the Event Log objects for a specific Intent object in a specific date interval.
|
|
138
|
+
* @param {string} sessionId - The session ID
|
|
139
|
+
* @param {string} intentId - The Intent object ID
|
|
140
|
+
* @param {string} strDateFrom - The optional begin of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
|
|
141
|
+
* @param {string} strDateTo - The optional end of the date interval, in UTC time, in the format yyyyMMddHHmmssfff
|
|
142
|
+
*/
|
|
143
|
+
getIntentEventLogs: async (
|
|
144
|
+
sessionId: string,
|
|
145
|
+
intentId: string,
|
|
146
|
+
strDateFrom: string,
|
|
147
|
+
strDateTo: string
|
|
148
|
+
) =>
|
|
149
|
+
apiFetcher(
|
|
150
|
+
`/EventLogs/${sessionId}/${intentId}/${strDateFrom}/${strDateTo}`,
|
|
151
|
+
{
|
|
152
|
+
method: 'GET',
|
|
153
|
+
apiUrl,
|
|
154
|
+
}
|
|
155
|
+
) as Promise<
|
|
156
|
+
ResponseSpec & {
|
|
157
|
+
eventLogs: EventLog[];
|
|
158
|
+
}
|
|
159
|
+
>,
|
|
44
160
|
});
|
package/src/engine.ts
CHANGED
|
@@ -13,6 +13,8 @@ import session from './engine/session';
|
|
|
13
13
|
import stats from './engine/stats';
|
|
14
14
|
import unansweredQuestions from './engine/unansweredQuestions';
|
|
15
15
|
import contextVars from './engine/contextVars';
|
|
16
|
+
import customDictionary from './engine/customDictionary';
|
|
17
|
+
import chatLogs from './engine/chatLogs';
|
|
16
18
|
|
|
17
19
|
export default (apiUrl: string) => ({
|
|
18
20
|
correlationPairs: correlationPairs(apiUrl),
|
|
@@ -45,4 +47,8 @@ export default (apiUrl: string) => ({
|
|
|
45
47
|
...unansweredQuestions(apiUrl),
|
|
46
48
|
contextVars: contextVars(apiUrl),
|
|
47
49
|
...contextVars(apiUrl),
|
|
50
|
+
customDictionary: customDictionary(apiUrl),
|
|
51
|
+
...customDictionary(apiUrl),
|
|
52
|
+
chatLogs: chatLogs(apiUrl),
|
|
53
|
+
...chatLogs(apiUrl),
|
|
48
54
|
});
|