浏览代码

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

tags/0.6.3
sino 1年前
父节点
当前提交
22994a6d14
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6
    1
      web/app/components/share/text-generation/index.tsx

+ 6
- 1
web/app/components/share/text-generation/index.tsx 查看文件

@@ -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[][]) => {

正在加载...
取消
保存