@memori.ai/memori-api-client 2.6.1 → 2.7.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 +14 -0
- package/dist/backend/importExport.test.js +1 -1
- package/dist/backend/importExport.test.js.map +1 -1
- package/dist/engine/knownFacts.d.ts +16 -0
- package/dist/engine/knownFacts.js +22 -0
- package/dist/engine/knownFacts.js.map +1 -0
- package/dist/engine/knownFacts.test.d.ts +1 -0
- package/dist/engine/knownFacts.test.js +14 -0
- package/dist/engine/knownFacts.test.js.map +1 -0
- package/dist/engine/search.test.js +1 -1
- package/dist/engine/search.test.js.map +1 -1
- package/dist/engine.d.ts +26 -0
- package/dist/engine.js +3 -0
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +26 -0
- package/dist/types.d.ts +11 -0
- package/esm/backend/importExport.test.js +1 -1
- package/esm/backend/importExport.test.js.map +1 -1
- package/esm/engine/knownFacts.d.ts +16 -0
- package/esm/engine/knownFacts.js +20 -0
- package/esm/engine/knownFacts.js.map +1 -0
- package/esm/engine/knownFacts.test.d.ts +1 -0
- package/esm/engine/knownFacts.test.js +11 -0
- package/esm/engine/knownFacts.test.js.map +1 -0
- package/esm/engine/search.test.js +1 -1
- package/esm/engine/search.test.js.map +1 -1
- package/esm/engine.d.ts +26 -0
- package/esm/engine.js +3 -0
- package/esm/engine.js.map +1 -1
- package/esm/index.d.ts +26 -0
- package/esm/types.d.ts +11 -0
- package/package.json +1 -1
- package/src/backend/importExport.test.ts +1 -1
- package/src/engine/knownFacts.test.ts +20 -0
- package/src/engine/knownFacts.ts +84 -0
- package/src/engine/search.test.ts +1 -2
- package/src/engine.ts +3 -0
- package/src/types.ts +34 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [2.7.0](https://github.com/memori-ai/memori-api-client/compare/v2.6.2...v2.7.0) (2023-12-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add known facts api and typings ([3c16827](https://github.com/memori-ai/memori-api-client/commit/3c16827dd2d9dfc114edfe094f984e4492d1cdaf))
|
|
9
|
+
|
|
10
|
+
## [2.6.2](https://github.com/memori-ai/memori-api-client/compare/v2.6.1...v2.6.2) (2023-12-11)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Changes
|
|
14
|
+
|
|
15
|
+
* add chatlogs attributes for board of experts ([3d746a7](https://github.com/memori-ai/memori-api-client/commit/3d746a7ec97cfe05bc584b2f8b1fc5b6ca450d80))
|
|
16
|
+
|
|
3
17
|
## [2.6.1](https://github.com/memori-ai/memori-api-client/compare/v2.6.0...v2.6.1) (2023-12-08)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const index_1 = tslib_1.__importDefault(require("../index"));
|
|
5
|
-
const client = (0, index_1.default)('https://backend
|
|
5
|
+
const client = (0, index_1.default)('https://backend.memori.ai');
|
|
6
6
|
describe('backend/importexport api', () => {
|
|
7
7
|
it('works on importexport apis', async () => {
|
|
8
8
|
expect(await client.backend.importExport.importStatus('768b9654-e781-4c3c-81fa-ae1529d1bfbe', 'be2e4a44-890b-483b-a26a-f6e122f36e2b')).not.toBeNull();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importExport.test.js","sourceRoot":"","sources":["../../src/backend/importExport.test.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;AAE9B,MAAM,MAAM,GAAG,IAAA,eAAM,EAAC,
|
|
1
|
+
{"version":3,"file":"importExport.test.js","sourceRoot":"","sources":["../../src/backend/importExport.test.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;AAE9B,MAAM,MAAM,GAAG,IAAA,eAAM,EAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,CAC5C,sCAAsC,EACtC,sCAAsC,CACvC,CACF,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QACjE,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,CAC/B,sCAAsC,EACtC,sCAAsC,CACvC,CACF,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ResponseSpec, KnownFact } from '../types';
|
|
2
|
+
declare const _default: (apiUrl: string) => {
|
|
3
|
+
getKnownFacts: (sessionId: string) => Promise<ResponseSpec & {
|
|
4
|
+
count: number;
|
|
5
|
+
knownFacts: KnownFact[];
|
|
6
|
+
}>;
|
|
7
|
+
getKnownFactsPaginated: (sessionId: string, from: number, howMany: number) => Promise<ResponseSpec & {
|
|
8
|
+
count: number;
|
|
9
|
+
knownFacts: KnownFact[];
|
|
10
|
+
}>;
|
|
11
|
+
getKnownFact: (sessionId: string, knownFactID: string) => Promise<ResponseSpec & {
|
|
12
|
+
knownFact: KnownFact;
|
|
13
|
+
}>;
|
|
14
|
+
deleteKnownFact: (sessionId: string, knownFactID: string) => Promise<ResponseSpec>;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const apiFetcher_1 = require("../apiFetcher");
|
|
4
|
+
exports.default = (apiUrl) => ({
|
|
5
|
+
getKnownFacts: async (sessionId) => (0, apiFetcher_1.apiFetcher)(`/KnownFacts/${sessionId}`, {
|
|
6
|
+
method: 'GET',
|
|
7
|
+
apiUrl,
|
|
8
|
+
}),
|
|
9
|
+
getKnownFactsPaginated: async (sessionId, from, howMany) => (0, apiFetcher_1.apiFetcher)(`/KnownFacts/${sessionId}/${from}/${howMany}`, {
|
|
10
|
+
method: 'GET',
|
|
11
|
+
apiUrl,
|
|
12
|
+
}),
|
|
13
|
+
getKnownFact: async (sessionId, knownFactID) => (0, apiFetcher_1.apiFetcher)(`/KnownFact/${sessionId}/${knownFactID}`, {
|
|
14
|
+
method: 'GET',
|
|
15
|
+
apiUrl,
|
|
16
|
+
}),
|
|
17
|
+
deleteKnownFact: async (sessionId, knownFactID) => (0, apiFetcher_1.apiFetcher)(`/KnownFact/${sessionId}/${knownFactID}`, {
|
|
18
|
+
method: 'DELETE',
|
|
19
|
+
apiUrl,
|
|
20
|
+
}),
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=knownFacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knownFacts.js","sourceRoot":"","sources":["../../src/engine/knownFacts.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAQ3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAKlC,aAAa,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CACzC,IAAA,uBAAU,EAAC,eAAe,SAAS,EAAE,EAAE;QACrC,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAWA;IAQH,sBAAsB,EAAE,KAAK,EAC3B,SAAiB,EACjB,IAAY,EACZ,OAAe,EACf,EAAE,CACF,IAAA,uBAAU,EAAC,eAAe,SAAS,IAAI,IAAI,IAAI,OAAO,EAAE,EAAE;QACxD,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAWA;IAOH,YAAY,EAAE,KAAK,EAAE,SAAiB,EAAE,WAAmB,EAAE,EAAE,CAC7D,IAAA,uBAAU,EAAC,cAAc,SAAS,IAAI,WAAW,EAAE,EAAE;QACnD,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAIA;IAOH,eAAe,EAAE,KAAK,EAAE,SAAiB,EAAE,WAAmB,EAAE,EAAE,CAChE,IAAA,uBAAU,EAAC,cAAc,SAAS,IAAI,WAAW,EAAE,EAAE;QACnD,MAAM,EAAE,QAAQ;QAChB,MAAM;KACP,CAA0B;CAC9B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const index_1 = tslib_1.__importDefault(require("../index"));
|
|
5
|
+
const client = (0, index_1.default)('https://backend-staging.memori.ai');
|
|
6
|
+
describe('engine/knownFacts api', () => {
|
|
7
|
+
it('works on knownFacts apis', async () => {
|
|
8
|
+
expect(await client.knownFacts.getKnownFacts('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
|
|
9
|
+
});
|
|
10
|
+
it('works on knownFacts apis with shorthand version', async () => {
|
|
11
|
+
expect(await client.getKnownFacts('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=knownFacts.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knownFacts.test.js","sourceRoot":"","sources":["../../src/engine/knownFacts.test.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;AAG9B,MAAM,MAAM,GAAG,IAAA,eAAM,EAAC,mCAAmC,CAAC,CAAC;AAE3D,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACxC,MAAM,CACJ,MAAM,MAAM,CAAC,UAAU,CAAC,aAAa,CACnC,sCAAsC,CACvC,CACF,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,KAAK,IAAI,EAAE;QAC/D,MAAM,CACJ,MAAM,MAAM,CAAC,aAAa,CAAC,sCAAsC,CAAC,CACnE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const index_1 = tslib_1.__importDefault(require("../index"));
|
|
5
|
-
const client = (0, index_1.default)('https://backend
|
|
5
|
+
const client = (0, index_1.default)('https://backend.memori.ai');
|
|
6
6
|
describe('engine/search api', () => {
|
|
7
7
|
it('works on search apis', async () => {
|
|
8
8
|
expect(await client.search.searchMemory('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.test.js","sourceRoot":"","sources":["../../src/engine/search.test.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;
|
|
1
|
+
{"version":3,"file":"search.test.js","sourceRoot":"","sources":["../../src/engine/search.test.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;AAE9B,MAAM,MAAM,GAAG,IAAA,eAAM,EAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,CACJ,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,sCAAsC,CAAC,CACzE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,CACJ,MAAM,MAAM,CAAC,YAAY,CAAC,sCAAsC,CAAC,CAClE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
declare const _default: (apiUrl: string) => {
|
|
2
|
+
getKnownFacts: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
3
|
+
count: number;
|
|
4
|
+
knownFacts: import("./types").KnownFact[];
|
|
5
|
+
}>;
|
|
6
|
+
getKnownFactsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
|
|
7
|
+
count: number;
|
|
8
|
+
knownFacts: import("./types").KnownFact[];
|
|
9
|
+
}>;
|
|
10
|
+
getKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec & {
|
|
11
|
+
knownFact: import("./types").KnownFact;
|
|
12
|
+
}>;
|
|
13
|
+
deleteKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec>;
|
|
14
|
+
knownFacts: {
|
|
15
|
+
getKnownFacts: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
16
|
+
count: number;
|
|
17
|
+
knownFacts: import("./types").KnownFact[];
|
|
18
|
+
}>;
|
|
19
|
+
getKnownFactsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
|
|
20
|
+
count: number;
|
|
21
|
+
knownFacts: import("./types").KnownFact[];
|
|
22
|
+
}>;
|
|
23
|
+
getKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec & {
|
|
24
|
+
knownFact: import("./types").KnownFact;
|
|
25
|
+
}>;
|
|
26
|
+
deleteKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec>;
|
|
27
|
+
};
|
|
2
28
|
getExpertReferences: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
3
29
|
count: number;
|
|
4
30
|
experts: import("./types").ExpertReference[];
|
package/dist/engine.js
CHANGED
|
@@ -18,6 +18,7 @@ const contextVars_1 = tslib_1.__importDefault(require("./engine/contextVars"));
|
|
|
18
18
|
const customDictionary_1 = tslib_1.__importDefault(require("./engine/customDictionary"));
|
|
19
19
|
const chatLogs_1 = tslib_1.__importDefault(require("./engine/chatLogs"));
|
|
20
20
|
const expertReferences_1 = tslib_1.__importDefault(require("./engine/expertReferences"));
|
|
21
|
+
const knownFacts_1 = tslib_1.__importDefault(require("./engine/knownFacts"));
|
|
21
22
|
exports.default = (apiUrl) => ({
|
|
22
23
|
correlationPairs: (0, correlationPairs_1.default)(apiUrl),
|
|
23
24
|
...(0, correlationPairs_1.default)(apiUrl),
|
|
@@ -53,5 +54,7 @@ exports.default = (apiUrl) => ({
|
|
|
53
54
|
...(0, chatLogs_1.default)(apiUrl),
|
|
54
55
|
expertReferences: (0, expertReferences_1.default)(apiUrl),
|
|
55
56
|
...(0, expertReferences_1.default)(apiUrl),
|
|
57
|
+
knownFacts: (0, knownFacts_1.default)(apiUrl),
|
|
58
|
+
...(0, knownFacts_1.default)(apiUrl),
|
|
56
59
|
});
|
|
57
60
|
//# sourceMappingURL=engine.js.map
|
package/dist/engine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":";;;AAAA,yFAAyD;AACzD,qEAAqC;AACrC,uEAAuC;AACvC,yFAAyD;AACzD,mEAAmC;AACnC,yEAAyC;AACzC,+DAA+B;AAC/B,qEAAqC;AACrC,2FAA2D;AAC3D,qEAAqC;AACrC,uEAAuC;AACvC,mEAAmC;AACnC,+FAA+D;AAC/D,+EAA+C;AAC/C,yFAAyD;AACzD,yEAAyC;AACzC,yFAAyD;
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":";;;AAAA,yFAAyD;AACzD,qEAAqC;AACrC,uEAAuC;AACvC,yFAAyD;AACzD,mEAAmC;AACnC,yEAAyC;AACzC,+DAA+B;AA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,EAAC,MAAM,CAAC;IAClB,KAAK,EAAE,IAAA,eAAK,EAAC,MAAM,CAAC;IACpB,GAAG,IAAA,eAAK,EAAC,MAAM,CAAC;IAChB,mBAAmB,EAAE,IAAA,6BAAmB,EAAC,MAAM,CAAC;IAChD,GAAG,IAAA,6BAAmB,EAAC,MAAM,CAAC;IAC9B,WAAW,EAAE,IAAA,qBAAW,EAAC,MAAM,CAAC;IAChC,GAAG,IAAA,qBAAW,EAAC,MAAM,CAAC;IACtB,gBAAgB,EAAE,IAAA,0BAAgB,EAAC,MAAM,CAAC;IAC1C,GAAG,IAAA,0BAAgB,EAAC,MAAM,CAAC;IAC3B,QAAQ,EAAE,IAAA,kBAAQ,EAAC,MAAM,CAAC;IAC1B,GAAG,IAAA,kBAAQ,EAAC,MAAM,CAAC;IACnB,gBAAgB,EAAE,IAAA,0BAAgB,EAAC,MAAM,CAAC;IAC1C,GAAG,IAAA,0BAAgB,EAAC,MAAM,CAAC;IAC3B,UAAU,EAAE,IAAA,oBAAU,EAAC,MAAM,CAAC;IAC9B,GAAG,IAAA,oBAAU,EAAC,MAAM,CAAC;CACtB,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,32 @@ declare const api: (hostname?: string) => {
|
|
|
9
9
|
asset: {
|
|
10
10
|
getResourceUrl: ({ type, resourceURI, sessionID, baseURL, }: import("./helpers/asset").ResourceURLParams) => string;
|
|
11
11
|
};
|
|
12
|
+
getKnownFacts: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
13
|
+
count: number;
|
|
14
|
+
knownFacts: import("./types").KnownFact[];
|
|
15
|
+
}>;
|
|
16
|
+
getKnownFactsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
|
|
17
|
+
count: number;
|
|
18
|
+
knownFacts: import("./types").KnownFact[];
|
|
19
|
+
}>;
|
|
20
|
+
getKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec & {
|
|
21
|
+
knownFact: import("./types").KnownFact;
|
|
22
|
+
}>;
|
|
23
|
+
deleteKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec>;
|
|
24
|
+
knownFacts: {
|
|
25
|
+
getKnownFacts: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
26
|
+
count: number;
|
|
27
|
+
knownFacts: import("./types").KnownFact[];
|
|
28
|
+
}>;
|
|
29
|
+
getKnownFactsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
|
|
30
|
+
count: number;
|
|
31
|
+
knownFacts: import("./types").KnownFact[];
|
|
32
|
+
}>;
|
|
33
|
+
getKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec & {
|
|
34
|
+
knownFact: import("./types").KnownFact;
|
|
35
|
+
}>;
|
|
36
|
+
deleteKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec>;
|
|
37
|
+
};
|
|
12
38
|
getExpertReferences: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
13
39
|
count: number;
|
|
14
40
|
experts: import("./types").ExpertReference[];
|
package/dist/types.d.ts
CHANGED
|
@@ -549,6 +549,7 @@ export type ChatLogLine = {
|
|
|
549
549
|
timestamp: string;
|
|
550
550
|
inbound: boolean;
|
|
551
551
|
text: string;
|
|
552
|
+
emitter?: string;
|
|
552
553
|
media?: ChatMedium[];
|
|
553
554
|
memoryID?: string;
|
|
554
555
|
contextVars?: {
|
|
@@ -563,6 +564,7 @@ export type ChatLog = {
|
|
|
563
564
|
memoriID: string;
|
|
564
565
|
sessionID: string;
|
|
565
566
|
receiverTag?: string;
|
|
567
|
+
boardOfExperts?: boolean;
|
|
566
568
|
lines: ChatLogLine[];
|
|
567
569
|
};
|
|
568
570
|
export type CorrelationPair = {
|
|
@@ -695,3 +697,12 @@ export interface ExpertReference {
|
|
|
695
697
|
lastChangeTimestamp?: string;
|
|
696
698
|
lastChangeSessionID?: string;
|
|
697
699
|
}
|
|
700
|
+
export interface KnownFact {
|
|
701
|
+
knownFactID: string;
|
|
702
|
+
knownFactType: 'ShortTerm' | 'LongTerm';
|
|
703
|
+
text: string;
|
|
704
|
+
creationTimestamp?: string;
|
|
705
|
+
creationSessionID?: string;
|
|
706
|
+
lastChangeTimestamp?: string;
|
|
707
|
+
lastChangeSessionID?: string;
|
|
708
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import memori from '../index';
|
|
2
|
-
const client = memori('https://backend
|
|
2
|
+
const client = memori('https://backend.memori.ai');
|
|
3
3
|
describe('backend/importexport api', () => {
|
|
4
4
|
it('works on importexport apis', async () => {
|
|
5
5
|
expect(await client.backend.importExport.importStatus('768b9654-e781-4c3c-81fa-ae1529d1bfbe', 'be2e4a44-890b-483b-a26a-f6e122f36e2b')).not.toBeNull();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importExport.test.js","sourceRoot":"","sources":["../../src/backend/importExport.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"importExport.test.js","sourceRoot":"","sources":["../../src/backend/importExport.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,CAC5C,sCAAsC,EACtC,sCAAsC,CACvC,CACF,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QACjE,MAAM,CACJ,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,CAC/B,sCAAsC,EACtC,sCAAsC,CACvC,CACF,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ResponseSpec, KnownFact } from '../types';
|
|
2
|
+
declare const _default: (apiUrl: string) => {
|
|
3
|
+
getKnownFacts: (sessionId: string) => Promise<ResponseSpec & {
|
|
4
|
+
count: number;
|
|
5
|
+
knownFacts: KnownFact[];
|
|
6
|
+
}>;
|
|
7
|
+
getKnownFactsPaginated: (sessionId: string, from: number, howMany: number) => Promise<ResponseSpec & {
|
|
8
|
+
count: number;
|
|
9
|
+
knownFacts: KnownFact[];
|
|
10
|
+
}>;
|
|
11
|
+
getKnownFact: (sessionId: string, knownFactID: string) => Promise<ResponseSpec & {
|
|
12
|
+
knownFact: KnownFact;
|
|
13
|
+
}>;
|
|
14
|
+
deleteKnownFact: (sessionId: string, knownFactID: string) => Promise<ResponseSpec>;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { apiFetcher } from '../apiFetcher';
|
|
2
|
+
export default (apiUrl) => ({
|
|
3
|
+
getKnownFacts: async (sessionId) => apiFetcher(`/KnownFacts/${sessionId}`, {
|
|
4
|
+
method: 'GET',
|
|
5
|
+
apiUrl,
|
|
6
|
+
}),
|
|
7
|
+
getKnownFactsPaginated: async (sessionId, from, howMany) => apiFetcher(`/KnownFacts/${sessionId}/${from}/${howMany}`, {
|
|
8
|
+
method: 'GET',
|
|
9
|
+
apiUrl,
|
|
10
|
+
}),
|
|
11
|
+
getKnownFact: async (sessionId, knownFactID) => apiFetcher(`/KnownFact/${sessionId}/${knownFactID}`, {
|
|
12
|
+
method: 'GET',
|
|
13
|
+
apiUrl,
|
|
14
|
+
}),
|
|
15
|
+
deleteKnownFact: async (sessionId, knownFactID) => apiFetcher(`/KnownFact/${sessionId}/${knownFactID}`, {
|
|
16
|
+
method: 'DELETE',
|
|
17
|
+
apiUrl,
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=knownFacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knownFacts.js","sourceRoot":"","sources":["../../src/engine/knownFacts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAKlC,aAAa,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CACzC,UAAU,CAAC,eAAe,SAAS,EAAE,EAAE;QACrC,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAWA;IAQH,sBAAsB,EAAE,KAAK,EAC3B,SAAiB,EACjB,IAAY,EACZ,OAAe,EACf,EAAE,CACF,UAAU,CAAC,eAAe,SAAS,IAAI,IAAI,IAAI,OAAO,EAAE,EAAE;QACxD,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAWA;IAOH,YAAY,EAAE,KAAK,EAAE,SAAiB,EAAE,WAAmB,EAAE,EAAE,CAC7D,UAAU,CAAC,cAAc,SAAS,IAAI,WAAW,EAAE,EAAE;QACnD,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAIA;IAOH,eAAe,EAAE,KAAK,EAAE,SAAiB,EAAE,WAAmB,EAAE,EAAE,CAChE,UAAU,CAAC,cAAc,SAAS,IAAI,WAAW,EAAE,EAAE;QACnD,MAAM,EAAE,QAAQ;QAChB,MAAM;KACP,CAA0B;CAC9B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import memori from '../index';
|
|
2
|
+
const client = memori('https://backend-staging.memori.ai');
|
|
3
|
+
describe('engine/knownFacts api', () => {
|
|
4
|
+
it('works on knownFacts apis', async () => {
|
|
5
|
+
expect(await client.knownFacts.getKnownFacts('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
|
|
6
|
+
});
|
|
7
|
+
it('works on knownFacts apis with shorthand version', async () => {
|
|
8
|
+
expect(await client.getKnownFacts('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=knownFacts.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knownFacts.test.js","sourceRoot":"","sources":["../../src/engine/knownFacts.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAG9B,MAAM,MAAM,GAAG,MAAM,CAAC,mCAAmC,CAAC,CAAC;AAE3D,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACxC,MAAM,CACJ,MAAM,MAAM,CAAC,UAAU,CAAC,aAAa,CACnC,sCAAsC,CACvC,CACF,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,KAAK,IAAI,EAAE;QAC/D,MAAM,CACJ,MAAM,MAAM,CAAC,aAAa,CAAC,sCAAsC,CAAC,CACnE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import memori from '../index';
|
|
2
|
-
const client = memori('https://backend
|
|
2
|
+
const client = memori('https://backend.memori.ai');
|
|
3
3
|
describe('engine/search api', () => {
|
|
4
4
|
it('works on search apis', async () => {
|
|
5
5
|
expect(await client.search.searchMemory('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.test.js","sourceRoot":"","sources":["../../src/engine/search.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"search.test.js","sourceRoot":"","sources":["../../src/engine/search.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,CACJ,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,sCAAsC,CAAC,CACzE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,CACJ,MAAM,MAAM,CAAC,YAAY,CAAC,sCAAsC,CAAC,CAClE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/esm/engine.d.ts
CHANGED
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
declare const _default: (apiUrl: string) => {
|
|
2
|
+
getKnownFacts: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
3
|
+
count: number;
|
|
4
|
+
knownFacts: import("./types").KnownFact[];
|
|
5
|
+
}>;
|
|
6
|
+
getKnownFactsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
|
|
7
|
+
count: number;
|
|
8
|
+
knownFacts: import("./types").KnownFact[];
|
|
9
|
+
}>;
|
|
10
|
+
getKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec & {
|
|
11
|
+
knownFact: import("./types").KnownFact;
|
|
12
|
+
}>;
|
|
13
|
+
deleteKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec>;
|
|
14
|
+
knownFacts: {
|
|
15
|
+
getKnownFacts: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
16
|
+
count: number;
|
|
17
|
+
knownFacts: import("./types").KnownFact[];
|
|
18
|
+
}>;
|
|
19
|
+
getKnownFactsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
|
|
20
|
+
count: number;
|
|
21
|
+
knownFacts: import("./types").KnownFact[];
|
|
22
|
+
}>;
|
|
23
|
+
getKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec & {
|
|
24
|
+
knownFact: import("./types").KnownFact;
|
|
25
|
+
}>;
|
|
26
|
+
deleteKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec>;
|
|
27
|
+
};
|
|
2
28
|
getExpertReferences: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
3
29
|
count: number;
|
|
4
30
|
experts: import("./types").ExpertReference[];
|
package/esm/engine.js
CHANGED
|
@@ -15,6 +15,7 @@ import contextVars from './engine/contextVars';
|
|
|
15
15
|
import customDictionary from './engine/customDictionary';
|
|
16
16
|
import chatLogs from './engine/chatLogs';
|
|
17
17
|
import expertReferences from './engine/expertReferences';
|
|
18
|
+
import knownFacts from './engine/knownFacts';
|
|
18
19
|
export default (apiUrl) => ({
|
|
19
20
|
correlationPairs: correlationPairs(apiUrl),
|
|
20
21
|
...correlationPairs(apiUrl),
|
|
@@ -50,5 +51,7 @@ export default (apiUrl) => ({
|
|
|
50
51
|
...chatLogs(apiUrl),
|
|
51
52
|
expertReferences: expertReferences(apiUrl),
|
|
52
53
|
...expertReferences(apiUrl),
|
|
54
|
+
knownFacts: knownFacts(apiUrl),
|
|
55
|
+
...knownFacts(apiUrl),
|
|
53
56
|
});
|
|
54
57
|
//# sourceMappingURL=engine.js.map
|
package/esm/engine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,2BAA2B,CAAC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mB,CAAC,MAAM,CAAC;IAChD,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAC9B,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC;IAChC,GAAG,WAAW,CAAC,MAAM,CAAC;IACtB,gBAAgB,EAAE,gBAAgB,CAAC,MAAM,CAAC;IAC1C,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC;IAC1B,GAAG,QAAQ,CAAC,MAAM,CAAC;IACnB,gBAAgB,EAAE,gBAAgB,CAAC,MAAM,CAAC;IAC1C,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC;IAC9B,GAAG,UAAU,CAAC,MAAM,CAAC;CACtB,CAAC,CAAC"}
|
package/esm/index.d.ts
CHANGED
|
@@ -9,6 +9,32 @@ declare const api: (hostname?: string) => {
|
|
|
9
9
|
asset: {
|
|
10
10
|
getResourceUrl: ({ type, resourceURI, sessionID, baseURL, }: import("./helpers/asset").ResourceURLParams) => string;
|
|
11
11
|
};
|
|
12
|
+
getKnownFacts: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
13
|
+
count: number;
|
|
14
|
+
knownFacts: import("./types").KnownFact[];
|
|
15
|
+
}>;
|
|
16
|
+
getKnownFactsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
|
|
17
|
+
count: number;
|
|
18
|
+
knownFacts: import("./types").KnownFact[];
|
|
19
|
+
}>;
|
|
20
|
+
getKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec & {
|
|
21
|
+
knownFact: import("./types").KnownFact;
|
|
22
|
+
}>;
|
|
23
|
+
deleteKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec>;
|
|
24
|
+
knownFacts: {
|
|
25
|
+
getKnownFacts: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
26
|
+
count: number;
|
|
27
|
+
knownFacts: import("./types").KnownFact[];
|
|
28
|
+
}>;
|
|
29
|
+
getKnownFactsPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
|
|
30
|
+
count: number;
|
|
31
|
+
knownFacts: import("./types").KnownFact[];
|
|
32
|
+
}>;
|
|
33
|
+
getKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec & {
|
|
34
|
+
knownFact: import("./types").KnownFact;
|
|
35
|
+
}>;
|
|
36
|
+
deleteKnownFact: (sessionId: string, knownFactID: string) => Promise<import("./types").ResponseSpec>;
|
|
37
|
+
};
|
|
12
38
|
getExpertReferences: (sessionId: string) => Promise<import("./types").ResponseSpec & {
|
|
13
39
|
count: number;
|
|
14
40
|
experts: import("./types").ExpertReference[];
|
package/esm/types.d.ts
CHANGED
|
@@ -549,6 +549,7 @@ export type ChatLogLine = {
|
|
|
549
549
|
timestamp: string;
|
|
550
550
|
inbound: boolean;
|
|
551
551
|
text: string;
|
|
552
|
+
emitter?: string;
|
|
552
553
|
media?: ChatMedium[];
|
|
553
554
|
memoryID?: string;
|
|
554
555
|
contextVars?: {
|
|
@@ -563,6 +564,7 @@ export type ChatLog = {
|
|
|
563
564
|
memoriID: string;
|
|
564
565
|
sessionID: string;
|
|
565
566
|
receiverTag?: string;
|
|
567
|
+
boardOfExperts?: boolean;
|
|
566
568
|
lines: ChatLogLine[];
|
|
567
569
|
};
|
|
568
570
|
export type CorrelationPair = {
|
|
@@ -695,3 +697,12 @@ export interface ExpertReference {
|
|
|
695
697
|
lastChangeTimestamp?: string;
|
|
696
698
|
lastChangeSessionID?: string;
|
|
697
699
|
}
|
|
700
|
+
export interface KnownFact {
|
|
701
|
+
knownFactID: string;
|
|
702
|
+
knownFactType: 'ShortTerm' | 'LongTerm';
|
|
703
|
+
text: string;
|
|
704
|
+
creationTimestamp?: string;
|
|
705
|
+
creationSessionID?: string;
|
|
706
|
+
lastChangeTimestamp?: string;
|
|
707
|
+
lastChangeSessionID?: string;
|
|
708
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import memori from '../index';
|
|
2
|
+
|
|
3
|
+
// FIXME: switch back to production when backend fixes request processing issue
|
|
4
|
+
const client = memori('https://backend-staging.memori.ai');
|
|
5
|
+
|
|
6
|
+
describe('engine/knownFacts api', () => {
|
|
7
|
+
it('works on knownFacts apis', async () => {
|
|
8
|
+
expect(
|
|
9
|
+
await client.knownFacts.getKnownFacts(
|
|
10
|
+
'768b9654-e781-4c3c-81fa-ae1529d1bfbe'
|
|
11
|
+
)
|
|
12
|
+
).not.toBeNull();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('works on knownFacts apis with shorthand version', async () => {
|
|
16
|
+
expect(
|
|
17
|
+
await client.getKnownFacts('768b9654-e781-4c3c-81fa-ae1529d1bfbe')
|
|
18
|
+
).not.toBeNull();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ResponseSpec, KnownFact } from '../types';
|
|
2
|
+
import { apiFetcher } from '../apiFetcher';
|
|
3
|
+
|
|
4
|
+
/***********************
|
|
5
|
+
* *
|
|
6
|
+
* Known Facts *
|
|
7
|
+
* *
|
|
8
|
+
***********************/
|
|
9
|
+
|
|
10
|
+
export default (apiUrl: string) => ({
|
|
11
|
+
/**
|
|
12
|
+
* Lists all Known Facts objects associated with the current User.
|
|
13
|
+
* @param {string} sessionId The session ID
|
|
14
|
+
*/
|
|
15
|
+
getKnownFacts: async (sessionId: string) =>
|
|
16
|
+
apiFetcher(`/KnownFacts/${sessionId}`, {
|
|
17
|
+
method: 'GET',
|
|
18
|
+
apiUrl,
|
|
19
|
+
}) as Promise<
|
|
20
|
+
ResponseSpec & {
|
|
21
|
+
/**
|
|
22
|
+
* Total number of Known Fact objects.
|
|
23
|
+
*/
|
|
24
|
+
count: number;
|
|
25
|
+
/**
|
|
26
|
+
* List of Known Fact objects. May be empty.
|
|
27
|
+
*/
|
|
28
|
+
knownFacts: KnownFact[];
|
|
29
|
+
}
|
|
30
|
+
>,
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Lists all Known Facts objects associated with the current User, with pagination.
|
|
34
|
+
* @param {string} sessionId The session ID
|
|
35
|
+
* @param {number} from The 0-based index of the first Known Fact object to list
|
|
36
|
+
* @param {number} howMany The number of the Known Fact objects to list
|
|
37
|
+
*/
|
|
38
|
+
getKnownFactsPaginated: async (
|
|
39
|
+
sessionId: string,
|
|
40
|
+
from: number,
|
|
41
|
+
howMany: number
|
|
42
|
+
) =>
|
|
43
|
+
apiFetcher(`/KnownFacts/${sessionId}/${from}/${howMany}`, {
|
|
44
|
+
method: 'GET',
|
|
45
|
+
apiUrl,
|
|
46
|
+
}) as Promise<
|
|
47
|
+
ResponseSpec & {
|
|
48
|
+
/**
|
|
49
|
+
* Total number of Known Fact objects.
|
|
50
|
+
*/
|
|
51
|
+
count: number;
|
|
52
|
+
/**
|
|
53
|
+
* List of Known Fact objects. May be empty.
|
|
54
|
+
*/
|
|
55
|
+
knownFacts: KnownFact[];
|
|
56
|
+
}
|
|
57
|
+
>,
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Gets the details of a Known Fact object.
|
|
61
|
+
* @param {string} sessionId The session ID
|
|
62
|
+
* @param {string} knownFactID The Known Fact object ID
|
|
63
|
+
*/
|
|
64
|
+
getKnownFact: async (sessionId: string, knownFactID: string) =>
|
|
65
|
+
apiFetcher(`/KnownFact/${sessionId}/${knownFactID}`, {
|
|
66
|
+
method: 'GET',
|
|
67
|
+
apiUrl,
|
|
68
|
+
}) as Promise<
|
|
69
|
+
ResponseSpec & {
|
|
70
|
+
knownFact: KnownFact;
|
|
71
|
+
}
|
|
72
|
+
>,
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Deletes an existing Known Fact object.
|
|
76
|
+
* @param {string} sessionId The session ID
|
|
77
|
+
* @param {string} knownFactID The Known Fact object ID
|
|
78
|
+
*/
|
|
79
|
+
deleteKnownFact: async (sessionId: string, knownFactID: string) =>
|
|
80
|
+
apiFetcher(`/KnownFact/${sessionId}/${knownFactID}`, {
|
|
81
|
+
method: 'DELETE',
|
|
82
|
+
apiUrl,
|
|
83
|
+
}) as Promise<ResponseSpec>,
|
|
84
|
+
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import memori from '../index';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
const client = memori('https://backend-staging.memori.ai');
|
|
3
|
+
const client = memori('https://backend.memori.ai');
|
|
5
4
|
|
|
6
5
|
describe('engine/search api', () => {
|
|
7
6
|
it('works on search apis', async () => {
|
package/src/engine.ts
CHANGED
|
@@ -15,6 +15,7 @@ import contextVars from './engine/contextVars';
|
|
|
15
15
|
import customDictionary from './engine/customDictionary';
|
|
16
16
|
import chatLogs from './engine/chatLogs';
|
|
17
17
|
import expertReferences from './engine/expertReferences';
|
|
18
|
+
import knownFacts from './engine/knownFacts';
|
|
18
19
|
|
|
19
20
|
export default (apiUrl: string) => ({
|
|
20
21
|
correlationPairs: correlationPairs(apiUrl),
|
|
@@ -51,4 +52,6 @@ export default (apiUrl: string) => ({
|
|
|
51
52
|
...chatLogs(apiUrl),
|
|
52
53
|
expertReferences: expertReferences(apiUrl),
|
|
53
54
|
...expertReferences(apiUrl),
|
|
55
|
+
knownFacts: knownFacts(apiUrl),
|
|
56
|
+
...knownFacts(apiUrl),
|
|
54
57
|
});
|
package/src/types.ts
CHANGED
|
@@ -660,6 +660,12 @@ export type ChatLogLine = {
|
|
|
660
660
|
* Text of the line.
|
|
661
661
|
*/
|
|
662
662
|
text: string;
|
|
663
|
+
/**
|
|
664
|
+
* @type {string=}
|
|
665
|
+
* Name of the Memori that provided the text. Used with Board of Experts model.
|
|
666
|
+
* Null for inbound lines, if no Board of Experts is configured, or if the Memori providing the text is the chairman of the Board.
|
|
667
|
+
*/
|
|
668
|
+
emitter?: string;
|
|
663
669
|
/**
|
|
664
670
|
* Media attached with the Dialog State Machine emission, if present. Empty if the line is inbound.
|
|
665
671
|
*/
|
|
@@ -712,6 +718,11 @@ export type ChatLog = {
|
|
|
712
718
|
* Tag of the Person object authenticated in the session. Null if the chat was performed by anonymous.
|
|
713
719
|
*/
|
|
714
720
|
receiverTag?: string;
|
|
721
|
+
/**
|
|
722
|
+
* @type {?boolean}
|
|
723
|
+
* True if this chat log was performed with the Memori configured as a Board of Experts.
|
|
724
|
+
*/
|
|
725
|
+
boardOfExperts?: boolean;
|
|
715
726
|
|
|
716
727
|
/**
|
|
717
728
|
* List of Chat Line objects of this chat.
|
|
@@ -1126,3 +1137,26 @@ export interface ExpertReference {
|
|
|
1126
1137
|
lastChangeTimestamp?: string;
|
|
1127
1138
|
lastChangeSessionID?: string;
|
|
1128
1139
|
}
|
|
1140
|
+
|
|
1141
|
+
export interface KnownFact {
|
|
1142
|
+
/**
|
|
1143
|
+
* Known Fact object ID.
|
|
1144
|
+
* @type {string}
|
|
1145
|
+
*/
|
|
1146
|
+
knownFactID: string;
|
|
1147
|
+
/**
|
|
1148
|
+
* Known Fact type, e.g. ShortTerm or LongTerm.
|
|
1149
|
+
* Currently possible values are:
|
|
1150
|
+
* - ShortTerm: this Known Fact is always used during conversations
|
|
1151
|
+
* - LongTerm: this Known Fact is used during conversations only if relevant to the current question
|
|
1152
|
+
*/
|
|
1153
|
+
knownFactType: 'ShortTerm' | 'LongTerm';
|
|
1154
|
+
/**
|
|
1155
|
+
* Text of the Known Fact.
|
|
1156
|
+
*/
|
|
1157
|
+
text: string;
|
|
1158
|
+
creationTimestamp?: string;
|
|
1159
|
+
creationSessionID?: string;
|
|
1160
|
+
lastChangeTimestamp?: string;
|
|
1161
|
+
lastChangeSessionID?: string;
|
|
1162
|
+
}
|