feat(data-process): 增加可配置思维链生成

This commit is contained in:
caoxiaozhu
2026-07-27 14:41:38 +08:00
parent 97cdb5cc68
commit f97245b814
12 changed files with 224 additions and 29 deletions

View File

@@ -71,6 +71,7 @@ const configLabelMap: Record<string, string> = {
generation_model_id: '数据生成模型',
generation_prompt: '生成提示语',
output_type: '输出类型',
reasoning_detail: '推理详细程度',
temperature: '生成温度',
max_tokens: '最大输出长度',
json_mode: 'JSON 输出',
@@ -225,15 +226,19 @@ const durationText = computed(() => {
return minutes ? `${minutes}${restSeconds}` : `${restSeconds}`
})
const configRows = computed(() => Object.entries(detail.value?.config || {})
.filter(([key]) => (
key !== 'generation_model_snapshot'
&& !/(?:password|secret|token|api_key)/i.test(key)
))
.map(([key, value]) => ({
label: configLabelMap[key] || key.split('_').join(' '),
value: formatConfigValue(key, value),
})))
const configRows = computed(() => {
const config = detail.value?.config || {}
return Object.entries(config)
.filter(([key]) => (
key !== 'generation_model_snapshot'
&& (key !== 'reasoning_detail' || config.output_type === 'reasoning')
&& !/(?:password|secret|token|api_key)/i.test(key)
))
.map(([key, value]) => ({
label: configLabelMap[key] || key.split('_').join(' '),
value: formatConfigValue(key, value),
}))
})
function formatConfigValue(key: string, value: unknown) {
if (key === 'generation_model_id') {
@@ -249,6 +254,9 @@ function formatConfigValue(key: string, value: unknown) {
if (key === 'output_type') {
return value === 'reasoning' ? '思维链回答' : '标准回答'
}
if (key === 'reasoning_detail') {
return value === 'detailed' ? '详细推理' : '普通推理'
}
if (key === 'dataset_split' && value && typeof value === 'object') {
const split = value as Partial<DataProcessDatasetSplit>
return `训练集 ${split.train ?? 0}% / 验证集 ${split.validation ?? 0}% / 测试集 ${split.test ?? 0}%`