Skip to content
Merged
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
5 changes: 4 additions & 1 deletion ui/src/views/home/components/ranking/RankingDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ onMounted(() => loadRanking())
<MkDateRange :default-value="{ startTime: initialRange.start_time, endTime: initialRange.end_time }" @change="handleRangeChange" />
</div>
<!-- 导出当前筛选下的完整排行榜 -->
<el-button plain :loading="exporting" :disabled="loading" @click="handleExport">导出</el-button>
<el-button plain :loading="exporting" :disabled="loading" @click="handleExport">
<MkIcon name="icon_export_outlined" />
<span>导出</span>
</el-button>
</div>

<MkTable v-loading="loading" v-model:pagination-config="pagination" :data="records" @current-change="loadRanking" @size-change="handleSearch">
Expand Down
36 changes: 19 additions & 17 deletions ui/src/views/workflow/tool/debug/ResultDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ interface ResumeParameters {
formData?: Record<string, unknown>
position?: unknown
chunkId?: string
chatRecordId?:string

chatRecordId?: string
}
const props = defineProps<{ toolId: string }>()
const running = defineModel<boolean>('running', { default: false })
Expand Down Expand Up @@ -70,14 +69,10 @@ async function execute(extra: Record<string, unknown> = {}) {
}
if (!response.body) throw new Error('未收到调试响应')
let streamError: unknown
stream = new ConversationStream(
response,
receiveChunk,
(error?: unknown) => {
if (error) streamError = error
running.value = false
},
)
stream = new ConversationStream(response, receiveChunk, (error?: unknown) => {
if (error) streamError = error
running.value = false
})
await stream.start()
if (!visible.value) return
if (streamError) throw streamError
Expand All @@ -90,14 +85,13 @@ async function execute(extra: Record<string, unknown> = {}) {
}
} finally {
stream = undefined

}
}

// 表单节点沿用同一条执行记录续跑,复用现有回复组件的 sendMessage 协议。
provide('sendMessage', (options: ResumeParameters) => {
if (running.value || !visible.value) return
return execute({ 'form_data':options.formData,'chat_record_id':options.chatRecordId, 'chunk_id':options.chunkId,position: options.position })
return execute({ form_data: options.formData, chat_record_id: options.chatRecordId, chunk_id: options.chunkId, position: options.position })
})

function open(parameters: Record<string, unknown>) {
Expand Down Expand Up @@ -136,21 +130,29 @@ defineExpose({ open, close })
<h4 class="mk-title-decoration mb-4 mt-4">回复内容</h4>

<!-- // TODO: 回复内容 -->
<el-card>
<el-card class="small whitespace-pre-wrap" shadow="never">
<ContentList :content-list="blocks" />
<div v-if="running">回答中...</div>
</el-card>

<template v-if="record">
<h4 class="mk-title-decoration my-4">输出参数</h4>
<el-alert :title="record.state === 'SUCCESS' ? '运行成功' : '运行失败'"
:type="record.state === 'SUCCESS' ? 'success' : 'error'" :closable="false" show-icon class="mb-4" />
<pre class="mk-gray-card whitespace-pre-wrap break-all">{{ output }}</pre>
<el-alert
:title="record.state === 'SUCCESS' ? '运行成功' : '运行失败'"
:type="record.state === 'SUCCESS' ? 'success' : 'error'"
:closable="false"
show-icon
class="mb-4"
/>
<p class="my-4">输出</p>
<el-card class="small whitespace-pre-wrap" shadow="never" :class="{ 'border-danger': record.state !== 'SUCCESS' }">
{{ output }}
</el-card>
</template>
</el-tab-pane>
<el-tab-pane label="执行详情" name="details">
<!-- TODO 执行详情 -->
<ExecutionDetailContent :detail="executionDetails" :workflow-mode="WorkflowMode.Tool"></ExecutionDetailContent>
<ExecutionDetailContent :detail="executionDetails" :workflow-mode="WorkflowMode.Tool"></ExecutionDetailContent>
</el-tab-pane>
</el-tabs>
</MkDrawer>
Expand Down
Loading