From 70922a3525f2098ea71aa9bdff1fd9dbd7989ccb Mon Sep 17 00:00:00 2001 From: 666ghj <670939375@qq.com> Date: Tue, 16 Dec 2025 17:50:43 +0800 Subject: [PATCH] Implement interaction features in Step5Interaction component and add routing for interaction view - Introduced the Step5Interaction component for user interaction with report agents and simulation profiles. - Added chat functionality to communicate with report agents and selected simulation agents. - Implemented a survey feature to gather responses from multiple agents. - Enhanced routing by adding a new InteractionView for seamless navigation to the interaction interface. - Updated the router configuration to include the new interaction route. - Improved UI elements and styles for better user experience in the interaction process. --- frontend/src/api/report.js | 8 + frontend/src/api/simulation.js | 8 + frontend/src/components/Step4Report.vue | 49 + frontend/src/components/Step5Interaction.vue | 1917 ++++++++++++++++++ frontend/src/router/index.js | 7 + frontend/src/views/InteractionView.vue | 350 ++++ 6 files changed, 2339 insertions(+) create mode 100644 frontend/src/components/Step5Interaction.vue create mode 100644 frontend/src/views/InteractionView.vue diff --git a/frontend/src/api/report.js b/frontend/src/api/report.js index e4eefa2..c89a67d 100644 --- a/frontend/src/api/report.js +++ b/frontend/src/api/report.js @@ -41,3 +41,11 @@ export const getConsoleLog = (reportId, fromLine = 0) => { export const getReport = (reportId) => { return service.get(`/api/report/${reportId}`) } + +/** + * 与 Report Agent 对话 + * @param {Object} data - { simulation_id, message, chat_history? } + */ +export const chatWithReport = (data) => { + return requestWithRetry(() => service.post('/api/report/chat', data), 3, 1000) +} diff --git a/frontend/src/api/simulation.js b/frontend/src/api/simulation.js index 33efca0..96404c6 100644 --- a/frontend/src/api/simulation.js +++ b/frontend/src/api/simulation.js @@ -168,3 +168,11 @@ export const getEnvStatus = (data) => { return service.post('/api/simulation/env-status', data) } +/** + * 批量采访 Agent + * @param {Object} data - { simulation_id, interviews: [{ agent_id, prompt }] } + */ +export const interviewAgents = (data) => { + return requestWithRetry(() => service.post('/api/simulation/interview/batch', data), 3, 1000) +} + diff --git a/frontend/src/components/Step4Report.vue b/frontend/src/components/Step4Report.vue index 9bb3017..eadbd13 100644 --- a/frontend/src/components/Step4Report.vue +++ b/frontend/src/components/Step4Report.vue @@ -126,6 +126,15 @@ + + +
@@ -383,8 +392,11 @@ + + diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 7616224..62d2320 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -4,6 +4,7 @@ import Process from '../views/MainView.vue' import SimulationView from '../views/SimulationView.vue' import SimulationRunView from '../views/SimulationRunView.vue' import ReportView from '../views/ReportView.vue' +import InteractionView from '../views/InteractionView.vue' const routes = [ { @@ -34,6 +35,12 @@ const routes = [ name: 'Report', component: ReportView, props: true + }, + { + path: '/interaction/:reportId', + name: 'Interaction', + component: InteractionView, + props: true } ] diff --git a/frontend/src/views/InteractionView.vue b/frontend/src/views/InteractionView.vue new file mode 100644 index 0000000..1dc27f5 --- /dev/null +++ b/frontend/src/views/InteractionView.vue @@ -0,0 +1,350 @@ + + + + +