Quellcode durchsuchen

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

tags/0.6.3
sino vor 1 Jahr
Ursprung
Commit
22994a6d14
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden
1 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen
  1. 6
    1
      web/app/components/share/text-generation/index.tsx

+ 6
- 1
web/app/components/share/text-generation/index.tsx Datei anzeigen

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

Laden…
Abbrechen
Speichern