|
@@ -2,7 +2,7 @@
|
|
|
<div class="debug-page">
|
|
<div class="debug-page">
|
|
|
<div class="page-title">报告智能体单步调试</div>
|
|
<div class="page-title">报告智能体单步调试</div>
|
|
|
<el-alert
|
|
<el-alert
|
|
|
- title="该工具仅发起临时智能体调用,不会写入或覆盖正式报告的阶段状态、输入、输出和产物。"
|
|
|
|
|
|
|
+ title="每一步输入会优先使用本调试会话上一步的结果自动组装,仍可在发送前修改。临时调用不会覆盖正式报告数据。"
|
|
|
type="warning"
|
|
type="warning"
|
|
|
:closable="false"
|
|
:closable="false"
|
|
|
show-icon
|
|
show-icon
|
|
@@ -48,8 +48,14 @@
|
|
|
|
|
|
|
|
<el-alert v-if="stage.inputError" class="input-error" type="error" :closable="false" :title="`当前输入组装失败:${stage.inputError}`" />
|
|
<el-alert v-if="stage.inputError" class="input-error" type="error" :closable="false" :title="`当前输入组装失败:${stage.inputError}`" />
|
|
|
<el-collapse>
|
|
<el-collapse>
|
|
|
- <el-collapse-item title="本次将发送的输入" name="current-input">
|
|
|
|
|
- <pre v-if="stage.currentInput">{{ pretty(stage.currentInput) }}</pre>
|
|
|
|
|
|
|
+ <el-collapse-item title="本次将发送的输入(可编辑)" name="current-input">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-if="stage.currentInput"
|
|
|
|
|
+ v-model="inputDrafts[stage.stageNo]"
|
|
|
|
|
+ type="textarea"
|
|
|
|
|
+ :autosize="{ minRows: 12, maxRows: 22 }"
|
|
|
|
|
+ class="json-editor"
|
|
|
|
|
+ />
|
|
|
<span v-else class="empty">当前阶段没有可组装的智能体输入。</span>
|
|
<span v-else class="empty">当前阶段没有可组装的智能体输入。</span>
|
|
|
</el-collapse-item>
|
|
</el-collapse-item>
|
|
|
<el-collapse-item title="正式流程已保存的输入快照" name="saved-input">
|
|
<el-collapse-item title="正式流程已保存的输入快照" name="saved-input">
|
|
@@ -96,7 +102,8 @@ export default {
|
|
|
detail: null,
|
|
detail: null,
|
|
|
job: null,
|
|
job: null,
|
|
|
runningStageNo: null,
|
|
runningStageNo: null,
|
|
|
- pollTimer: null
|
|
|
|
|
|
|
+ pollTimer: null,
|
|
|
|
|
+ inputDrafts: {}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -131,6 +138,10 @@ export default {
|
|
|
const response = await getReportPipelineDebug(this.reportId)
|
|
const response = await getReportPipelineDebug(this.reportId)
|
|
|
if (!response || response.code !== 0) return this.showError(response && response.msg)
|
|
if (!response || response.code !== 0) return this.showError(response && response.msg)
|
|
|
this.detail = response.data
|
|
this.detail = response.data
|
|
|
|
|
+ this.inputDrafts = {}
|
|
|
|
|
+ this.detail.stages.forEach(stage => {
|
|
|
|
|
+ if (stage.currentInput) this.$set(this.inputDrafts, stage.stageNo, this.pretty(stage.currentInput.payload))
|
|
|
|
|
+ })
|
|
|
} finally {
|
|
} finally {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
}
|
|
}
|
|
@@ -139,7 +150,18 @@ export default {
|
|
|
this.clearPoll()
|
|
this.clearPoll()
|
|
|
this.runningStageNo = stage.stageNo
|
|
this.runningStageNo = stage.stageNo
|
|
|
try {
|
|
try {
|
|
|
- const response = await startReportPipelineDebugStage(this.detail.reportId, stage.stageNo)
|
|
|
|
|
|
|
+ let payload
|
|
|
|
|
+ try {
|
|
|
|
|
+ payload = JSON.parse(this.inputDrafts[stage.stageNo])
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ this.runningStageNo = null
|
|
|
|
|
+ return this.showError('输入必须是合法的 JSON 对象')
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!payload || Array.isArray(payload) || typeof payload !== 'object') {
|
|
|
|
|
+ this.runningStageNo = null
|
|
|
|
|
+ return this.showError('输入必须是 JSON 对象')
|
|
|
|
|
+ }
|
|
|
|
|
+ const response = await startReportPipelineDebugStage(this.detail.reportId, stage.stageNo, payload)
|
|
|
if (!response || response.code !== 0) {
|
|
if (!response || response.code !== 0) {
|
|
|
this.runningStageNo = null
|
|
this.runningStageNo = null
|
|
|
return this.showError(response && response.msg)
|
|
return this.showError(response && response.msg)
|
|
@@ -190,6 +212,7 @@ export default {
|
|
|
.agent-key { margin-left: 12px; color: #909399; font-size: 13px; }
|
|
.agent-key { margin-left: 12px; color: #909399; font-size: 13px; }
|
|
|
.input-error { margin: 14px 0; }
|
|
.input-error { margin: 14px 0; }
|
|
|
pre { margin: 0; padding: 14px; max-height: 420px; overflow: auto; background: #1e293b; color: #e2e8f0; border-radius: 4px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
|
|
pre { margin: 0; padding: 14px; max-height: 420px; overflow: auto; background: #1e293b; color: #e2e8f0; border-radius: 4px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
|
|
|
|
|
+.json-editor ::v-deep textarea { min-height: 280px !important; font-family: Consolas, Monaco, monospace; line-height: 1.5; }
|
|
|
.empty { color: #909399; }
|
|
.empty { color: #909399; }
|
|
|
.job-card p { font-size: 13px; color: #606266; word-break: break-all; }
|
|
.job-card p { font-size: 13px; color: #606266; word-break: break-all; }
|
|
|
</style>
|
|
</style>
|