Skip to content

Commit

Permalink
chore: remove stats and content quality apis
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Sep 10, 2024
1 parent f81285b commit aafe761
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 58 deletions.
12 changes: 0 additions & 12 deletions src/backend/memori.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,4 @@ export default (apiUrl: string) => ({
body: memori,
method: 'POST',
}) as Promise<ResponseSpec>,

/**
* Signals that the content of a Memori object has been updated.
* Consequently, a run of the Content Quality Job will be scheduled as soon as possible.
* @param {string} authToken - The login token
* @param {string} memoriID - The ID of the Memori object
*/
memoriContentUpdated: (authToken: string, memoriID: string) =>
apiFetcher(`/MemoriContentUpdated/${authToken}/${memoriID}`, {
apiUrl,
method: 'POST',
}) as Promise<ResponseSpec>,
});
12 changes: 10 additions & 2 deletions src/engine/stats.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@ const client = memori('https://backend.memori.ai');
describe('engine/stats api', () => {
it('works on statistics apis', async () => {
expect(
await client.stats.getStatistics('768b9654-e781-4c3c-81fa-ae1529d1bfbe')
await client.stats.getEventLogs(
'768b9654-e781-4c3c-81fa-ae1529d1bfbe',
'2021-01-01T00:00:00.000Z',
'2021-01-02T00:00:00.000Z'
)
).not.toBeNull();
});

it('works on statistics apis with shorthand version', async () => {
expect(
await client.getStatistics('768b9654-e781-4c3c-81fa-ae1529d1bfbe')
await client.getEventLogs(
'768b9654-e781-4c3c-81fa-ae1529d1bfbe',
'2021-01-01T00:00:00.000Z',
'2021-01-02T00:00:00.000Z'
)
).not.toBeNull();
});
});
44 changes: 0 additions & 44 deletions src/engine/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,6 @@ import { apiFetcher } from '../apiFetcher';
*****************/

export default (apiUrl: string) => ({
/**
* Computes usage statistics for the Memori of the current session.
* @param {string} sessionId The session ID
*/
getStatistics: async (sessionId: string) =>
apiFetcher(`/Statistics/${sessionId}`, {
method: 'GET',
apiUrl,
}) as Promise<
ResponseSpec & {
statistics: Stats;
}
>,

/**
* Computes content quality indexes for a Memori.
* @param {string} memoriID - The Memori object ID
*/
getContentQualityIndexes: async (memoriID: string) =>
apiFetcher(`/ContentQualityIndexes/${memoriID}`, {
method: 'GET',
apiUrl,
}) as Promise<
ResponseSpec & {
/**
* @type {number}
* An index of content quality of this Memori. The more content is added (and especially content with media, or stories with dates and places) the more the index grows.
*/
contentQualityIndex: number;

/**
* @type {number}
* An index of answer quality of this Memori. It is the ratio of the number of successful answer vs. the total of answers (successful, wrongful or missing).
*/
answerQualityIndex: number;

/**
* @type {number}
* The current number of unanswered questions.
*/
unansweredQuestions: number;
}
>,

/**
* Computes text quality indexes for a Memori.
* @param {string} sessionId - The session ID
Expand Down

0 comments on commit aafe761

Please sign in to comment.