Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions frontend/src/api/simulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,11 @@ export const getSimulationHistory = (limit = 20) => {
return service.get('/api/simulation/history', { params: { limit } })
}

/**
* 采访单个 Agent(聊天)
* @param {Object} data - { simulation_id, agent_id, prompt, platform?, timeout? }
*/
export const interviewAgent = (data) => {
return service.post('/api/simulation/interview', data)
}

27 changes: 26 additions & 1 deletion frontend/src/components/Step3Simulation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@
</div>

<div class="action-controls">
<button
<button
class="action-btn chat-btn"
:disabled="phase !== 2"
@click="router.push({ name: 'Chat', params: { simulationId: props.simulationId } })"
>
💬 Chat with Agents
</button>
<button
class="action-btn primary"
:disabled="phase !== 2 || isGeneratingReport"
@click="handleNextStep"
Expand Down Expand Up @@ -871,6 +878,14 @@ onUnmounted(() => {
align-items: center;
}

/* Action Controls */
.action-controls {
display: flex;
gap: 10px;
align-items: center;
flex-wrap: wrap;
}

/* Action Button */
.action-btn {
display: inline-flex;
Expand All @@ -896,6 +911,16 @@ onUnmounted(() => {
background: #333;
}

.action-btn.chat-btn {
background: #fff;
color: #000;
border: 1.5px solid #000;
}

.action-btn.chat-btn:hover:not(:disabled) {
background: #f5f5f5;
}

.action-btn:disabled {
opacity: 0.3;
cursor: not-allowed;
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import SimulationView from '../views/SimulationView.vue'
import SimulationRunView from '../views/SimulationRunView.vue'
import ReportView from '../views/ReportView.vue'
import InteractionView from '../views/InteractionView.vue'
import ChatView from '../views/ChatView.vue'

const routes = [
{
Expand Down Expand Up @@ -41,6 +42,12 @@ const routes = [
name: 'Interaction',
component: InteractionView,
props: true
},
{
path: '/chat/:simulationId',
name: 'Chat',
component: ChatView,
props: true
}
]

Expand Down
Loading