@memori.ai/memori-api-client 2.4.0 → 2.6.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 CHANGED
@@ -1,5 +1,19 @@
1
1
 
2
2
 
3
+ ## [2.6.0](https://github.com/memori-ai/memori-api-client/compare/v2.5.0...v2.6.0) (2023-12-08)
4
+
5
+
6
+ ### Features
7
+
8
+ * add boe flag on memori type ([71fc3fc](https://github.com/memori-ai/memori-api-client/commit/71fc3fc9a891beae66a7518ac91bad633166bf27))
9
+
10
+ ## [2.5.0](https://github.com/memori-ai/memori-api-client/compare/v2.4.0...v2.5.0) (2023-12-08)
11
+
12
+
13
+ ### Features
14
+
15
+ * add expert references api + new attributes for boards of experts ([c09c317](https://github.com/memori-ai/memori-api-client/commit/c09c31796dd8107075786b60a337da1b0c59cec7))
16
+
3
17
  ## [2.4.0](https://github.com/memori-ai/memori-api-client/compare/v2.3.0...v2.4.0) (2023-11-13)
4
18
 
5
19
 
@@ -0,0 +1,22 @@
1
+ import type { ResponseSpec, ExpertReference } from '../types';
2
+ declare const _default: (apiUrl: string) => {
3
+ getExpertReferences: (sessionId: string) => Promise<ResponseSpec & {
4
+ count: number;
5
+ experts: ExpertReference[];
6
+ }>;
7
+ getExpertReferencesPaginated: (sessionId: string, from: number, howMany: number) => Promise<ResponseSpec & {
8
+ count: number;
9
+ experts: ExpertReference[];
10
+ }>;
11
+ getExpertReference: (sessionId: string, expertID: string) => Promise<ResponseSpec & {
12
+ expert: ExpertReference;
13
+ }>;
14
+ updateExpertReference: (sessionId: string, expertReference: Partial<ExpertReference> & {
15
+ expertID: ExpertReference['expertID'];
16
+ }) => Promise<ResponseSpec>;
17
+ createExpertReference: (sessionId: string, expertReference: Omit<Partial<ExpertReference>, 'expertID'>) => Promise<ResponseSpec & {
18
+ expertID: ExpertReference['expertID'];
19
+ }>;
20
+ deleteExpertReference: (sessionId: string, expertID: string) => Promise<ResponseSpec>;
21
+ };
22
+ export default _default;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const apiFetcher_1 = require("../apiFetcher");
4
+ exports.default = (apiUrl) => ({
5
+ getExpertReferences: async (sessionId) => (0, apiFetcher_1.apiFetcher)(`/ExpertReferences/${sessionId}`, {
6
+ method: 'GET',
7
+ apiUrl,
8
+ }),
9
+ getExpertReferencesPaginated: async (sessionId, from, howMany) => (0, apiFetcher_1.apiFetcher)(`/ExpertReferences/${sessionId}/${from}/${howMany}`, {
10
+ method: 'GET',
11
+ apiUrl,
12
+ }),
13
+ getExpertReference: async (sessionId, expertID) => (0, apiFetcher_1.apiFetcher)(`/ExpertReference/${sessionId}/${expertID}`, {
14
+ method: 'GET',
15
+ apiUrl,
16
+ }),
17
+ updateExpertReference: async (sessionId, expertReference) => (0, apiFetcher_1.apiFetcher)(`/ExpertReference/${sessionId}/${expertReference.expertID}`, {
18
+ method: 'PATCH',
19
+ apiUrl,
20
+ body: expertReference,
21
+ }),
22
+ createExpertReference: async (sessionId, expertReference) => (0, apiFetcher_1.apiFetcher)(`/ExpertReference/${sessionId}`, {
23
+ method: 'POST',
24
+ apiUrl,
25
+ body: expertReference,
26
+ }),
27
+ deleteExpertReference: async (sessionId, expertID) => (0, apiFetcher_1.apiFetcher)(`/ExpertReference/${sessionId}/${expertID}`, {
28
+ method: 'DELETE',
29
+ apiUrl,
30
+ }),
31
+ });
32
+ //# sourceMappingURL=expertReferences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expertReferences.js","sourceRoot":"","sources":["../../src/engine/expertReferences.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAQ3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAKlC,mBAAmB,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CAC/C,IAAA,uBAAU,EAAC,qBAAqB,SAAS,EAAE,EAAE;QAC3C,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAWA;IAQH,4BAA4B,EAAE,KAAK,EACjC,SAAiB,EACjB,IAAY,EACZ,OAAe,EACf,EAAE,CACF,IAAA,uBAAU,EAAC,qBAAqB,SAAS,IAAI,IAAI,IAAI,OAAO,EAAE,EAAE;QAC9D,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAWA;IAOH,kBAAkB,EAAE,KAAK,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAChE,IAAA,uBAAU,EAAC,oBAAoB,SAAS,IAAI,QAAQ,EAAE,EAAE;QACtD,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAIA;IAOH,qBAAqB,EAAE,KAAK,EAC1B,SAAiB,EACjB,eAEC,EACD,EAAE,CACF,IAAA,uBAAU,EAAC,oBAAoB,SAAS,IAAI,eAAe,CAAC,QAAQ,EAAE,EAAE;QACtE,MAAM,EAAE,OAAO;QACf,MAAM;QACN,IAAI,EAAE,eAAe;KACtB,CAA0B;IAO7B,qBAAqB,EAAE,KAAK,EAC1B,SAAiB,EACjB,eAA2D,EAC3D,EAAE,CACF,IAAA,uBAAU,EAAC,oBAAoB,SAAS,EAAE,EAAE;QAC1C,MAAM,EAAE,MAAM;QACd,MAAM;QACN,IAAI,EAAE,eAAe;KACtB,CAIA;IAOH,qBAAqB,EAAE,KAAK,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CACnE,IAAA,uBAAU,EAAC,oBAAoB,SAAS,IAAI,QAAQ,EAAE,EAAE;QACtD,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.memori.ai');
6
+ describe('engine/expertReferences api', () => {
7
+ it('works on expertReferences apis', async () => {
8
+ expect(await client.expertReferences.getExpertReferences('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
9
+ });
10
+ it('works on chatLogs apis with shorthand version', async () => {
11
+ expect(await client.getExpertReferences('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
12
+ });
13
+ });
14
+ //# sourceMappingURL=expertReferences.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expertReferences.test.js","sourceRoot":"","sources":["../../src/engine/expertReferences.test.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;AAE9B,MAAM,MAAM,GAAG,IAAA,eAAM,EAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QAC9C,MAAM,CACJ,MAAM,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,CAC/C,sCAAsC,CACvC,CACF,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,MAAM,CACJ,MAAM,MAAM,CAAC,mBAAmB,CAAC,sCAAsC,CAAC,CACzE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { Memory, ResponseSpec } from '../types';
2
2
  declare const _default: (apiUrl: string) => {
3
- getMemories: (sessionId: string, type?: 'ALL' | 'CONTENTS' | 'DEFAULTS' | 'DRAFTS') => Promise<ResponseSpec & {
3
+ getMemories: (sessionId: string, type?: 'ALL' | 'CONTENTS' | 'DEFAULTS' | 'DRAFTS' | 'EXPERT_REFERENCES') => Promise<ResponseSpec & {
4
4
  memories: Memory[];
5
5
  }>;
6
- getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: 'ALL' | 'CONTENTS' | 'DEFAULTS' | 'DRAFTS') => Promise<ResponseSpec & {
6
+ getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: 'ALL' | 'CONTENTS' | 'DEFAULTS' | 'DRAFTS' | 'EXPERT_REFERENCES') => Promise<ResponseSpec & {
7
7
  count: number;
8
8
  memories: Memory[];
9
9
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"memories.js","sourceRoot":"","sources":["../../src/engine/memories.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAQ3C,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAMlC,WAAW,EAAE,KAAK,EAChB,SAAiB,EACjB,IAAiD,EACjD,EAAE,CACF,IAAA,uBAAU,EAAC,aAAa,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE;QAC5D,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAIA;IASH,oBAAoB,EAAE,KAAK,EACzB,SAAiB,EACjB,IAAY,EACZ,OAAe,EACf,IAAiD,EACjD,EAAE,CACF,IAAA,uBAAU,EACR,aAAa,SAAS,IAAI,IAAI,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EACpE;QACE,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAMF;IAOH,SAAS,EAAE,KAAK,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CACvD,IAAA,uBAAU,EAAC,WAAW,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC7C,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAIA;IAOH,WAAW,EAAE,KAAK,EAAE,SAAiB,EAAE,MAAc,EAAE,EAAE,CACvD,IAAA,uBAAU,EAAC,WAAW,SAAS,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE;QACpD,MAAM,EAAE,OAAO;QACf,MAAM;QACN,IAAI,EAAE,MAAM;KACb,CAA0B;IAO7B,YAAY,EAAE,KAA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AAE,CACvD,IAAA,uBAAU,EAAC,WAAW,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC7C,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAIA;IAOH,WAAW,EAAE,KAAK,EAAE,SAAiB,EAAE,MAAc,EAAE,EAAE,CACvD,IAAA,uBAAU,EAAC,WAAW,SAAS,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE;QACpD,MAAM,EAAE,OAAO;QACf,MAAM;QACN,IAAI,EAAE,MAAM;KACb,CAA0B;IAO7B,YAAY,EAAE,KAAK,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAC1D,IAAA,uBAAU,EAAC,WAAW,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC7C,MAAM,EAAE,QAAQ;QAChB,MAAM;KACP,CAA0B;IAO7B,UAAU,EAAE,KAAK,EAAE,SAAiB,EAAE,MAAgC,EAAE,EAAE,CACxE,IAAA,uBAAU,EAAC,WAAW,SAAS,EAAE,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,MAAM;QACN,IAAI,EAAE,MAAM;KACb,CAIA;IAOH,eAAe,EAAE,KAAK,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAC7D,IAAA,uBAAU,EAAC,iBAAiB,SAAS,IAAI,QAAQ,EAAE,EAAE;QACnD,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAA0B;CAC9B,CAAC,CAAC"}
package/dist/engine.d.ts CHANGED
@@ -1,4 +1,42 @@
1
1
  declare const _default: (apiUrl: string) => {
2
+ getExpertReferences: (sessionId: string) => Promise<import("./types").ResponseSpec & {
3
+ count: number;
4
+ experts: import("./types").ExpertReference[];
5
+ }>;
6
+ getExpertReferencesPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
7
+ count: number;
8
+ experts: import("./types").ExpertReference[];
9
+ }>;
10
+ getExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec & {
11
+ expert: import("./types").ExpertReference;
12
+ }>;
13
+ updateExpertReference: (sessionId: string, expertReference: Partial<import("./types").ExpertReference> & {
14
+ expertID: string;
15
+ }) => Promise<import("./types").ResponseSpec>;
16
+ createExpertReference: (sessionId: string, expertReference: Omit<Partial<import("./types").ExpertReference>, "expertID">) => Promise<import("./types").ResponseSpec & {
17
+ expertID: string;
18
+ }>;
19
+ deleteExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec>;
20
+ expertReferences: {
21
+ getExpertReferences: (sessionId: string) => Promise<import("./types").ResponseSpec & {
22
+ count: number;
23
+ experts: import("./types").ExpertReference[];
24
+ }>;
25
+ getExpertReferencesPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
26
+ count: number;
27
+ experts: import("./types").ExpertReference[];
28
+ }>;
29
+ getExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec & {
30
+ expert: import("./types").ExpertReference;
31
+ }>;
32
+ updateExpertReference: (sessionId: string, expertReference: Partial<import("./types").ExpertReference> & {
33
+ expertID: string;
34
+ }) => Promise<import("./types").ResponseSpec>;
35
+ createExpertReference: (sessionId: string, expertReference: Omit<Partial<import("./types").ExpertReference>, "expertID">) => Promise<import("./types").ResponseSpec & {
36
+ expertID: string;
37
+ }>;
38
+ deleteExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec>;
39
+ };
2
40
  getChatLogs: (sessionId: string, dateFrom?: string | undefined, dateTo?: string | undefined) => Promise<import("./types").ResponseSpec & {
3
41
  chatLogs: import("./types").ChatLog[];
4
42
  }>;
@@ -247,10 +285,10 @@ declare const _default: (apiUrl: string) => {
247
285
  undefinedWords: string[];
248
286
  }>;
249
287
  };
250
- getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
288
+ getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
251
289
  memories: import("./types").Memory[];
252
290
  }>;
253
- getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
291
+ getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
254
292
  count: number;
255
293
  memories: import("./types").Memory[];
256
294
  }>;
@@ -264,10 +302,10 @@ declare const _default: (apiUrl: string) => {
264
302
  }>;
265
303
  getMemoryAccess: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
266
304
  memories: {
267
- getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
305
+ getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
268
306
  memories: import("./types").Memory[];
269
307
  }>;
270
- getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
308
+ getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
271
309
  count: number;
272
310
  memories: import("./types").Memory[];
273
311
  }>;
package/dist/engine.js CHANGED
@@ -17,6 +17,7 @@ const unansweredQuestions_1 = tslib_1.__importDefault(require("./engine/unanswer
17
17
  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
+ const expertReferences_1 = tslib_1.__importDefault(require("./engine/expertReferences"));
20
21
  exports.default = (apiUrl) => ({
21
22
  correlationPairs: (0, correlationPairs_1.default)(apiUrl),
22
23
  ...(0, correlationPairs_1.default)(apiUrl),
@@ -50,5 +51,7 @@ exports.default = (apiUrl) => ({
50
51
  ...(0, customDictionary_1.default)(apiUrl),
51
52
  chatLogs: (0, chatLogs_1.default)(apiUrl),
52
53
  ...(0, chatLogs_1.default)(apiUrl),
54
+ expertReferences: (0, expertReferences_1.default)(apiUrl),
55
+ ...(0, expertReferences_1.default)(apiUrl),
53
56
  });
54
57
  //# sourceMappingURL=engine.js.map
@@ -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;AAEzC,kBAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAClC,gBAAgB,EAAE,IAAA,0BAAgB,EAAC,MAAM,CAAC;IAC1C,GAAG,IAAA,0BAAgB,EAAC,MAAM,CAAC;IAC3B,MAAM,EAAE,IAAA,gBAAM,EAAC,MAAM,CAAC;IACtB,GAAG,IAAA,gBAAM,EAAC,MAAM,CAAC;IACjB,OAAO,EAAE,IAAA,iBAAO,EAAC,MAAM,CAAC;IACxB,GAAG,IAAA,iBAAO,EAAC,MAAM,CAAC;IAClB,gBAAgB,EAAE,IAAA,0BAAgB,EAAC,MAAM,CAAC;IAC1C,GAAG,IAAA,0BAAgB,EAAC,MAAM,CAAC;IAC3B,KAAK,EAAE,IAAA,eAAK,EAAC,MAAM,CAAC;IACpB,GAAG,IAAA,eAAK,EAAC,MAAM,CAAC;IAChB,QA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ClB,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;CAC5B,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -4,6 +4,44 @@ declare const api: (hostname?: string) => {
4
4
  asset: {
5
5
  getResourceUrl: ({ type, resourceURI, sessionID, baseURL, }: import("./helpers/asset").ResourceURLParams) => string;
6
6
  };
7
+ getExpertReferences: (sessionId: string) => Promise<import("./types").ResponseSpec & {
8
+ count: number;
9
+ experts: import("./types").ExpertReference[];
10
+ }>;
11
+ getExpertReferencesPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
12
+ count: number;
13
+ experts: import("./types").ExpertReference[];
14
+ }>;
15
+ getExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec & {
16
+ expert: import("./types").ExpertReference;
17
+ }>;
18
+ updateExpertReference: (sessionId: string, expertReference: Partial<import("./types").ExpertReference> & {
19
+ expertID: string;
20
+ }) => Promise<import("./types").ResponseSpec>;
21
+ createExpertReference: (sessionId: string, expertReference: Omit<Partial<import("./types").ExpertReference>, "expertID">) => Promise<import("./types").ResponseSpec & {
22
+ expertID: string;
23
+ }>;
24
+ deleteExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec>;
25
+ expertReferences: {
26
+ getExpertReferences: (sessionId: string) => Promise<import("./types").ResponseSpec & {
27
+ count: number;
28
+ experts: import("./types").ExpertReference[];
29
+ }>;
30
+ getExpertReferencesPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
31
+ count: number;
32
+ experts: import("./types").ExpertReference[];
33
+ }>;
34
+ getExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec & {
35
+ expert: import("./types").ExpertReference;
36
+ }>;
37
+ updateExpertReference: (sessionId: string, expertReference: Partial<import("./types").ExpertReference> & {
38
+ expertID: string;
39
+ }) => Promise<import("./types").ResponseSpec>;
40
+ createExpertReference: (sessionId: string, expertReference: Omit<Partial<import("./types").ExpertReference>, "expertID">) => Promise<import("./types").ResponseSpec & {
41
+ expertID: string;
42
+ }>;
43
+ deleteExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec>;
44
+ };
7
45
  getChatLogs: (sessionId: string, dateFrom?: string | undefined, dateTo?: string | undefined) => Promise<import("./types").ResponseSpec & {
8
46
  chatLogs: import("./types").ChatLog[];
9
47
  }>;
@@ -252,10 +290,10 @@ declare const api: (hostname?: string) => {
252
290
  undefinedWords: string[];
253
291
  }>;
254
292
  };
255
- getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
293
+ getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
256
294
  memories: import("./types").Memory[];
257
295
  }>;
258
- getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
296
+ getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
259
297
  count: number;
260
298
  memories: import("./types").Memory[];
261
299
  }>;
@@ -269,10 +307,10 @@ declare const api: (hostname?: string) => {
269
307
  }>;
270
308
  getMemoryAccess: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
271
309
  memories: {
272
- getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
310
+ getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
273
311
  memories: import("./types").Memory[];
274
312
  }>;
275
- getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
313
+ getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
276
314
  count: number;
277
315
  memories: import("./types").Memory[];
278
316
  }>;
package/dist/types.d.ts CHANGED
@@ -54,6 +54,7 @@ export declare type Memori = {
54
54
  disableR5Loop?: boolean;
55
55
  ageRestriction?: number;
56
56
  nsfw?: boolean;
57
+ enableBoardOfExperts?: boolean;
57
58
  enableCompletions?: boolean;
58
59
  completionDescription?: string;
59
60
  completionProvider?: '-' | 'OpenAI';
@@ -323,6 +324,7 @@ export declare type DialogState = {
323
324
  confidence?: number;
324
325
  confidenceLevel?: 'NONE' | 'LOW' | 'MEDIUM' | 'HIGH';
325
326
  emission?: string;
327
+ emitter?: string;
326
328
  completion?: boolean;
327
329
  continuationEmitted?: boolean;
328
330
  lastMatchedMemoryID?: string;
@@ -436,7 +438,7 @@ export declare type Answer = {
436
438
  };
437
439
  export declare type Memory = {
438
440
  memoryID: string;
439
- memoryType: string;
441
+ memoryType: 'Question' | 'Story' | 'Default' | 'CompletionDraft' | 'ExpertReference';
440
442
  lastRead?: string;
441
443
  readOccurrences?: number;
442
444
  receiverID?: string;
@@ -501,6 +503,7 @@ export declare type Message = {
501
503
  fromUser?: boolean;
502
504
  media?: Medium[];
503
505
  initial?: boolean;
506
+ emitter?: string;
504
507
  timestamp?: string;
505
508
  contextVars?: {
506
509
  [key: string]: string;
@@ -679,3 +682,16 @@ export interface Badge {
679
682
  issuerEmail?: string;
680
683
  issuerURL?: string;
681
684
  }
685
+ export interface ExpertReference {
686
+ expertID: string;
687
+ name: string;
688
+ description: string;
689
+ default?: boolean;
690
+ expertMemoriID: string;
691
+ expertPassword?: string;
692
+ expertBaseURL: string;
693
+ creationTimestamp?: string;
694
+ creationSessionID?: string;
695
+ lastChangeTimestamp?: string;
696
+ lastChangeSessionID?: string;
697
+ }
@@ -0,0 +1,22 @@
1
+ import type { ResponseSpec, ExpertReference } from '../types';
2
+ declare const _default: (apiUrl: string) => {
3
+ getExpertReferences: (sessionId: string) => Promise<ResponseSpec & {
4
+ count: number;
5
+ experts: ExpertReference[];
6
+ }>;
7
+ getExpertReferencesPaginated: (sessionId: string, from: number, howMany: number) => Promise<ResponseSpec & {
8
+ count: number;
9
+ experts: ExpertReference[];
10
+ }>;
11
+ getExpertReference: (sessionId: string, expertID: string) => Promise<ResponseSpec & {
12
+ expert: ExpertReference;
13
+ }>;
14
+ updateExpertReference: (sessionId: string, expertReference: Partial<ExpertReference> & {
15
+ expertID: ExpertReference['expertID'];
16
+ }) => Promise<ResponseSpec>;
17
+ createExpertReference: (sessionId: string, expertReference: Omit<Partial<ExpertReference>, 'expertID'>) => Promise<ResponseSpec & {
18
+ expertID: ExpertReference['expertID'];
19
+ }>;
20
+ deleteExpertReference: (sessionId: string, expertID: string) => Promise<ResponseSpec>;
21
+ };
22
+ export default _default;
@@ -0,0 +1,30 @@
1
+ import { apiFetcher } from '../apiFetcher';
2
+ export default (apiUrl) => ({
3
+ getExpertReferences: async (sessionId) => apiFetcher(`/ExpertReferences/${sessionId}`, {
4
+ method: 'GET',
5
+ apiUrl,
6
+ }),
7
+ getExpertReferencesPaginated: async (sessionId, from, howMany) => apiFetcher(`/ExpertReferences/${sessionId}/${from}/${howMany}`, {
8
+ method: 'GET',
9
+ apiUrl,
10
+ }),
11
+ getExpertReference: async (sessionId, expertID) => apiFetcher(`/ExpertReference/${sessionId}/${expertID}`, {
12
+ method: 'GET',
13
+ apiUrl,
14
+ }),
15
+ updateExpertReference: async (sessionId, expertReference) => apiFetcher(`/ExpertReference/${sessionId}/${expertReference.expertID}`, {
16
+ method: 'PATCH',
17
+ apiUrl,
18
+ body: expertReference,
19
+ }),
20
+ createExpertReference: async (sessionId, expertReference) => apiFetcher(`/ExpertReference/${sessionId}`, {
21
+ method: 'POST',
22
+ apiUrl,
23
+ body: expertReference,
24
+ }),
25
+ deleteExpertReference: async (sessionId, expertID) => apiFetcher(`/ExpertReference/${sessionId}/${expertID}`, {
26
+ method: 'DELETE',
27
+ apiUrl,
28
+ }),
29
+ });
30
+ //# sourceMappingURL=expertReferences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expertReferences.js","sourceRoot":"","sources":["../../src/engine/expertReferences.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,eAAe,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAKlC,mBAAmB,EAAE,KAAK,EAAE,SAAiB,EAAE,EAAE,CAC/C,UAAU,CAAC,qBAAqB,SAAS,EAAE,EAAE;QAC3C,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAWA;IAQH,4BAA4B,EAAE,KAAK,EACjC,SAAiB,EACjB,IAAY,EACZ,OAAe,EACf,EAAE,CACF,UAAU,CAAC,qBAAqB,SAAS,IAAI,IAAI,IAAI,OAAO,EAAE,EAAE;QAC9D,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAWA;IAOH,kBAAkB,EAAE,KAAK,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAChE,UAAU,CAAC,oBAAoB,SAAS,IAAI,QAAQ,EAAE,EAAE;QACtD,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAIA;IAOH,qBAAqB,EAAE,KAAK,EAC1B,SAAiB,EACjB,eAEC,EACD,EAAE,CACF,UAAU,CAAC,oBAAoB,SAAS,IAAI,eAAe,CAAC,QAAQ,EAAE,EAAE;QACtE,MAAM,EAAE,OAAO;QACf,MAAM;QACN,IAAI,EAAE,eAAe;KACtB,CAA0B;IAO7B,qBAAqB,EAAE,KAAK,EAC1B,SAAiB,EACjB,eAA2D,EAC3D,EAAE,CACF,UAAU,CAAC,oBAAoB,SAAS,EAAE,EAAE;QAC1C,MAAM,EAAE,MAAM;QACd,MAAM;QACN,IAAI,EAAE,eAAe;KACtB,CAIA;IAOH,qBAAqB,EAAE,KAAK,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CACnE,UAAU,CAAC,oBAAoB,SAAS,IAAI,QAAQ,EAAE,EAAE;QACtD,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.memori.ai');
3
+ describe('engine/expertReferences api', () => {
4
+ it('works on expertReferences apis', async () => {
5
+ expect(await client.expertReferences.getExpertReferences('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
6
+ });
7
+ it('works on chatLogs apis with shorthand version', async () => {
8
+ expect(await client.getExpertReferences('768b9654-e781-4c3c-81fa-ae1529d1bfbe')).not.toBeNull();
9
+ });
10
+ });
11
+ //# sourceMappingURL=expertReferences.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expertReferences.test.js","sourceRoot":"","sources":["../../src/engine/expertReferences.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAEnD,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QAC9C,MAAM,CACJ,MAAM,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,CAC/C,sCAAsC,CACvC,CACF,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,MAAM,CACJ,MAAM,MAAM,CAAC,mBAAmB,CAAC,sCAAsC,CAAC,CACzE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { Memory, ResponseSpec } from '../types';
2
2
  declare const _default: (apiUrl: string) => {
3
- getMemories: (sessionId: string, type?: 'ALL' | 'CONTENTS' | 'DEFAULTS' | 'DRAFTS') => Promise<ResponseSpec & {
3
+ getMemories: (sessionId: string, type?: 'ALL' | 'CONTENTS' | 'DEFAULTS' | 'DRAFTS' | 'EXPERT_REFERENCES') => Promise<ResponseSpec & {
4
4
  memories: Memory[];
5
5
  }>;
6
- getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: 'ALL' | 'CONTENTS' | 'DEFAULTS' | 'DRAFTS') => Promise<ResponseSpec & {
6
+ getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: 'ALL' | 'CONTENTS' | 'DEFAULTS' | 'DRAFTS' | 'EXPERT_REFERENCES') => Promise<ResponseSpec & {
7
7
  count: number;
8
8
  memories: Memory[];
9
9
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"memories.js","sourceRoot":"","sources":["../../src/engine/memories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE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AM;KACb,CAA0B;IAO7B,YAAY,EAAE,KAAK,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAC1D,UAAU,CAAC,WAAW,SAAS,IAAI,QAAQ,EAAE,EAAE;QAC7C,MAAM,EAAE,QAAQ;QAChB,MAAM;KACP,CAA0B;IAO7B,UAAU,EAAE,KAAK,EAAE,SAAiB,EAAE,MAAgC,EAAE,EAAE,CACxE,UAAU,CAAC,WAAW,SAAS,EAAE,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,MAAM;QACN,IAAI,EAAE,MAAM;KACb,CAIA;IAOH,eAAe,EAAE,KAAK,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAC7D,UAAU,CAAC,iBAAiB,SAAS,IAAI,QAAQ,EAAE,EAAE;QACnD,MAAM,EAAE,KAAK;QACb,MAAM;KACP,CAA0B;CAC9B,CAAC,CAAC"}
package/esm/engine.d.ts CHANGED
@@ -1,4 +1,42 @@
1
1
  declare const _default: (apiUrl: string) => {
2
+ getExpertReferences: (sessionId: string) => Promise<import("./types").ResponseSpec & {
3
+ count: number;
4
+ experts: import("./types").ExpertReference[];
5
+ }>;
6
+ getExpertReferencesPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
7
+ count: number;
8
+ experts: import("./types").ExpertReference[];
9
+ }>;
10
+ getExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec & {
11
+ expert: import("./types").ExpertReference;
12
+ }>;
13
+ updateExpertReference: (sessionId: string, expertReference: Partial<import("./types").ExpertReference> & {
14
+ expertID: string;
15
+ }) => Promise<import("./types").ResponseSpec>;
16
+ createExpertReference: (sessionId: string, expertReference: Omit<Partial<import("./types").ExpertReference>, "expertID">) => Promise<import("./types").ResponseSpec & {
17
+ expertID: string;
18
+ }>;
19
+ deleteExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec>;
20
+ expertReferences: {
21
+ getExpertReferences: (sessionId: string) => Promise<import("./types").ResponseSpec & {
22
+ count: number;
23
+ experts: import("./types").ExpertReference[];
24
+ }>;
25
+ getExpertReferencesPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
26
+ count: number;
27
+ experts: import("./types").ExpertReference[];
28
+ }>;
29
+ getExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec & {
30
+ expert: import("./types").ExpertReference;
31
+ }>;
32
+ updateExpertReference: (sessionId: string, expertReference: Partial<import("./types").ExpertReference> & {
33
+ expertID: string;
34
+ }) => Promise<import("./types").ResponseSpec>;
35
+ createExpertReference: (sessionId: string, expertReference: Omit<Partial<import("./types").ExpertReference>, "expertID">) => Promise<import("./types").ResponseSpec & {
36
+ expertID: string;
37
+ }>;
38
+ deleteExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec>;
39
+ };
2
40
  getChatLogs: (sessionId: string, dateFrom?: string | undefined, dateTo?: string | undefined) => Promise<import("./types").ResponseSpec & {
3
41
  chatLogs: import("./types").ChatLog[];
4
42
  }>;
@@ -247,10 +285,10 @@ declare const _default: (apiUrl: string) => {
247
285
  undefinedWords: string[];
248
286
  }>;
249
287
  };
250
- getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
288
+ getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
251
289
  memories: import("./types").Memory[];
252
290
  }>;
253
- getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
291
+ getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
254
292
  count: number;
255
293
  memories: import("./types").Memory[];
256
294
  }>;
@@ -264,10 +302,10 @@ declare const _default: (apiUrl: string) => {
264
302
  }>;
265
303
  getMemoryAccess: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
266
304
  memories: {
267
- getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
305
+ getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
268
306
  memories: import("./types").Memory[];
269
307
  }>;
270
- getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
308
+ getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
271
309
  count: number;
272
310
  memories: import("./types").Memory[];
273
311
  }>;
package/esm/engine.js CHANGED
@@ -14,6 +14,7 @@ import unansweredQuestions from './engine/unansweredQuestions';
14
14
  import contextVars from './engine/contextVars';
15
15
  import customDictionary from './engine/customDictionary';
16
16
  import chatLogs from './engine/chatLogs';
17
+ import expertReferences from './engine/expertReferences';
17
18
  export default (apiUrl) => ({
18
19
  correlationPairs: correlationPairs(apiUrl),
19
20
  ...correlationPairs(apiUrl),
@@ -47,5 +48,7 @@ export default (apiUrl) => ({
47
48
  ...customDictionary(apiUrl),
48
49
  chatLogs: chatLogs(apiUrl),
49
50
  ...chatLogs(apiUrl),
51
+ expertReferences: expertReferences(apiUrl),
52
+ ...expertReferences(apiUrl),
50
53
  });
51
54
  //# 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,M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,MAAM,CAAC;IACpB,GAAG,KAAK,CAAC,MAAM,CAAC;IAChB,mBAAmB,EAAE,mBAAmB,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;CAC5B,CAAC,CAAC"}
package/esm/index.d.ts CHANGED
@@ -4,6 +4,44 @@ declare const api: (hostname?: string) => {
4
4
  asset: {
5
5
  getResourceUrl: ({ type, resourceURI, sessionID, baseURL, }: import("./helpers/asset").ResourceURLParams) => string;
6
6
  };
7
+ getExpertReferences: (sessionId: string) => Promise<import("./types").ResponseSpec & {
8
+ count: number;
9
+ experts: import("./types").ExpertReference[];
10
+ }>;
11
+ getExpertReferencesPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
12
+ count: number;
13
+ experts: import("./types").ExpertReference[];
14
+ }>;
15
+ getExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec & {
16
+ expert: import("./types").ExpertReference;
17
+ }>;
18
+ updateExpertReference: (sessionId: string, expertReference: Partial<import("./types").ExpertReference> & {
19
+ expertID: string;
20
+ }) => Promise<import("./types").ResponseSpec>;
21
+ createExpertReference: (sessionId: string, expertReference: Omit<Partial<import("./types").ExpertReference>, "expertID">) => Promise<import("./types").ResponseSpec & {
22
+ expertID: string;
23
+ }>;
24
+ deleteExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec>;
25
+ expertReferences: {
26
+ getExpertReferences: (sessionId: string) => Promise<import("./types").ResponseSpec & {
27
+ count: number;
28
+ experts: import("./types").ExpertReference[];
29
+ }>;
30
+ getExpertReferencesPaginated: (sessionId: string, from: number, howMany: number) => Promise<import("./types").ResponseSpec & {
31
+ count: number;
32
+ experts: import("./types").ExpertReference[];
33
+ }>;
34
+ getExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec & {
35
+ expert: import("./types").ExpertReference;
36
+ }>;
37
+ updateExpertReference: (sessionId: string, expertReference: Partial<import("./types").ExpertReference> & {
38
+ expertID: string;
39
+ }) => Promise<import("./types").ResponseSpec>;
40
+ createExpertReference: (sessionId: string, expertReference: Omit<Partial<import("./types").ExpertReference>, "expertID">) => Promise<import("./types").ResponseSpec & {
41
+ expertID: string;
42
+ }>;
43
+ deleteExpertReference: (sessionId: string, expertID: string) => Promise<import("./types").ResponseSpec>;
44
+ };
7
45
  getChatLogs: (sessionId: string, dateFrom?: string | undefined, dateTo?: string | undefined) => Promise<import("./types").ResponseSpec & {
8
46
  chatLogs: import("./types").ChatLog[];
9
47
  }>;
@@ -252,10 +290,10 @@ declare const api: (hostname?: string) => {
252
290
  undefinedWords: string[];
253
291
  }>;
254
292
  };
255
- getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
293
+ getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
256
294
  memories: import("./types").Memory[];
257
295
  }>;
258
- getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
296
+ getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
259
297
  count: number;
260
298
  memories: import("./types").Memory[];
261
299
  }>;
@@ -269,10 +307,10 @@ declare const api: (hostname?: string) => {
269
307
  }>;
270
308
  getMemoryAccess: (sessionId: string, memoryId: string) => Promise<import("./types").ResponseSpec>;
271
309
  memories: {
272
- getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
310
+ getMemories: (sessionId: string, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
273
311
  memories: import("./types").Memory[];
274
312
  }>;
275
- getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<import("./types").ResponseSpec & {
313
+ getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | "EXPERT_REFERENCES" | undefined) => Promise<import("./types").ResponseSpec & {
276
314
  count: number;
277
315
  memories: import("./types").Memory[];
278
316
  }>;
package/esm/types.d.ts CHANGED
@@ -54,6 +54,7 @@ export declare type Memori = {
54
54
  disableR5Loop?: boolean;
55
55
  ageRestriction?: number;
56
56
  nsfw?: boolean;
57
+ enableBoardOfExperts?: boolean;
57
58
  enableCompletions?: boolean;
58
59
  completionDescription?: string;
59
60
  completionProvider?: '-' | 'OpenAI';
@@ -323,6 +324,7 @@ export declare type DialogState = {
323
324
  confidence?: number;
324
325
  confidenceLevel?: 'NONE' | 'LOW' | 'MEDIUM' | 'HIGH';
325
326
  emission?: string;
327
+ emitter?: string;
326
328
  completion?: boolean;
327
329
  continuationEmitted?: boolean;
328
330
  lastMatchedMemoryID?: string;
@@ -436,7 +438,7 @@ export declare type Answer = {
436
438
  };
437
439
  export declare type Memory = {
438
440
  memoryID: string;
439
- memoryType: string;
441
+ memoryType: 'Question' | 'Story' | 'Default' | 'CompletionDraft' | 'ExpertReference';
440
442
  lastRead?: string;
441
443
  readOccurrences?: number;
442
444
  receiverID?: string;
@@ -501,6 +503,7 @@ export declare type Message = {
501
503
  fromUser?: boolean;
502
504
  media?: Medium[];
503
505
  initial?: boolean;
506
+ emitter?: string;
504
507
  timestamp?: string;
505
508
  contextVars?: {
506
509
  [key: string]: string;
@@ -679,3 +682,16 @@ export interface Badge {
679
682
  issuerEmail?: string;
680
683
  issuerURL?: string;
681
684
  }
685
+ export interface ExpertReference {
686
+ expertID: string;
687
+ name: string;
688
+ description: string;
689
+ default?: boolean;
690
+ expertMemoriID: string;
691
+ expertPassword?: string;
692
+ expertBaseURL: string;
693
+ creationTimestamp?: string;
694
+ creationSessionID?: string;
695
+ lastChangeTimestamp?: string;
696
+ lastChangeSessionID?: string;
697
+ }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.4.0",
2
+ "version": "2.6.0",
3
3
  "name": "@memori.ai/memori-api-client",
4
4
  "description": "React library to integrate a Memori in your app or website",
5
5
  "license": "Apache-2.0",
@@ -0,0 +1,19 @@
1
+ import memori from '../index';
2
+
3
+ const client = memori('https://backend.memori.ai');
4
+
5
+ describe('engine/expertReferences api', () => {
6
+ it('works on expertReferences apis', async () => {
7
+ expect(
8
+ await client.expertReferences.getExpertReferences(
9
+ '768b9654-e781-4c3c-81fa-ae1529d1bfbe'
10
+ )
11
+ ).not.toBeNull();
12
+ });
13
+
14
+ it('works on chatLogs apis with shorthand version', async () => {
15
+ expect(
16
+ await client.getExpertReferences('768b9654-e781-4c3c-81fa-ae1529d1bfbe')
17
+ ).not.toBeNull();
18
+ });
19
+ });
@@ -0,0 +1,120 @@
1
+ import type { ResponseSpec, ExpertReference } from '../types';
2
+ import { apiFetcher } from '../apiFetcher';
3
+
4
+ /************************
5
+ * *
6
+ * Expert References *
7
+ * *
8
+ ************************/
9
+
10
+ export default (apiUrl: string) => ({
11
+ /**
12
+ * Lists all Expert Reference objects.
13
+ * @param {string} sessionId The session ID
14
+ */
15
+ getExpertReferences: async (sessionId: string) =>
16
+ apiFetcher(`/ExpertReferences/${sessionId}`, {
17
+ method: 'GET',
18
+ apiUrl,
19
+ }) as Promise<
20
+ ResponseSpec & {
21
+ /**
22
+ * Total number of Expert Reference objects.
23
+ */
24
+ count: number;
25
+ /**
26
+ * List of Expert Reference objects. May be empty.
27
+ */
28
+ experts: ExpertReference[];
29
+ }
30
+ >,
31
+
32
+ /**
33
+ * Lists Expert Reference objects with pagination.
34
+ * @param {string} sessionId The session ID
35
+ * @param {number} from The 0-based index of the first Expert Reference object to list
36
+ * @param {number} howMany The number of the Expert Reference objects to list
37
+ */
38
+ getExpertReferencesPaginated: async (
39
+ sessionId: string,
40
+ from: number,
41
+ howMany: number
42
+ ) =>
43
+ apiFetcher(`/ExpertReferences/${sessionId}/${from}/${howMany}`, {
44
+ method: 'GET',
45
+ apiUrl,
46
+ }) as Promise<
47
+ ResponseSpec & {
48
+ /**
49
+ * Total number of Expert Reference objects.
50
+ */
51
+ count: number;
52
+ /**
53
+ * List of Expert Reference objects. May be empty.
54
+ */
55
+ experts: ExpertReference[];
56
+ }
57
+ >,
58
+
59
+ /**
60
+ * Gets the details of an Expert Reference object.
61
+ * @param {string} sessionId The session ID
62
+ * @param {string} expertID The Expert Reference object ID
63
+ */
64
+ getExpertReference: async (sessionId: string, expertID: string) =>
65
+ apiFetcher(`/ExpertReference/${sessionId}/${expertID}`, {
66
+ method: 'GET',
67
+ apiUrl,
68
+ }) as Promise<
69
+ ResponseSpec & {
70
+ expert: ExpertReference;
71
+ }
72
+ >,
73
+
74
+ /**
75
+ * Updates an existing Expert Reference object.
76
+ * @param {string} sessionId The session ID
77
+ * @param {ExpertReference} expertReference The Expert Reference object
78
+ */
79
+ updateExpertReference: async (
80
+ sessionId: string,
81
+ expertReference: Partial<ExpertReference> & {
82
+ expertID: ExpertReference['expertID'];
83
+ }
84
+ ) =>
85
+ apiFetcher(`/ExpertReference/${sessionId}/${expertReference.expertID}`, {
86
+ method: 'PATCH',
87
+ apiUrl,
88
+ body: expertReference,
89
+ }) as Promise<ResponseSpec>,
90
+
91
+ /**
92
+ * Adds a new Expert Reference object.
93
+ * @param {string} sessionId The session ID
94
+ * @param {ExpertReference} expertReference The Expert Reference object
95
+ */
96
+ createExpertReference: async (
97
+ sessionId: string,
98
+ expertReference: Omit<Partial<ExpertReference>, 'expertID'>
99
+ ) =>
100
+ apiFetcher(`/ExpertReference/${sessionId}`, {
101
+ method: 'POST',
102
+ apiUrl,
103
+ body: expertReference,
104
+ }) as Promise<
105
+ ResponseSpec & {
106
+ expertID: ExpertReference['expertID'];
107
+ }
108
+ >,
109
+
110
+ /**
111
+ * Removes an existing Expert Reference object.
112
+ * @param {string} sessionId The session ID
113
+ * @param {string} expertID The Expert Reference object ID
114
+ */
115
+ deleteExpertReference: async (sessionId: string, expertID: string) =>
116
+ apiFetcher(`/ExpertReference/${sessionId}/${expertID}`, {
117
+ method: 'DELETE',
118
+ apiUrl,
119
+ }) as Promise<ResponseSpec>,
120
+ });
@@ -11,11 +11,11 @@ export default (apiUrl: string) => ({
11
11
  /**
12
12
  * Lists all Memory objects.
13
13
  * @param {string} sessionId The session ID
14
- * @param {string=} type Optional type of the Memory objects to list: ALL, CONTENTS, DEFAULTS, DRAFTS
14
+ * @param {string=} type Optional type of the Memory objects to list: ALL, CONTENTS, DEFAULTS, DRAFTS, EXPERT_REFERENCES
15
15
  */
16
16
  getMemories: async (
17
17
  sessionId: string,
18
- type?: 'ALL' | 'CONTENTS' | 'DEFAULTS' | 'DRAFTS'
18
+ type?: 'ALL' | 'CONTENTS' | 'DEFAULTS' | 'DRAFTS' | 'EXPERT_REFERENCES'
19
19
  ) =>
20
20
  apiFetcher(`/Memories/${sessionId}${type ? `/${type}` : ''}`, {
21
21
  method: 'GET',
@@ -31,13 +31,13 @@ export default (apiUrl: string) => ({
31
31
  * @param {string} sessionId The session ID
32
32
  * @param {number} from The starting index
33
33
  * @param {number} howMany The number of items to return
34
- * @param {string=} type Optional type of the Memory objects to list: ALL, CONTENTS, DEFAULTS, DRAFTS
34
+ * @param {string=} type Optional type of the Memory objects to list: ALL, CONTENTS, DEFAULTS, DRAFTS, EXPERT_REFERENCES
35
35
  */
36
36
  getMemoriesPaginated: async (
37
37
  sessionId: string,
38
38
  from: number,
39
39
  howMany: number,
40
- type?: 'ALL' | 'CONTENTS' | 'DEFAULTS' | 'DRAFTS'
40
+ type?: 'ALL' | 'CONTENTS' | 'DEFAULTS' | 'DRAFTS' | 'EXPERT_REFERENCES'
41
41
  ) =>
42
42
  apiFetcher(
43
43
  `/Memories/${sessionId}/${from}/${howMany}${type ? `/${type}` : ''}`,
package/src/engine.ts CHANGED
@@ -14,6 +14,7 @@ import unansweredQuestions from './engine/unansweredQuestions';
14
14
  import contextVars from './engine/contextVars';
15
15
  import customDictionary from './engine/customDictionary';
16
16
  import chatLogs from './engine/chatLogs';
17
+ import expertReferences from './engine/expertReferences';
17
18
 
18
19
  export default (apiUrl: string) => ({
19
20
  correlationPairs: correlationPairs(apiUrl),
@@ -48,4 +49,6 @@ export default (apiUrl: string) => ({
48
49
  ...customDictionary(apiUrl),
49
50
  chatLogs: chatLogs(apiUrl),
50
51
  ...chatLogs(apiUrl),
52
+ expertReferences: expertReferences(apiUrl),
53
+ ...expertReferences(apiUrl),
51
54
  });
package/src/types.ts CHANGED
@@ -65,6 +65,7 @@ export declare type Memori = {
65
65
  disableR5Loop?: boolean;
66
66
  ageRestriction?: number;
67
67
  nsfw?: boolean;
68
+ enableBoardOfExperts?: boolean;
68
69
  enableCompletions?: boolean;
69
70
  completionDescription?: string;
70
71
  completionProvider?: '-' | 'OpenAI';
@@ -401,6 +402,7 @@ export declare type DialogState = {
401
402
  confidence?: number;
402
403
  confidenceLevel?: 'NONE' | 'LOW' | 'MEDIUM' | 'HIGH';
403
404
  emission?: string;
405
+ emitter?: string;
404
406
  completion?: boolean;
405
407
  continuationEmitted?: boolean;
406
408
  lastMatchedMemoryID?: string;
@@ -520,7 +522,12 @@ export declare type Answer = {
520
522
 
521
523
  export declare type Memory = {
522
524
  memoryID: string;
523
- memoryType: string;
525
+ memoryType:
526
+ | 'Question'
527
+ | 'Story'
528
+ | 'Default'
529
+ | 'CompletionDraft'
530
+ | 'ExpertReference';
524
531
  lastRead?: string;
525
532
  readOccurrences?: number;
526
533
  receiverID?: string;
@@ -584,6 +591,7 @@ export declare type Message = {
584
591
  fromUser?: boolean;
585
592
  media?: Medium[];
586
593
  initial?: boolean;
594
+ emitter?: string;
587
595
  timestamp?: string;
588
596
  contextVars?: { [key: string]: string };
589
597
  };
@@ -1075,3 +1083,46 @@ export interface Badge {
1075
1083
  issuerEmail?: string;
1076
1084
  issuerURL?: string;
1077
1085
  }
1086
+
1087
+ export interface ExpertReference {
1088
+ /**
1089
+ * @type {string}
1090
+ * Expert Reference object ID. Returned during Get operations. Ignored in other cases.
1091
+ */
1092
+ expertID: string;
1093
+ /**
1094
+ * @type {string}
1095
+ * Name of the expert. Returned during Get operations. Required during Add operations. Optional during Update operations.
1096
+ */
1097
+ name: string;
1098
+ /**
1099
+ * @type {string}
1100
+ * Description of the expert, i.e. a list of the expert's skills and knowledge. Returned during Get operations. Required during Add operations. Optional during Update operations.
1101
+ */
1102
+ description: string;
1103
+ /**
1104
+ * @type {boolean}
1105
+ * If True, this expert is used when no other expert is competent for the current question. Returned during Get operations. Optional during Add operations. Optional during Update operations.
1106
+ */
1107
+ default?: boolean;
1108
+ /**
1109
+ * @type {string}
1110
+ * ID of the expert Memori. Returned during Get operations. Required during Add operations. Optional during Update operations.
1111
+ * NOTE: engine memroi ID
1112
+ */
1113
+ expertMemoriID: string;
1114
+ /**
1115
+ * @type {string=}
1116
+ * Password of the expert Memori. Required if the chained Memori is private or secret. Optional during Add operations and Update operations. Ignore in other cases.
1117
+ */
1118
+ expertPassword?: string;
1119
+ /**
1120
+ * @type {string}
1121
+ * Base URL of a chained Memori, typically https://engine.memori.ai/. Returned during Get operations. Required during Add operations. Optional during Update operations.
1122
+ */
1123
+ expertBaseURL: string;
1124
+ creationTimestamp?: string;
1125
+ creationSessionID?: string;
1126
+ lastChangeTimestamp?: string;
1127
+ lastChangeSessionID?: string;
1128
+ }