fix: stringify object while exporting batch result to csv (#3481)

This commit is contained in:
sino 2024-04-15 15:49:53 +08:00 committed by GitHub
parent 58cbda2950
commit 22994a6d14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -174,7 +174,12 @@ const TextGeneration: FC<IMainProps> = ({
promptConfig?.prompt_variables.forEach((v) => {
res[v.name] = inputs[v.key]
})
res[t('share.generation.completionResult')] = batchCompletionResLatest[task.id]
let result = batchCompletionResLatest[task.id]
// task might return multiple fields, should marshal object to string
if (typeof batchCompletionResLatest[task.id] === 'object')
result = JSON.stringify(result)
res[t('share.generation.completionResult')] = result
return res
})
const checkBatchInputs = (data: string[][]) => {