diff --git a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx index 606e1da703..c18300ecfd 100644 --- a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx +++ b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx @@ -357,6 +357,8 @@ const GetAutomaticRes: FC = ({
= ({ + value, + nodeId, +}) => { + const { t } = useTranslation() + const { + availableVars, + availableNodes, + } = useAvailableVarList(nodeId, { + onlyLeafNodeVar: false, + filterVar: _payload => true, + }) + return ( + Type.string, + workflowNodesMap: availableNodes.reduce((acc, node) => { + acc[node.id] = { + title: node.data.title, + type: node.data.type, + width: node.width, + height: node.height, + position: node.position, + } + if (node.data.type === BlockEnum.Start) { + acc.sys = { + title: t('workflow.blocks.start'), + type: BlockEnum.Start, + } + } + return acc + }, {} as any), + }} + > + + ) +} +export default React.memo(PromptResInWorkflow) diff --git a/web/app/components/app/configuration/config/automatic/prompt-res.tsx b/web/app/components/app/configuration/config/automatic/prompt-res.tsx new file mode 100644 index 0000000000..86728bb2bc --- /dev/null +++ b/web/app/components/app/configuration/config/automatic/prompt-res.tsx @@ -0,0 +1,25 @@ +'use client' +import PromptEditor from '@/app/components/base/prompt-editor' +import type { WorkflowVariableBlockType } from '@/app/components/base/prompt-editor/types' +import type { FC } from 'react' +import React from 'react' + +type Props = { + value: string + workflowVariableBlock: WorkflowVariableBlockType +} + +const PromptRes: FC = ({ + value, + workflowVariableBlock, +}) => { + return ( + + ) +} +export default React.memo(PromptRes) diff --git a/web/app/components/app/configuration/config/automatic/result.tsx b/web/app/components/app/configuration/config/automatic/result.tsx index db2c2f8e1e..de51fc1cc4 100644 --- a/web/app/components/app/configuration/config/automatic/result.tsx +++ b/web/app/components/app/configuration/config/automatic/result.tsx @@ -11,8 +11,12 @@ import { RiClipboardLine } from '@remixicon/react' import copy from 'copy-to-clipboard' import Toast from '@/app/components/base/toast' import CodeEditor from '@/app/components/workflow/nodes/llm/components/json-schema-config-modal/code-editor' +import PromptRes from './prompt-res' +import PromptResInWorkflow from './prompt-res-in-workflow' type Props = { + isBasicMode?: boolean + nodeId?: string current: GenRes currentVersionIndex: number setCurrentVersionIndex: (index: number) => void @@ -22,6 +26,8 @@ type Props = { } const Result: FC = ({ + isBasicMode, + nodeId, current, currentVersionIndex, setCurrentVersionIndex, @@ -62,9 +68,17 @@ const Result: FC = ({ }
{isGeneratorPrompt ? ( -
- {current?.modified} -
+ isBasicMode ? ( + + ) : () ) : (