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'))