@memori.ai/memori-api-client 2.6.2 → 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 +20 -0
- package/README.md +7 -12
- package/dist/backend/importExport.test.js +1 -1
- package/dist/backend/importExport.test.js.map +1 -1
- 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.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/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 +106 -12
- package/dist/engine.js +9 -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 +112 -12
- package/dist/types.d.ts +48 -10
- package/esm/backend/importExport.test.js +1 -1
- package/esm/backend/importExport.test.js.map +1 -1
- 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.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/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 +106 -12
- package/esm/engine.js +9 -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 +112 -12
- package/esm/types.d.ts +48 -10
- package/package.json +1 -1
- package/src/backend/importExport.test.ts +1 -1
- package/src/backend/user.ts +14 -0
- package/src/client.test.ts +1 -1
- package/src/engine/knownFacts.test.ts +19 -0
- package/src/engine/knownFacts.ts +84 -0
- package/src/engine/search.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 +9 -3
- package/src/helpers/asset.ts +2 -2
- package/src/types.ts +102 -10
- package/src/engine/promptedQuestions.ts +0 -63
|
@@ -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';
|
|
@@ -15,6 +14,9 @@ import contextVars from './engine/contextVars';
|
|
|
15
14
|
import customDictionary from './engine/customDictionary';
|
|
16
15
|
import chatLogs from './engine/chatLogs';
|
|
17
16
|
import expertReferences from './engine/expertReferences';
|
|
17
|
+
import knownFacts from './engine/knownFacts';
|
|
18
|
+
import user from './engine/user';
|
|
19
|
+
import topics from './engine/topics';
|
|
18
20
|
|
|
19
21
|
export default (apiUrl: string) => ({
|
|
20
22
|
correlationPairs: correlationPairs(apiUrl),
|
|
@@ -33,8 +35,6 @@ export default (apiUrl: string) => ({
|
|
|
33
35
|
...nlp(apiUrl),
|
|
34
36
|
people: people(apiUrl),
|
|
35
37
|
...people(apiUrl),
|
|
36
|
-
promptedQuestions: promptedQuestions(apiUrl),
|
|
37
|
-
...promptedQuestions(apiUrl),
|
|
38
38
|
search: search(apiUrl),
|
|
39
39
|
...search(apiUrl),
|
|
40
40
|
session: session(apiUrl),
|
|
@@ -51,4 +51,10 @@ export default (apiUrl: string) => ({
|
|
|
51
51
|
...chatLogs(apiUrl),
|
|
52
52
|
expertReferences: expertReferences(apiUrl),
|
|
53
53
|
...expertReferences(apiUrl),
|
|
54
|
+
knownFacts: knownFacts(apiUrl),
|
|
55
|
+
...knownFacts(apiUrl),
|
|
56
|
+
user: user(apiUrl),
|
|
57
|
+
...user(apiUrl),
|
|
58
|
+
topics: topics(apiUrl),
|
|
59
|
+
...topics(apiUrl),
|
|
54
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
|
};
|
|
@@ -1137,3 +1175,57 @@ export interface ExpertReference {
|
|
|
1137
1175
|
lastChangeTimestamp?: string;
|
|
1138
1176
|
lastChangeSessionID?: string;
|
|
1139
1177
|
}
|
|
1178
|
+
|
|
1179
|
+
export interface KnownFact {
|
|
1180
|
+
/**
|
|
1181
|
+
* Known Fact object ID.
|
|
1182
|
+
* @type {string}
|
|
1183
|
+
*/
|
|
1184
|
+
knownFactID: string;
|
|
1185
|
+
/**
|
|
1186
|
+
* Known Fact type, e.g. ShortTerm or LongTerm.
|
|
1187
|
+
* Currently possible values are:
|
|
1188
|
+
* - ShortTerm: this Known Fact is always used during conversations
|
|
1189
|
+
* - LongTerm: this Known Fact is used during conversations only if relevant to the current question
|
|
1190
|
+
*/
|
|
1191
|
+
knownFactType: 'ShortTerm' | 'LongTerm';
|
|
1192
|
+
/**
|
|
1193
|
+
* Text of the Known Fact.
|
|
1194
|
+
*/
|
|
1195
|
+
text: string;
|
|
1196
|
+
creationTimestamp?: string;
|
|
1197
|
+
creationSessionID?: string;
|
|
1198
|
+
lastChangeTimestamp?: string;
|
|
1199
|
+
lastChangeSessionID?: string;
|
|
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
|
+
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { ResponseSpec } from '../types';
|
|
2
|
-
import { apiFetcher } from '../apiFetcher';
|
|
3
|
-
|
|
4
|
-
/*****************************
|
|
5
|
-
* *
|
|
6
|
-
* PromptedQuestions *
|
|
7
|
-
* *
|
|
8
|
-
*****************************/
|
|
9
|
-
|
|
10
|
-
export default (apiUrl: string) => ({
|
|
11
|
-
/**
|
|
12
|
-
* Lists all Prompted Question objects.
|
|
13
|
-
* @param {string} sessionId The session ID
|
|
14
|
-
*/
|
|
15
|
-
getPromptedQuestions: async (sessionId: string) =>
|
|
16
|
-
apiFetcher(`/PromptedQuestions/${sessionId}`, {
|
|
17
|
-
method: 'GET',
|
|
18
|
-
apiUrl,
|
|
19
|
-
}) as Promise<ResponseSpec>,
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Gets the details of a Prompted Question object.
|
|
23
|
-
* @param {string} sessionId The session ID
|
|
24
|
-
* @param {string} promptId The Prompted Question object ID
|
|
25
|
-
*/
|
|
26
|
-
getPromptedQuestion: async (sessionId: string, promptId: string) =>
|
|
27
|
-
apiFetcher(`/PromptedQuestion/${sessionId}/${promptId}`, {
|
|
28
|
-
method: 'GET',
|
|
29
|
-
apiUrl,
|
|
30
|
-
}) as Promise<ResponseSpec>,
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Updates an existing Prompted Question object.
|
|
34
|
-
* @param {string} sessionId The session ID
|
|
35
|
-
* @param {string} promptId The Prompted Question object ID
|
|
36
|
-
*/
|
|
37
|
-
patchPromptedQuestion: async (sessionId: string, promptId: string) =>
|
|
38
|
-
apiFetcher(`/PromptedQuestion/${sessionId}/${promptId}`, {
|
|
39
|
-
method: 'GET',
|
|
40
|
-
apiUrl,
|
|
41
|
-
}) as Promise<ResponseSpec>,
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Removes an existing Prompted Question object.
|
|
45
|
-
* @param {string} sessionId The session ID
|
|
46
|
-
* @param {string} promptId The Prompted Question object ID
|
|
47
|
-
*/
|
|
48
|
-
deletePromptedQuestion: async (sessionId: string, promptId: string) =>
|
|
49
|
-
apiFetcher(`/PromptedQuestion/${sessionId}/${promptId}`, {
|
|
50
|
-
method: 'GET',
|
|
51
|
-
apiUrl,
|
|
52
|
-
}) as Promise<ResponseSpec>,
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Adds a new Prompted Question object.
|
|
56
|
-
* @param {string} sessionId The session ID
|
|
57
|
-
*/
|
|
58
|
-
postPromptedQuestion: async (sessionId: string) =>
|
|
59
|
-
apiFetcher(`/PromptedQuestion/${sessionId}`, {
|
|
60
|
-
method: 'GET',
|
|
61
|
-
apiUrl,
|
|
62
|
-
}) as Promise<ResponseSpec>,
|
|
63
|
-
});
|