@memori.ai/memori-api-client 2.6.0 → 2.6.2
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/README.md +8 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/esm/index.d.ts +7 -2
- package/esm/index.js +11 -4
- package/esm/index.js.map +1 -1
- package/esm/types.d.ts +2 -0
- package/package.json +1 -1
- package/src/index.ts +11 -4
- package/src/types.ts +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [2.6.2](https://github.com/memori-ai/memori-api-client/compare/v2.6.1...v2.6.2) (2023-12-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Changes
|
|
7
|
+
|
|
8
|
+
* add chatlogs attributes for board of experts ([3d746a7](https://github.com/memori-ai/memori-api-client/commit/3d746a7ec97cfe05bc584b2f8b1fc5b6ca450d80))
|
|
9
|
+
|
|
10
|
+
## [2.6.1](https://github.com/memori-ai/memori-api-client/compare/v2.6.0...v2.6.1) (2023-12-08)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Maintenance
|
|
14
|
+
|
|
15
|
+
* add endpoints as constants ([de513a2](https://github.com/memori-ai/memori-api-client/commit/de513a2662c163f3ad0181c1406d7f9da0dd72b7))
|
|
16
|
+
|
|
3
17
|
## [2.6.0](https://github.com/memori-ai/memori-api-client/compare/v2.5.0...v2.6.0) (2023-12-08)
|
|
4
18
|
|
|
5
19
|
|
package/README.md
CHANGED
|
@@ -55,6 +55,14 @@ memori.constants.allowedMediaTypes; // list of allowed media types in asset uplo
|
|
|
55
55
|
memori.constants.anonTag; // tag for anonymous users
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
Endpoint passed during initialization:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
memori.constants.HOSTNAME; // host name of the API, parameter of the constructor
|
|
62
|
+
memori.constants.BACKEND_URL;
|
|
63
|
+
memori.constants.ENGINE_URL;
|
|
64
|
+
```
|
|
65
|
+
|
|
58
66
|
### Asset
|
|
59
67
|
|
|
60
68
|
There is a helper method parsing media urls from the DB, handling different cases
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import * as constants from './constants';
|
|
2
1
|
declare const api: (hostname?: string) => {
|
|
3
|
-
constants:
|
|
2
|
+
constants: {
|
|
3
|
+
HOSTNAME: string;
|
|
4
|
+
BACKEND_URL: string;
|
|
5
|
+
ENGINE_URL: string;
|
|
6
|
+
allowedMediaTypes: string[];
|
|
7
|
+
anonTag: "👤";
|
|
8
|
+
};
|
|
4
9
|
asset: {
|
|
5
10
|
getResourceUrl: ({ type, resourceURI, sessionID, baseURL, }: import("./helpers/asset").ResourceURLParams) => string;
|
|
6
11
|
};
|
package/dist/index.js
CHANGED
|
@@ -8,11 +8,18 @@ const constants = tslib_1.__importStar(require("./constants"));
|
|
|
8
8
|
const asset_1 = tslib_1.__importDefault(require("./helpers/asset"));
|
|
9
9
|
const api = (hostname) => {
|
|
10
10
|
const apiUrl = (0, getApiUrl_1.getApiUrl)(hostname);
|
|
11
|
+
const engineUrl = `${apiUrl}/memori/v2`;
|
|
12
|
+
const backendUrl = `${apiUrl}/api/v2`;
|
|
11
13
|
return {
|
|
12
|
-
backend: (0, backend_1.default)(
|
|
13
|
-
...(0, engine_1.default)(
|
|
14
|
-
constants
|
|
15
|
-
|
|
14
|
+
backend: (0, backend_1.default)(backendUrl),
|
|
15
|
+
...(0, engine_1.default)(engineUrl),
|
|
16
|
+
constants: {
|
|
17
|
+
...constants,
|
|
18
|
+
HOSTNAME: apiUrl,
|
|
19
|
+
BACKEND_URL: backendUrl,
|
|
20
|
+
ENGINE_URL: engineUrl,
|
|
21
|
+
},
|
|
22
|
+
asset: (0, asset_1.default)(backendUrl),
|
|
16
23
|
};
|
|
17
24
|
};
|
|
18
25
|
exports.default = api;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAChD,gEAAgC;AAChC,8DAA8B;AAC9B,+DAAyC;AACzC,oEAAoC;AAEpC,MAAM,GAAG,GAAG,CAAC,QAAiB,EAAE,EAAE;IAChC,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAChD,gEAAgC;AAChC,8DAA8B;AAC9B,+DAAyC;AACzC,oEAAoC;AAEpC,MAAM,GAAG,GAAG,CAAC,QAAiB,EAAE,EAAE;IAChC,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,SAAS,GAAG,GAAG,MAAM,YAAY,CAAC;IACxC,MAAM,UAAU,GAAG,GAAG,MAAM,SAAS,CAAC;IAEtC,OAAO;QACL,OAAO,EAAE,IAAA,iBAAO,EAAC,UAAU,CAAC;QAC5B,GAAG,IAAA,gBAAM,EAAC,SAAS,CAAC;QACpB,SAAS,EAAE;YACT,GAAG,SAAS;YACZ,QAAQ,EAAE,MAAM;YAChB,WAAW,EAAE,UAAU;YACvB,UAAU,EAAE,SAAS;SACtB;QACD,KAAK,EAAE,IAAA,eAAK,EAAC,UAAU,CAAC;KACzB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,GAAG,CAAC"}
|
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 = {
|
package/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import * as constants from './constants';
|
|
2
1
|
declare const api: (hostname?: string) => {
|
|
3
|
-
constants:
|
|
2
|
+
constants: {
|
|
3
|
+
HOSTNAME: string;
|
|
4
|
+
BACKEND_URL: string;
|
|
5
|
+
ENGINE_URL: string;
|
|
6
|
+
allowedMediaTypes: string[];
|
|
7
|
+
anonTag: "👤";
|
|
8
|
+
};
|
|
4
9
|
asset: {
|
|
5
10
|
getResourceUrl: ({ type, resourceURI, sessionID, baseURL, }: import("./helpers/asset").ResourceURLParams) => string;
|
|
6
11
|
};
|
package/esm/index.js
CHANGED
|
@@ -5,11 +5,18 @@ import * as constants from './constants';
|
|
|
5
5
|
import asset from './helpers/asset';
|
|
6
6
|
const api = (hostname) => {
|
|
7
7
|
const apiUrl = getApiUrl(hostname);
|
|
8
|
+
const engineUrl = `${apiUrl}/memori/v2`;
|
|
9
|
+
const backendUrl = `${apiUrl}/api/v2`;
|
|
8
10
|
return {
|
|
9
|
-
backend: backend(
|
|
10
|
-
...engine(
|
|
11
|
-
constants
|
|
12
|
-
|
|
11
|
+
backend: backend(backendUrl),
|
|
12
|
+
...engine(engineUrl),
|
|
13
|
+
constants: {
|
|
14
|
+
...constants,
|
|
15
|
+
HOSTNAME: apiUrl,
|
|
16
|
+
BACKEND_URL: backendUrl,
|
|
17
|
+
ENGINE_URL: engineUrl,
|
|
18
|
+
},
|
|
19
|
+
asset: asset(backendUrl),
|
|
13
20
|
};
|
|
14
21
|
};
|
|
15
22
|
export default api;
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAEpC,MAAM,GAAG,GAAG,CAAC,QAAiB,EAAE,EAAE;IAChC,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAEpC,MAAM,GAAG,GAAG,CAAC,QAAiB,EAAE,EAAE;IAChC,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,SAAS,GAAG,GAAG,MAAM,YAAY,CAAC;IACxC,MAAM,UAAU,GAAG,GAAG,MAAM,SAAS,CAAC;IAEtC,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC;QAC5B,GAAG,MAAM,CAAC,SAAS,CAAC;QACpB,SAAS,EAAE;YACT,GAAG,SAAS;YACZ,QAAQ,EAAE,MAAM;YAChB,WAAW,EAAE,UAAU;YACvB,UAAU,EAAE,SAAS;SACtB;QACD,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC;KACzB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
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 = {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -6,12 +6,19 @@ import asset from './helpers/asset';
|
|
|
6
6
|
|
|
7
7
|
const api = (hostname?: string) => {
|
|
8
8
|
const apiUrl = getApiUrl(hostname);
|
|
9
|
+
const engineUrl = `${apiUrl}/memori/v2`;
|
|
10
|
+
const backendUrl = `${apiUrl}/api/v2`;
|
|
9
11
|
|
|
10
12
|
return {
|
|
11
|
-
backend: backend(
|
|
12
|
-
...engine(
|
|
13
|
-
constants
|
|
14
|
-
|
|
13
|
+
backend: backend(backendUrl),
|
|
14
|
+
...engine(engineUrl),
|
|
15
|
+
constants: {
|
|
16
|
+
...constants,
|
|
17
|
+
HOSTNAME: apiUrl,
|
|
18
|
+
BACKEND_URL: backendUrl,
|
|
19
|
+
ENGINE_URL: engineUrl,
|
|
20
|
+
},
|
|
21
|
+
asset: asset(backendUrl),
|
|
15
22
|
};
|
|
16
23
|
};
|
|
17
24
|
|
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.
|