From 9c852fae9bc553b6e27c6979d1da95892124a6ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9EBAS8243=E2=80=9C?= <gerd.embruch@uni-hamburg.de> Date: Mon, 5 Aug 2024 11:44:23 +0200 Subject: [PATCH] fixed output --- __tests__/auth/confirmpasswordreset.test.js | 4 ++-- utils/handleAI.js | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/__tests__/auth/confirmpasswordreset.test.js b/__tests__/auth/confirmpasswordreset.test.js index bc46af2..03b7467 100644 --- a/__tests__/auth/confirmpasswordreset.test.js +++ b/__tests__/auth/confirmpasswordreset.test.js @@ -98,7 +98,7 @@ describe('user confirm password reset', () => { .send(input); }); it('should return a proper status code', () => { - expect(response.status).toBe(403); + expect(response.status).toBe(498); }); it('should respond with a proper body', () => { expect(response.body).toMatchSnapshot(); @@ -117,7 +117,7 @@ describe('user confirm password reset', () => { .send(input); }); it('should return a proper status code', () => { - expect(response.status).toBe(403); + expect(response.status).toBe(498); }); it('should respond with a proper body', () => { expect(response.body).toMatchSnapshot(); diff --git a/utils/handleAI.js b/utils/handleAI.js index b04c72e..dde2c62 100644 --- a/utils/handleAI.js +++ b/utils/handleAI.js @@ -65,7 +65,8 @@ export const aiInstallModel = async (model) => { */ export const aiDeleteModel = async (model) => { try { - return await ollama.delete({ model }); + const message = await ollama.delete({ model }); + return { message: `model ${model} deleted` }; } catch (error) { throw error; } @@ -186,6 +187,8 @@ export const chat = async (req, res, next) => { const reliesOnDoc = await isFactual(req.body.model, result.answer, result.context[0].pageContent); let sourceLocation; + + console.log("🚀 ~ chat ~ reliesOnDoc.content.toLowerCase():", reliesOnDoc.content.toLowerCase()); if (reliesOnDoc.content.toLowerCase() === 'true') { const file = path.posix.basename(result.context[0].metadata.source); const posFrom = result.context[0].metadata.loc.lines.from; @@ -208,6 +211,8 @@ export const chat = async (req, res, next) => { + + /** ******************************************************* * CREATE AI SUMMARIZED TEXT */ -- GitLab