Pārlūkot izejas kodu

fix: no json output vars in front-page tool (#5943)

非法操作 9 mēneši atpakaļ
vecāks
revīzija
46eca01fa3

+ 4 - 0
web/app/components/workflow/constants.ts

@@ -377,6 +377,10 @@ export const TOOL_OUTPUT_STRUCT: Var[] = [
     variable: 'files',
     type: VarType.arrayFile,
   },
+  {
+    variable: 'json',
+    type: VarType.arrayObject,
+  },
 ]
 
 export const PARAMETER_EXTRACTOR_COMMON_STRUCT: Var[] = [

+ 5 - 0
web/app/components/workflow/nodes/tool/panel.tsx

@@ -131,6 +131,11 @@ const Panel: FC<NodePanelProps<ToolNodeType>> = ({
               type='Array[File]'
               description={t(`${i18nPrefix}.outputVars.files.title`)}
             />
+            <VarItem
+              name='json'
+              type='Array[Object]'
+              description={t(`${i18nPrefix}.outputVars.json`)}
+            />
           </>
         </OutputVars>
       </div>

+ 1 - 0
web/i18n/en-US/workflow.ts

@@ -396,6 +396,7 @@ const translation = {
           url: 'Image url',
           upload_file_id: 'Upload file id',
         },
+        json: 'tool generated json',
       },
     },
     questionClassifiers: {

+ 1 - 0
web/i18n/zh-Hans/workflow.ts

@@ -396,6 +396,7 @@ const translation = {
           url: '图片链接',
           upload_file_id: '上传文件ID',
         },
+        json: '工具生成的json',
       },
     },
     questionClassifiers: {