Parcourir la source

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

tags/0.6.3
sino il y a 1 an
Parent
révision
22994a6d14
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6
    1
      web/app/components/share/text-generation/index.tsx

+ 6
- 1
web/app/components/share/text-generation/index.tsx Voir le fichier

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

Chargement…
Annuler
Enregistrer