diff --git a/web/app/components/workflow/nodes/_base/components/output-vars.tsx b/web/app/components/workflow/nodes/_base/components/output-vars.tsx new file mode 100644 index 0000000000..b4dfadc678 --- /dev/null +++ b/web/app/components/workflow/nodes/_base/components/output-vars.tsx @@ -0,0 +1,50 @@ +'use client' +import type { FC } from 'react' +import React from 'react' +import { useTranslation } from 'react-i18next' +import cn from 'classnames' + +type Props = { + className?: string + children: JSX.Element +} + +const OutputVars: FC = ({ + className, + children, +}) => { + const { t } = useTranslation() + + return ( +
+
+ {t('workflow.nodes.common.outputVars')} +
+
+ {children} +
+
+ ) +} +type VarItemProps = { + name: string + type: string + description: string +} + +export const VarItem: FC = ({ + name, + type, + description, +}) => { + return ( +
+
+
{name}
+
{type}
+
+
{description}
+
+ ) +} +export default React.memo(OutputVars) diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-popup.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-popup.tsx index acd1ad8252..497861cdeb 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-popup.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-popup.tsx @@ -47,7 +47,7 @@ const Item: FC = ({
{itemData.variable}
-
{itemData.type}
+
{itemData.type}
{isObj && ( )} diff --git a/web/app/components/workflow/nodes/llm/panel.tsx b/web/app/components/workflow/nodes/llm/panel.tsx index 73a3b1fe3c..b39a1ee342 100644 --- a/web/app/components/workflow/nodes/llm/panel.tsx +++ b/web/app/components/workflow/nodes/llm/panel.tsx @@ -8,6 +8,7 @@ import AddButton from '@/app/components/base/button/add-button' import Split from '@/app/components/workflow/nodes/_base/components/split' import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal' import Switch from '@/app/components/base/switch' +import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' const i18nPrefix = 'workflow.nodes.llm' @@ -94,6 +95,21 @@ const Panel: FC = () => { > Functions */} + + + <> + + + + ) } diff --git a/web/i18n/lang/workflow.en.ts b/web/i18n/lang/workflow.en.ts index 0d970065c6..80dfc12847 100644 --- a/web/i18n/lang/workflow.en.ts +++ b/web/i18n/lang/workflow.en.ts @@ -1,11 +1,18 @@ const translation = { nodes: { + common: { + outputVars: 'Output Variables', + }, llm: { model: 'model', variables: 'variables', context: 'context', prompt: 'prompt', vision: 'vision', + outputVars: { + output: 'Generate content', + usage: 'Model Usage Information', + }, }, }, }