Skip to content

Commit

Permalink
chore: remove stats apis that has been removed from engine
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Sep 25, 2024
1 parent 95bcf01 commit 3dce1b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 46 deletions.
6 changes: 4 additions & 2 deletions src/engine/stats.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ 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.getTextQualityIndexes(
'768b9654-e781-4c3c-81fa-ae1529d1bfbe'
)
).not.toBeNull();
});

it('works on statistics apis with shorthand version', async () => {
expect(
await client.getStatistics('768b9654-e781-4c3c-81fa-ae1529d1bfbe')
await client.getTextQualityIndexes('768b9654-e781-4c3c-81fa-ae1529d1bfbe')
).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 3dce1b7

Please sign in to comment.