@memori.ai/memori-api-client 2.7.0 → 3.0.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 +13 -0
- package/README.md +7 -12
- package/dist/backend/user.d.ts +3 -0
- package/dist/backend/user.js +3 -0
- package/dist/backend/user.js.map +1 -1
- package/dist/backend.d.ts +6 -0
- package/dist/client.test.js +1 -1
- package/dist/client.test.js.map +1 -1
- package/dist/engine/knownFacts.test.js +1 -1
- package/dist/engine/knownFacts.test.js.map +1 -1
- package/dist/engine/topics.d.ts +23 -0
- package/dist/engine/topics.js +26 -0
- package/dist/engine/topics.js.map +1 -0
- package/dist/engine/topics.test.d.ts +1 -0
- package/dist/engine/topics.test.js +14 -0
- package/dist/engine/topics.test.js.map +1 -0
- package/dist/engine/user.d.ts +23 -0
- package/dist/engine/user.js +26 -0
- package/dist/engine/user.js.map +1 -0
- package/dist/engine/user.test.d.ts +1 -0
- package/dist/engine/user.test.js +14 -0
- package/dist/engine/user.test.js.map +1 -0
- package/dist/engine.d.ts +80 -12
- package/dist/engine.js +6 -3
- package/dist/engine.js.map +1 -1
- package/dist/helpers/asset.js +1 -1
- package/dist/helpers/asset.js.map +1 -1
- package/dist/index.d.ts +86 -12
- package/dist/types.d.ts +39 -10
- package/esm/backend/user.d.ts +3 -0
- package/esm/backend/user.js +3 -0
- package/esm/backend/user.js.map +1 -1
- package/esm/backend.d.ts +6 -0
- package/esm/client.test.js +1 -1
- package/esm/client.test.js.map +1 -1
- package/esm/engine/knownFacts.test.js +1 -1
- package/esm/engine/knownFacts.test.js.map +1 -1
- package/esm/engine/topics.d.ts +23 -0
- package/esm/engine/topics.js +24 -0
- package/esm/engine/topics.js.map +1 -0
- package/esm/engine/topics.test.d.ts +1 -0
- package/esm/engine/topics.test.js +11 -0
- package/esm/engine/topics.test.js.map +1 -0
- package/esm/engine/user.d.ts +23 -0
- package/esm/engine/user.js +24 -0
- package/esm/engine/user.js.map +1 -0
- package/esm/engine/user.test.d.ts +1 -0
- package/esm/engine/user.test.js +11 -0
- package/esm/engine/user.test.js.map +1 -0
- package/esm/engine.d.ts +80 -12
- package/esm/engine.js +6 -3
- package/esm/engine.js.map +1 -1
- package/esm/helpers/asset.js +1 -1
- package/esm/helpers/asset.js.map +1 -1
- package/esm/index.d.ts +86 -12
- package/esm/types.d.ts +39 -10
- package/package.json +1 -1
- package/src/backend/user.ts +14 -0
- package/src/client.test.ts +1 -1
- package/src/engine/knownFacts.test.ts +1 -2
- package/src/engine/topics.test.ts +17 -0
- package/src/engine/topics.ts +124 -0
- package/src/engine/{promptedQuestions.test.ts → user.test.ts} +5 -5
- package/src/engine/user.ts +124 -0
- package/src/engine.ts +6 -3
- package/src/helpers/asset.ts +2 -2
- package/src/types.ts +79 -10
- package/src/engine/promptedQuestions.ts +0 -63
package/esm/types.d.ts
CHANGED
|
@@ -54,16 +54,19 @@ export declare type Memori = {
|
|
|
54
54
|
disableR5Loop?: boolean;
|
|
55
55
|
ageRestriction?: number;
|
|
56
56
|
nsfw?: boolean;
|
|
57
|
-
enableBoardOfExperts?: boolean;
|
|
58
57
|
enableCompletions?: boolean;
|
|
59
58
|
completionDescription?: string;
|
|
60
|
-
completionProvider?: '-' | 'OpenAI';
|
|
59
|
+
completionProvider?: '-' | 'Mistral' | 'OpenAI';
|
|
61
60
|
completionProviderConfig?: string;
|
|
62
61
|
enableDeepThought?: boolean;
|
|
62
|
+
enableBoardOfExperts?: boolean;
|
|
63
63
|
disableCompletionMediaExtraction?: boolean;
|
|
64
64
|
chainingMemoriID?: string;
|
|
65
65
|
chainingBaseURL?: string;
|
|
66
66
|
chainingPassword?: string;
|
|
67
|
+
dcmUser?: string;
|
|
68
|
+
dcmSecret?: string;
|
|
69
|
+
dcmAppContext?: string;
|
|
67
70
|
properties?: [{
|
|
68
71
|
[key: string]: string;
|
|
69
72
|
}];
|
|
@@ -124,7 +127,7 @@ export declare type User = {
|
|
|
124
127
|
lastChangeTimestamp?: string;
|
|
125
128
|
referral?: string;
|
|
126
129
|
couponCode?: string;
|
|
127
|
-
defaultCompletionProvider?: '-' | 'OpenAI';
|
|
130
|
+
defaultCompletionProvider?: '-' | 'Mistral' | 'OpenAI';
|
|
128
131
|
defaultCompletionProviderConfig?: string;
|
|
129
132
|
paying?: boolean;
|
|
130
133
|
notificationPrefs?: NotificationPrefs[];
|
|
@@ -132,6 +135,8 @@ export declare type User = {
|
|
|
132
135
|
age?: number;
|
|
133
136
|
tnCAndPPAccepted?: boolean;
|
|
134
137
|
tnCAndPPAcceptanceDate?: string;
|
|
138
|
+
pAndCUAccepted?: boolean;
|
|
139
|
+
pAndCUAcceptanceDate?: string;
|
|
135
140
|
avatarURL?: string;
|
|
136
141
|
avatar3DURL?: string;
|
|
137
142
|
avatar3DURLType?: string;
|
|
@@ -192,13 +197,13 @@ export type TenantConfig = {
|
|
|
192
197
|
name: string;
|
|
193
198
|
showNewUser: boolean;
|
|
194
199
|
requirePosition: boolean;
|
|
195
|
-
feedbackURL?: string;
|
|
196
200
|
};
|
|
197
201
|
export type TenantBase = {
|
|
198
202
|
tenantID?: string;
|
|
199
203
|
name?: string;
|
|
200
204
|
description?: string;
|
|
201
205
|
logoURL?: string;
|
|
206
|
+
aliases?: string[];
|
|
202
207
|
adminCount?: number;
|
|
203
208
|
userCount?: number;
|
|
204
209
|
memoriCount?: number;
|
|
@@ -211,15 +216,19 @@ export type TenantBase = {
|
|
|
211
216
|
maxFreeSessions?: number;
|
|
212
217
|
maxFreeSessionsPerUser?: number;
|
|
213
218
|
nonFreeSessionCost?: number;
|
|
219
|
+
maxImportSize?: number;
|
|
220
|
+
maxImportSizePerUser?: number;
|
|
214
221
|
maxCompletions?: number;
|
|
215
222
|
maxCompletionsPerUser?: number;
|
|
223
|
+
defaultCompletionProvider?: '-' | 'Mistral' | 'OpenAI';
|
|
224
|
+
defaultCompletionProviderConfig?: string;
|
|
216
225
|
paying?: boolean;
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
226
|
+
enableUserMemoriCreation?: boolean;
|
|
227
|
+
enableBoardOfExperts?: boolean;
|
|
228
|
+
enableDCMIntegration?: boolean;
|
|
229
|
+
enableBadges?: boolean;
|
|
230
|
+
enableVirtualSpaces?: boolean;
|
|
231
|
+
enableDeepThought?: boolean;
|
|
223
232
|
creationTimestamp?: string;
|
|
224
233
|
lastChangeTimestamp?: string;
|
|
225
234
|
};
|
|
@@ -706,3 +715,23 @@ export interface KnownFact {
|
|
|
706
715
|
lastChangeTimestamp?: string;
|
|
707
716
|
lastChangeSessionID?: string;
|
|
708
717
|
}
|
|
718
|
+
export interface MemoriUser {
|
|
719
|
+
userID: string;
|
|
720
|
+
email: string;
|
|
721
|
+
userName: string;
|
|
722
|
+
tenantName: string;
|
|
723
|
+
disableDeepThought: boolean;
|
|
724
|
+
creationTimestamp: string;
|
|
725
|
+
creationSessionID: string;
|
|
726
|
+
lastChangeTimestamp: string;
|
|
727
|
+
lastChangeSessionID: string;
|
|
728
|
+
}
|
|
729
|
+
export interface Topic {
|
|
730
|
+
topicID: string;
|
|
731
|
+
name: string;
|
|
732
|
+
weight: number;
|
|
733
|
+
creationTimestamp: string;
|
|
734
|
+
creationSessionID: string;
|
|
735
|
+
lastChangeTimestamp: string;
|
|
736
|
+
lastChangeSessionID: string;
|
|
737
|
+
}
|
package/package.json
CHANGED
package/src/backend/user.ts
CHANGED
|
@@ -50,6 +50,20 @@ export default (apiUrl: string) => ({
|
|
|
50
50
|
method: 'POST',
|
|
51
51
|
}) as Promise<ResponseSpec>,
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Gets the details of the currently logged in User object.
|
|
55
|
+
* @param authToken - The login token
|
|
56
|
+
* @returns The user object
|
|
57
|
+
*/
|
|
58
|
+
getCurrentUser: (authToken: string) =>
|
|
59
|
+
apiFetcher(`/User/${authToken}`, {
|
|
60
|
+
apiUrl,
|
|
61
|
+
}) as Promise<
|
|
62
|
+
ResponseSpec & {
|
|
63
|
+
user: User;
|
|
64
|
+
}
|
|
65
|
+
>,
|
|
66
|
+
|
|
53
67
|
/**
|
|
54
68
|
* Gets the details of a User object.
|
|
55
69
|
* @param authToken - The login token
|
package/src/client.test.ts
CHANGED
|
@@ -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/knownFacts api', () => {
|
|
7
6
|
it('works on knownFacts apis', async () => {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import memori from '../index';
|
|
2
|
+
|
|
3
|
+
const client = memori('https://backend.memori.ai');
|
|
4
|
+
|
|
5
|
+
describe('engine/topics api', () => {
|
|
6
|
+
it('works on topics apis', async () => {
|
|
7
|
+
expect(
|
|
8
|
+
await client.topics.getTopics('768b9654-e781-4c3c-81fa-ae1529d1bfbe')
|
|
9
|
+
).not.toBeNull();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('works on topics apis with shorthand version', async () => {
|
|
13
|
+
expect(
|
|
14
|
+
await client.getTopics('768b9654-e781-4c3c-81fa-ae1529d1bfbe')
|
|
15
|
+
).not.toBeNull();
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { ResponseSpec, MemoriUser, Topic } from '../types';
|
|
2
|
+
import { apiFetcher } from '../apiFetcher';
|
|
3
|
+
|
|
4
|
+
/****************
|
|
5
|
+
* *
|
|
6
|
+
* Topics *
|
|
7
|
+
* *
|
|
8
|
+
****************/
|
|
9
|
+
|
|
10
|
+
export default (apiUrl: string) => ({
|
|
11
|
+
/**
|
|
12
|
+
* Lists all Topic objects.
|
|
13
|
+
* @param {string} sessionId The session ID
|
|
14
|
+
*/
|
|
15
|
+
getTopics: async (sessionId: string) =>
|
|
16
|
+
apiFetcher(`/Topics/${sessionId}`, {
|
|
17
|
+
method: 'GET',
|
|
18
|
+
apiUrl,
|
|
19
|
+
}) as Promise<
|
|
20
|
+
ResponseSpec & {
|
|
21
|
+
/**
|
|
22
|
+
* Total number of MemoriUser objects.
|
|
23
|
+
*/
|
|
24
|
+
count: number;
|
|
25
|
+
/**
|
|
26
|
+
* List of MemoriUser objects. May be empty.
|
|
27
|
+
*/
|
|
28
|
+
topics: Topic[];
|
|
29
|
+
}
|
|
30
|
+
>,
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Lists Topic objects with pagination.
|
|
34
|
+
* @param {string} sessionId The session ID
|
|
35
|
+
* @param {number} from The 0-based index of the first Topics object to list
|
|
36
|
+
* @param {number} howMany The number of the Topics objects to list
|
|
37
|
+
*/
|
|
38
|
+
getTopicsPaginated: async (
|
|
39
|
+
sessionId: string,
|
|
40
|
+
from: number,
|
|
41
|
+
howMany: number
|
|
42
|
+
) =>
|
|
43
|
+
apiFetcher(`/Topics/${sessionId}/${from}/${howMany}`, {
|
|
44
|
+
method: 'GET',
|
|
45
|
+
apiUrl,
|
|
46
|
+
}) as Promise<
|
|
47
|
+
ResponseSpec & {
|
|
48
|
+
/**
|
|
49
|
+
* Total number of Topic objects.
|
|
50
|
+
*/
|
|
51
|
+
count: number;
|
|
52
|
+
/**
|
|
53
|
+
* List of Topic objects. May be empty.
|
|
54
|
+
*/
|
|
55
|
+
topics: Topic[];
|
|
56
|
+
}
|
|
57
|
+
>,
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Gets the details of a Topic object.
|
|
61
|
+
* @param {string} sessionId The session ID
|
|
62
|
+
* @param {string} topicID The Topic object ID
|
|
63
|
+
*/
|
|
64
|
+
getTopic: async (sessionId: string, topicID: string) =>
|
|
65
|
+
apiFetcher(`/Topic/${sessionId}/${topicID}`, {
|
|
66
|
+
method: 'GET',
|
|
67
|
+
apiUrl,
|
|
68
|
+
}) as Promise<
|
|
69
|
+
ResponseSpec & {
|
|
70
|
+
topic: Topic;
|
|
71
|
+
}
|
|
72
|
+
>,
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Lists all MemoriUser objects referencing a specified Topic object.
|
|
76
|
+
* @param {string} sessionId The session ID
|
|
77
|
+
* @param {string} topicId The Topic object ID
|
|
78
|
+
*/
|
|
79
|
+
getTopicUsers: async (sessionId: string, topicId: string) =>
|
|
80
|
+
apiFetcher(`/TopicUsers/${sessionId}/${topicId}`, {
|
|
81
|
+
method: 'GET',
|
|
82
|
+
apiUrl,
|
|
83
|
+
}) as Promise<
|
|
84
|
+
ResponseSpec & {
|
|
85
|
+
/**
|
|
86
|
+
* Total number of MemoriUser objects.
|
|
87
|
+
*/
|
|
88
|
+
count: number;
|
|
89
|
+
/**
|
|
90
|
+
* List of MemoriUser objects. May be empty.
|
|
91
|
+
*/
|
|
92
|
+
users: MemoriUser[];
|
|
93
|
+
}
|
|
94
|
+
>,
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Lists all MemoriUser objects referencing a specified Topic object, with pagination.
|
|
98
|
+
* @param {string} sessionId The session ID
|
|
99
|
+
* @param {string} topicId The Topic object ID
|
|
100
|
+
* @param {number} from The 0-based index of the first MemoriUser object to list
|
|
101
|
+
* @param {number} howMany The number of the MemoriUser objects to list
|
|
102
|
+
*/
|
|
103
|
+
getTopicUsersPaginated: async (
|
|
104
|
+
sessionId: string,
|
|
105
|
+
topicId: string,
|
|
106
|
+
from: number,
|
|
107
|
+
howMany: number
|
|
108
|
+
) =>
|
|
109
|
+
apiFetcher(`/TopicUsers/${sessionId}/${topicId}/${from}/${howMany}`, {
|
|
110
|
+
method: 'GET',
|
|
111
|
+
apiUrl,
|
|
112
|
+
}) as Promise<
|
|
113
|
+
ResponseSpec & {
|
|
114
|
+
/**
|
|
115
|
+
* Total number of MemoriUser objects.
|
|
116
|
+
*/
|
|
117
|
+
count: number;
|
|
118
|
+
/**
|
|
119
|
+
* List of MemoriUser objects. May be empty.
|
|
120
|
+
*/
|
|
121
|
+
users: MemoriUser[];
|
|
122
|
+
}
|
|
123
|
+
>,
|
|
124
|
+
});
|
|
@@ -2,19 +2,19 @@ import memori from '../index';
|
|
|
2
2
|
|
|
3
3
|
const client = memori('https://backend.memori.ai');
|
|
4
4
|
|
|
5
|
-
describe('engine/
|
|
6
|
-
it('works on
|
|
5
|
+
describe('engine/user api', () => {
|
|
6
|
+
it('works on user apis', async () => {
|
|
7
7
|
expect(
|
|
8
|
-
await client.
|
|
8
|
+
await client.user.getMemoriUser(
|
|
9
9
|
'768b9654-e781-4c3c-81fa-ae1529d1bfbe',
|
|
10
10
|
'be2e4a44-890b-483b-a26a-f6e122f36e2b'
|
|
11
11
|
)
|
|
12
12
|
).not.toBeNull();
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
it('works on
|
|
15
|
+
it('works on user apis with shorthand version', async () => {
|
|
16
16
|
expect(
|
|
17
|
-
await client.
|
|
17
|
+
await client.getMemoriUser(
|
|
18
18
|
'768b9654-e781-4c3c-81fa-ae1529d1bfbe',
|
|
19
19
|
'be2e4a44-890b-483b-a26a-f6e122f36e2b'
|
|
20
20
|
)
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { ResponseSpec, MemoriUser, Topic } from '../types';
|
|
2
|
+
import { apiFetcher } from '../apiFetcher';
|
|
3
|
+
|
|
4
|
+
/****************
|
|
5
|
+
* *
|
|
6
|
+
* User *
|
|
7
|
+
* *
|
|
8
|
+
****************/
|
|
9
|
+
|
|
10
|
+
export default (apiUrl: string) => ({
|
|
11
|
+
/**
|
|
12
|
+
* Lists all User objects associated with the Memori of the current session.
|
|
13
|
+
* @param {string} sessionId The session ID
|
|
14
|
+
*/
|
|
15
|
+
getMemoriUsers: async (sessionId: string) =>
|
|
16
|
+
apiFetcher(`/Users/${sessionId}`, {
|
|
17
|
+
method: 'GET',
|
|
18
|
+
apiUrl,
|
|
19
|
+
}) as Promise<
|
|
20
|
+
ResponseSpec & {
|
|
21
|
+
/**
|
|
22
|
+
* Total number of MemoriUser objects.
|
|
23
|
+
*/
|
|
24
|
+
count: number;
|
|
25
|
+
/**
|
|
26
|
+
* List of MemoriUser objects. May be empty.
|
|
27
|
+
*/
|
|
28
|
+
users: MemoriUser[];
|
|
29
|
+
}
|
|
30
|
+
>,
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Lists all MemoriUser objects associated with the Memori of the current session, with pagination.
|
|
34
|
+
* @param {string} sessionId The session ID
|
|
35
|
+
* @param {number} from The 0-based index of the first MemoriUser object to list
|
|
36
|
+
* @param {number} howMany The number of the MemoriUser objects to list
|
|
37
|
+
*/
|
|
38
|
+
getMemoriUsersPaginated: async (
|
|
39
|
+
sessionId: string,
|
|
40
|
+
from: number,
|
|
41
|
+
howMany: number
|
|
42
|
+
) =>
|
|
43
|
+
apiFetcher(`/Users/${sessionId}/${from}/${howMany}`, {
|
|
44
|
+
method: 'GET',
|
|
45
|
+
apiUrl,
|
|
46
|
+
}) as Promise<
|
|
47
|
+
ResponseSpec & {
|
|
48
|
+
/**
|
|
49
|
+
* Total number of MemoriUser objects.
|
|
50
|
+
*/
|
|
51
|
+
count: number;
|
|
52
|
+
/**
|
|
53
|
+
* List of MemoriUser objects. May be empty.
|
|
54
|
+
*/
|
|
55
|
+
users: MemoriUser[];
|
|
56
|
+
}
|
|
57
|
+
>,
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Gets the details of a User object.
|
|
61
|
+
* @param {string} sessionId The session ID
|
|
62
|
+
* @param {string} userID The User object ID
|
|
63
|
+
*/
|
|
64
|
+
getMemoriUser: async (sessionId: string, userID: string) =>
|
|
65
|
+
apiFetcher(`/User/${sessionId}/${userID}`, {
|
|
66
|
+
method: 'GET',
|
|
67
|
+
apiUrl,
|
|
68
|
+
}) as Promise<
|
|
69
|
+
ResponseSpec & {
|
|
70
|
+
user: MemoriUser;
|
|
71
|
+
}
|
|
72
|
+
>,
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Lists all Topic objects referenced by a specified MemoriUser object.
|
|
76
|
+
* @param {string} sessionId The session ID
|
|
77
|
+
* @param {string} userID The User object ID
|
|
78
|
+
*/
|
|
79
|
+
getMemoriUserTopics: async (sessionId: string, userID: string) =>
|
|
80
|
+
apiFetcher(`/UserTopics/${sessionId}/${userID}`, {
|
|
81
|
+
method: 'GET',
|
|
82
|
+
apiUrl,
|
|
83
|
+
}) as Promise<
|
|
84
|
+
ResponseSpec & {
|
|
85
|
+
/**
|
|
86
|
+
* Total number of Topic objects.
|
|
87
|
+
*/
|
|
88
|
+
count: number;
|
|
89
|
+
/**
|
|
90
|
+
* List of Topic objects. May be empty.
|
|
91
|
+
*/
|
|
92
|
+
topics: Topic[];
|
|
93
|
+
}
|
|
94
|
+
>,
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Lists all Topic objects referenced by a specified MemoriUser object, with pagination.
|
|
98
|
+
* @param {string} sessionId The session ID
|
|
99
|
+
* @param {string} userID The User object ID
|
|
100
|
+
* @param {number} from The 0-based index of the first Topics object to list
|
|
101
|
+
* @param {number} howMany The number of the Topics objects to list
|
|
102
|
+
*/
|
|
103
|
+
getMemoriUserTopicsPaginated: async (
|
|
104
|
+
sessionId: string,
|
|
105
|
+
userID: string,
|
|
106
|
+
from: number,
|
|
107
|
+
howMany: number
|
|
108
|
+
) =>
|
|
109
|
+
apiFetcher(`/UserTopics/${sessionId}/${userID}/${from}/${howMany}`, {
|
|
110
|
+
method: 'GET',
|
|
111
|
+
apiUrl,
|
|
112
|
+
}) as Promise<
|
|
113
|
+
ResponseSpec & {
|
|
114
|
+
/**
|
|
115
|
+
* Total number of Topic objects.
|
|
116
|
+
*/
|
|
117
|
+
count: number;
|
|
118
|
+
/**
|
|
119
|
+
* List of Topic objects. May be empty.
|
|
120
|
+
*/
|
|
121
|
+
topics: Topic[];
|
|
122
|
+
}
|
|
123
|
+
>,
|
|
124
|
+
});
|
package/src/engine.ts
CHANGED
|
@@ -6,7 +6,6 @@ import media from './engine/media';
|
|
|
6
6
|
import memories from './engine/memories';
|
|
7
7
|
import nlp from './engine/nlp';
|
|
8
8
|
import people from './engine/people';
|
|
9
|
-
import promptedQuestions from './engine/promptedQuestions';
|
|
10
9
|
import search from './engine/search';
|
|
11
10
|
import session from './engine/session';
|
|
12
11
|
import stats from './engine/stats';
|
|
@@ -16,6 +15,8 @@ import customDictionary from './engine/customDictionary';
|
|
|
16
15
|
import chatLogs from './engine/chatLogs';
|
|
17
16
|
import expertReferences from './engine/expertReferences';
|
|
18
17
|
import knownFacts from './engine/knownFacts';
|
|
18
|
+
import user from './engine/user';
|
|
19
|
+
import topics from './engine/topics';
|
|
19
20
|
|
|
20
21
|
export default (apiUrl: string) => ({
|
|
21
22
|
correlationPairs: correlationPairs(apiUrl),
|
|
@@ -34,8 +35,6 @@ export default (apiUrl: string) => ({
|
|
|
34
35
|
...nlp(apiUrl),
|
|
35
36
|
people: people(apiUrl),
|
|
36
37
|
...people(apiUrl),
|
|
37
|
-
promptedQuestions: promptedQuestions(apiUrl),
|
|
38
|
-
...promptedQuestions(apiUrl),
|
|
39
38
|
search: search(apiUrl),
|
|
40
39
|
...search(apiUrl),
|
|
41
40
|
session: session(apiUrl),
|
|
@@ -54,4 +53,8 @@ export default (apiUrl: string) => ({
|
|
|
54
53
|
...expertReferences(apiUrl),
|
|
55
54
|
knownFacts: knownFacts(apiUrl),
|
|
56
55
|
...knownFacts(apiUrl),
|
|
56
|
+
user: user(apiUrl),
|
|
57
|
+
...user(apiUrl),
|
|
58
|
+
topics: topics(apiUrl),
|
|
59
|
+
...topics(apiUrl),
|
|
57
60
|
});
|
package/src/helpers/asset.ts
CHANGED
|
@@ -13,14 +13,14 @@ export default (apiUrl: string) => ({
|
|
|
13
13
|
* @param {string=} params.type - wheather is the avatar or the cover
|
|
14
14
|
* @param {string=} params.resourceURI - the resource URI
|
|
15
15
|
* @param {string=} params.sessionID - the session ID, required for memory media attachments
|
|
16
|
-
* @param {string=} params.baseURL - the base URL for default static assets (defaults to https://
|
|
16
|
+
* @param {string=} params.baseURL - the base URL for default static assets (defaults to https://aisuru.com)
|
|
17
17
|
* @returns {string}
|
|
18
18
|
*/
|
|
19
19
|
getResourceUrl: ({
|
|
20
20
|
type,
|
|
21
21
|
resourceURI,
|
|
22
22
|
sessionID,
|
|
23
|
-
baseURL = 'https://
|
|
23
|
+
baseURL = 'https://aisuru.com',
|
|
24
24
|
}: ResourceURLParams): string => {
|
|
25
25
|
let defaultUri =
|
|
26
26
|
type === 'cover'
|
package/src/types.ts
CHANGED
|
@@ -65,10 +65,9 @@ export declare type Memori = {
|
|
|
65
65
|
disableR5Loop?: boolean;
|
|
66
66
|
ageRestriction?: number;
|
|
67
67
|
nsfw?: boolean;
|
|
68
|
-
enableBoardOfExperts?: boolean;
|
|
69
68
|
enableCompletions?: boolean;
|
|
70
69
|
completionDescription?: string;
|
|
71
|
-
completionProvider?: '-' | 'OpenAI';
|
|
70
|
+
completionProvider?: '-' | 'Mistral' | 'OpenAI';
|
|
72
71
|
/**
|
|
73
72
|
* Format: chiave1:valore1|chiave2:valore2|...|chiaveN:valoreN
|
|
74
73
|
*
|
|
@@ -80,10 +79,30 @@ export declare type Memori = {
|
|
|
80
79
|
*/
|
|
81
80
|
completionProviderConfig?: string;
|
|
82
81
|
enableDeepThought?: boolean;
|
|
82
|
+
enableBoardOfExperts?: boolean;
|
|
83
83
|
disableCompletionMediaExtraction?: boolean;
|
|
84
84
|
chainingMemoriID?: string;
|
|
85
85
|
chainingBaseURL?: string;
|
|
86
86
|
chainingPassword?: string;
|
|
87
|
+
/**
|
|
88
|
+
* @type {string=}
|
|
89
|
+
* User name of the optional integration with the DCM platform.
|
|
90
|
+
* If set, this Memori will be able send outcomes to the DCM platform when specific contents are emitted during the conversation.
|
|
91
|
+
* When updating, set it to a single dash character (-) to remove a previously set integration.
|
|
92
|
+
*/
|
|
93
|
+
dcmUser?: string;
|
|
94
|
+
/**
|
|
95
|
+
* @type {string=}
|
|
96
|
+
* Shared secret of the optional integration with the DCM platform.
|
|
97
|
+
* Required if DCMUser is set.
|
|
98
|
+
*/
|
|
99
|
+
dcmSecret?: string;
|
|
100
|
+
/**
|
|
101
|
+
* @type {string=}
|
|
102
|
+
* Application context of the optional integration with the DCM platform.
|
|
103
|
+
* Required if DCMUser is set.
|
|
104
|
+
*/
|
|
105
|
+
dcmAppContext?: string;
|
|
87
106
|
properties?: [{ [key: string]: string }];
|
|
88
107
|
creationTimestamp?: string;
|
|
89
108
|
lastChangeTimestamp?: string;
|
|
@@ -165,7 +184,7 @@ export declare type User = {
|
|
|
165
184
|
lastChangeTimestamp?: string;
|
|
166
185
|
referral?: string;
|
|
167
186
|
couponCode?: string;
|
|
168
|
-
defaultCompletionProvider?: '-' | 'OpenAI';
|
|
187
|
+
defaultCompletionProvider?: '-' | 'Mistral' | 'OpenAI';
|
|
169
188
|
/**
|
|
170
189
|
* Format: chiave1:valore1|chiave2:valore2|...|chiaveN:valoreN
|
|
171
190
|
*
|
|
@@ -182,6 +201,8 @@ export declare type User = {
|
|
|
182
201
|
age?: number;
|
|
183
202
|
tnCAndPPAccepted?: boolean;
|
|
184
203
|
tnCAndPPAcceptanceDate?: string;
|
|
204
|
+
pAndCUAccepted?: boolean;
|
|
205
|
+
pAndCUAcceptanceDate?: string;
|
|
185
206
|
avatarURL?: string;
|
|
186
207
|
avatar3DURL?: string;
|
|
187
208
|
avatar3DURLType?: string;
|
|
@@ -262,7 +283,6 @@ export type TenantConfig = {
|
|
|
262
283
|
name: string;
|
|
263
284
|
showNewUser: boolean;
|
|
264
285
|
requirePosition: boolean;
|
|
265
|
-
feedbackURL?: string;
|
|
266
286
|
};
|
|
267
287
|
|
|
268
288
|
export type TenantBase = {
|
|
@@ -270,6 +290,11 @@ export type TenantBase = {
|
|
|
270
290
|
name?: string;
|
|
271
291
|
description?: string;
|
|
272
292
|
logoURL?: string;
|
|
293
|
+
/**
|
|
294
|
+
* Additional Tenant names.
|
|
295
|
+
* Usually host names, e.g. app.memorytwin.com.
|
|
296
|
+
*/
|
|
297
|
+
aliases?: string[];
|
|
273
298
|
adminCount?: number;
|
|
274
299
|
userCount?: number;
|
|
275
300
|
memoriCount?: number;
|
|
@@ -282,15 +307,28 @@ export type TenantBase = {
|
|
|
282
307
|
maxFreeSessions?: number;
|
|
283
308
|
maxFreeSessionsPerUser?: number;
|
|
284
309
|
nonFreeSessionCost?: number;
|
|
310
|
+
maxImportSize?: number;
|
|
311
|
+
maxImportSizePerUser?: number;
|
|
285
312
|
maxCompletions?: number;
|
|
286
313
|
maxCompletionsPerUser?: number;
|
|
314
|
+
defaultCompletionProvider?: '-' | 'Mistral' | 'OpenAI';
|
|
315
|
+
/**
|
|
316
|
+
* Format: chiave1:valore1|chiave2:valore2|...|chiaveN:valoreN
|
|
317
|
+
*
|
|
318
|
+
* OpenAI accetta i seguenti:
|
|
319
|
+
* - APIKey è l'API key
|
|
320
|
+
* - Model è il nome del modello: gpt-3.5-turbo, gpt-4 ecc.
|
|
321
|
+
* - MaxTokens è il numero massimo di token in output
|
|
322
|
+
* - Temperature è la temperature
|
|
323
|
+
*/
|
|
324
|
+
defaultCompletionProviderConfig?: string;
|
|
287
325
|
paying?: boolean;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
326
|
+
enableUserMemoriCreation?: boolean;
|
|
327
|
+
enableBoardOfExperts?: boolean;
|
|
328
|
+
enableDCMIntegration?: boolean;
|
|
329
|
+
enableBadges?: boolean;
|
|
330
|
+
enableVirtualSpaces?: boolean;
|
|
331
|
+
enableDeepThought?: boolean;
|
|
294
332
|
creationTimestamp?: string;
|
|
295
333
|
lastChangeTimestamp?: string;
|
|
296
334
|
};
|
|
@@ -1160,3 +1198,34 @@ export interface KnownFact {
|
|
|
1160
1198
|
lastChangeTimestamp?: string;
|
|
1161
1199
|
lastChangeSessionID?: string;
|
|
1162
1200
|
}
|
|
1201
|
+
|
|
1202
|
+
export interface MemoriUser {
|
|
1203
|
+
userID: string;
|
|
1204
|
+
email: string;
|
|
1205
|
+
userName: string;
|
|
1206
|
+
tenantName: string;
|
|
1207
|
+
disableDeepThought: boolean;
|
|
1208
|
+
|
|
1209
|
+
creationTimestamp: string;
|
|
1210
|
+
creationSessionID: string;
|
|
1211
|
+
lastChangeTimestamp: string;
|
|
1212
|
+
lastChangeSessionID: string;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
export interface Topic {
|
|
1216
|
+
topicID: string;
|
|
1217
|
+
/**
|
|
1218
|
+
* Topic name.
|
|
1219
|
+
*/
|
|
1220
|
+
name: string;
|
|
1221
|
+
/**
|
|
1222
|
+
* Topic weight, i.e. the ratio between the number of times this topic has been referenced versus to
|
|
1223
|
+
total number of references.
|
|
1224
|
+
*/
|
|
1225
|
+
weight: number;
|
|
1226
|
+
|
|
1227
|
+
creationTimestamp: string;
|
|
1228
|
+
creationSessionID: string;
|
|
1229
|
+
lastChangeTimestamp: string;
|
|
1230
|
+
lastChangeSessionID: string;
|
|
1231
|
+
}
|