@memori.ai/memori-api-client 0.8.3 → 0.10.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/CHANGELOG.md +21 -0
- package/dist/engine/memories.d.ts +1 -1
- package/dist/engine/nlp.d.ts +23 -0
- package/dist/memori-api-client.cjs.development.js +69 -0
- 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 +69 -0
- package/dist/memori-api-client.esm.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/package.json +1 -1
- package/src/engine/memories.ts +1 -1
- package/src/engine/nlp.ts +39 -0
- package/src/types.ts +7 -0
package/dist/types.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export declare type Memori = {
|
|
|
63
63
|
exposed?: boolean;
|
|
64
64
|
disableR2R3Loop?: boolean;
|
|
65
65
|
disableR4Loop?: boolean;
|
|
66
|
+
disableR5Loop?: boolean;
|
|
67
|
+
enableCompletions?: boolean;
|
|
66
68
|
chainingMemoriID?: string;
|
|
67
69
|
chainingBaseURL?: string;
|
|
68
70
|
chainingPassword?: string;
|
|
@@ -312,6 +314,7 @@ export declare type DialogState = {
|
|
|
312
314
|
acceptsDate?: boolean;
|
|
313
315
|
acceptsPlace?: boolean;
|
|
314
316
|
acceptsTag?: boolean;
|
|
317
|
+
acceptsFeedback?: boolean;
|
|
315
318
|
hints?: string[];
|
|
316
319
|
timeout?: number;
|
|
317
320
|
translatedHints?: TranslatedHint[];
|
|
@@ -539,6 +542,10 @@ export declare type ChatLogLine = {
|
|
|
539
542
|
* Media attached with the Dialog State Machine emission, if present. Empty if the line is inbound.
|
|
540
543
|
*/
|
|
541
544
|
media?: ChatMedium[];
|
|
545
|
+
/**
|
|
546
|
+
* ID of the Memory object referenced in this line.
|
|
547
|
+
*/
|
|
548
|
+
memoryID?: string;
|
|
542
549
|
/**
|
|
543
550
|
* Dialog State Machine context variables after the emission, if present. Empty if the line is inbound.
|
|
544
551
|
*/
|
package/package.json
CHANGED
package/src/engine/memories.ts
CHANGED
|
@@ -33,7 +33,7 @@ export default (apiUrl: string) => ({
|
|
|
33
33
|
sessionId: string,
|
|
34
34
|
from: number,
|
|
35
35
|
howMany: number,
|
|
36
|
-
type?: 'ALL' | 'CONTENTS' | 'DEFAULTS'
|
|
36
|
+
type?: 'ALL' | 'CONTENTS' | 'DEFAULTS' | 'DRAFTS'
|
|
37
37
|
) =>
|
|
38
38
|
apiFetcher(
|
|
39
39
|
`/Memories/${sessionId}/${from}/${howMany}${type ? `/${type}` : ''}`,
|
package/src/engine/nlp.ts
CHANGED
|
@@ -113,4 +113,43 @@ export default (apiUrl: string) => ({
|
|
|
113
113
|
undefinedWords: string[];
|
|
114
114
|
}
|
|
115
115
|
>,
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Tries to suggest the answer for a question, using as much content as possible from the session's associated Memori object.
|
|
119
|
+
* @param {string} sessionId The session ID
|
|
120
|
+
* @param {string} text Text of the sentence.
|
|
121
|
+
*/
|
|
122
|
+
suggestAnswer: async (sessionId: string, text: string) =>
|
|
123
|
+
apiFetcher(`/SuggestAnswer/${sessionId}`, {
|
|
124
|
+
method: 'POST',
|
|
125
|
+
apiUrl,
|
|
126
|
+
body: { text },
|
|
127
|
+
}) as Promise<
|
|
128
|
+
ResponseSpec & {
|
|
129
|
+
/**
|
|
130
|
+
* Suggested answer. May be null if no answer could be suggested.
|
|
131
|
+
*/
|
|
132
|
+
answer: string;
|
|
133
|
+
}
|
|
134
|
+
>,
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Tries to suggest questions for an answer.
|
|
138
|
+
* Differently from ```SuggestAnswer```, no content from the session's associated Memori object is used.
|
|
139
|
+
* @param {string} sessionId The session ID
|
|
140
|
+
* @param {string} text Text of the sentence.
|
|
141
|
+
*/
|
|
142
|
+
suggestQuestions: async (sessionId: string, text: string) =>
|
|
143
|
+
apiFetcher(`/SuggestQuestions/${sessionId}`, {
|
|
144
|
+
method: 'POST',
|
|
145
|
+
apiUrl,
|
|
146
|
+
body: { text },
|
|
147
|
+
}) as Promise<
|
|
148
|
+
ResponseSpec & {
|
|
149
|
+
/**
|
|
150
|
+
* Suggested questions. May be null or empty if no questions could be suggested.
|
|
151
|
+
*/
|
|
152
|
+
questions: string[];
|
|
153
|
+
}
|
|
154
|
+
>,
|
|
116
155
|
});
|
package/src/types.ts
CHANGED
|
@@ -62,6 +62,8 @@ export declare type Memori = {
|
|
|
62
62
|
exposed?: boolean;
|
|
63
63
|
disableR2R3Loop?: boolean;
|
|
64
64
|
disableR4Loop?: boolean;
|
|
65
|
+
disableR5Loop?: boolean;
|
|
66
|
+
enableCompletions?: boolean;
|
|
65
67
|
chainingMemoriID?: string;
|
|
66
68
|
chainingBaseURL?: string;
|
|
67
69
|
chainingPassword?: string;
|
|
@@ -341,6 +343,7 @@ export declare type DialogState = {
|
|
|
341
343
|
acceptsDate?: boolean;
|
|
342
344
|
acceptsPlace?: boolean;
|
|
343
345
|
acceptsTag?: boolean;
|
|
346
|
+
acceptsFeedback?: boolean;
|
|
344
347
|
hints?: string[];
|
|
345
348
|
timeout?: number;
|
|
346
349
|
translatedHints?: TranslatedHint[];
|
|
@@ -572,6 +575,10 @@ export type ChatLogLine = {
|
|
|
572
575
|
* Media attached with the Dialog State Machine emission, if present. Empty if the line is inbound.
|
|
573
576
|
*/
|
|
574
577
|
media?: ChatMedium[];
|
|
578
|
+
/**
|
|
579
|
+
* ID of the Memory object referenced in this line.
|
|
580
|
+
*/
|
|
581
|
+
memoryID?: string;
|
|
575
582
|
/**
|
|
576
583
|
* Dialog State Machine context variables after the emission, if present. Empty if the line is inbound.
|
|
577
584
|
*/
|