From c16c67dac57f3b49ad729fafe0e3cf924f983788 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Mon, 19 Feb 2024 11:29:47 +0800 Subject: [PATCH] Fix assistant failed cases because of change of ml-commons (#1110) * feat: change matching prompt string Signed-off-by: SuZhou-Joe * feat: add file Signed-off-by: SuZhou-Joe * fix: traces update Signed-off-by: SuZhou-Joe * fix: traces update Signed-off-by: SuZhou-Joe * fix: traces update Signed-off-by: SuZhou-Joe --------- Signed-off-by: SuZhou-Joe (cherry picked from commit 60e250355beeeee8ee909d5567685dc41ff074c5) --- .github/workflows/assistant-release-e2e-workflow.yml | 1 + .../dashboards-assistant/chatbot_interaction_trace_spec.js | 6 +++--- cypress/support/assistant-dummy-llm.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/assistant-release-e2e-workflow.yml b/.github/workflows/assistant-release-e2e-workflow.yml index d17d60889..2e35615a2 100644 --- a/.github/workflows/assistant-release-e2e-workflow.yml +++ b/.github/workflows/assistant-release-e2e-workflow.yml @@ -14,6 +14,7 @@ jobs: filters: | tests: - 'cypress/**/dashboards-assistant/**' + - 'cypress/support/assistant-dummy-llm.js' tests-with-security: needs: changes diff --git a/cypress/integration/plugins/dashboards-assistant/chatbot_interaction_trace_spec.js b/cypress/integration/plugins/dashboards-assistant/chatbot_interaction_trace_spec.js index 3b11bb8da..9294fe275 100644 --- a/cypress/integration/plugins/dashboards-assistant/chatbot_interaction_trace_spec.js +++ b/cypress/integration/plugins/dashboards-assistant/chatbot_interaction_trace_spec.js @@ -69,16 +69,16 @@ if (Cypress.env('DASHBOARDS_ASSISTANT_ENABLED')) { it('tools invocation displayed in trace steps', () => { // trace cy.get(`.llm-chat-flyout .llm-chat-flyout-body`).as('tracePage'); - cy.get('@tracePage').find('.euiAccordion').should('have.length', 1); + cy.get('@tracePage').find('.euiAccordion').should('have.length', 3); cy.get('@tracePage') .find('.euiAccordion') // tool name - .contains('Step 1 - CatIndexTool') + .contains('Step 2 - CatIndexTool') .click({ force: true }); // tool output - cy.contains('Output: health status index'); + cy.contains('row,health,status,index'); }); it('trace page display correctly in fullscreen mode', () => { diff --git a/cypress/support/assistant-dummy-llm.js b/cypress/support/assistant-dummy-llm.js index 930f6b223..b317d8192 100644 --- a/cypress/support/assistant-dummy-llm.js +++ b/cypress/support/assistant-dummy-llm.js @@ -10,7 +10,7 @@ const suggestionJson = require('../fixtures/plugins/dashboards-assistant/suggest const MATCH_AGENT_FRAMEWORK_PROMPT = 'Assistant is designed to be able to assist with a wide range of tasks'; const MATCH_SUGGESTION_PROMPT = 'You are an AI that only speaks JSON'; -const TOOL_RESPONSE = 'TOOL RESPONSE:'; +const TOOL_RESPONSE = 'TOOL RESPONSE of CatIndexTool:'; const server = http.createServer((req, res) => { // Set the content type to JSON