From 5e1f1445d45c2a75428c796a5ac68323214ac3a5 Mon Sep 17 00:00:00 2001 From: Mayur Virendra Date: Thu, 11 Apr 2024 12:53:20 +0530 Subject: [PATCH] Fixed linting issues --- services/AI.js | 2 +- tests/apis/agent.test.js | 4 ++-- tests/unit/services/ai.test.js | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/services/AI.js b/services/AI.js index 390a254..d07641e 100644 --- a/services/AI.js +++ b/services/AI.js @@ -215,7 +215,7 @@ class AI { {"role": "system", "content": `User profile : ${JSON.stringify(session.profile)}`}, ...last_action_context, {"role": "system", "content": `Following is the conversation history`}, - ...session?.text?.slice(-3), + ...session?.text?.slice(-3) || [], { "role": "user", "content": instruction } ] diff --git a/tests/apis/agent.test.js b/tests/apis/agent.test.js index 9c1f546..959c467 100644 --- a/tests/apis/agent.test.js +++ b/tests/apis/agent.test.js @@ -130,8 +130,8 @@ describe('Test cases for trip planning workflow', ()=>{ }) }) -describe.only('Test cases for booking collection', ()=>{ - it.only('Should make the hotel bookings', async ()=>{ +describe.skip('Test cases for booking collection', ()=>{ + it('Should make the hotel bookings', async ()=>{ const chats = [ "Hey Alfred, you up? ", diff --git a/tests/unit/services/ai.test.js b/tests/unit/services/ai.test.js index bac0372..af40990 100644 --- a/tests/unit/services/ai.test.js +++ b/tests/unit/services/ai.test.js @@ -5,7 +5,6 @@ import { readFileSync } from 'fs'; import { EMPTY_SESSION } from '../../../config/constants.js'; const ai = new AI(); const on_search = JSON.parse(readFileSync('./tests/data/api_responses/on_search.json')) -const on_search_compressed = JSON.parse(readFileSync('./tests/data/api_responses/on_search_compressed.json')) const on_select = JSON.parse(readFileSync('./tests/data/api_responses/on_select.json')) const on_init = JSON.parse(readFileSync('./tests/data/api_responses/on_init.json')) const on_confirm = JSON.parse(readFileSync('./tests/data/api_responses/on_confirm.json'))