diff --git a/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx b/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx index eb0f524386..51fa0c173d 100644 --- a/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx +++ b/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx @@ -27,6 +27,7 @@ import { PROMPT_EDITOR_UPDATE_VALUE_BY_EVENT_EMITTER } from '@/app/components/ba import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' import { useFeaturesStore } from '@/app/components/base/features/hooks' import { noop } from 'lodash-es' +import { GeneratorType } from '../config/automatic/types' export type ISimplePromptInput = { mode: AppType @@ -276,6 +277,8 @@ const Prompt: FC = ({ isShow={showAutomatic} onClose={showAutomaticFalse} onFinished={handleAutomaticRes} + isBasicMode + generatorType={GeneratorType.prompt} /> )} 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 aacaa81ac2..c8f801663a 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 @@ -39,13 +39,20 @@ import { ModelTypeEnum } from '@/app/components/header/account-setting/model-pro import { useModelListAndDefaultModelAndCurrentProviderAndModel } from '@/app/components/header/account-setting/model-provider-page/hooks' import type { ModelModeType } from '@/types/app' import type { FormValue } from '@/app/components/header/account-setting/model-provider-page/declarations' +import InstructionEditor from './instruction-editor' +import type { Node, NodeOutPutVar } from '@/app/components/workflow/types' +import type { GeneratorType } from './types' +import { ArrowDownRoundFill } from '@/app/components/base/icons/src/vender/solid/general' export type IGetAutomaticResProps = { mode: AppType isShow: boolean onClose: () => void onFinished: (res: AutomaticRes) => void - isInLLMNode?: boolean + nodesOutputVars?: NodeOutPutVar[] + availableNodes?: Node[] + generatorType: GeneratorType + isBasicMode?: boolean } const TryLabel: FC<{ @@ -68,7 +75,10 @@ const GetAutomaticRes: FC = ({ mode, isShow, onClose, - isInLLMNode, + nodesOutputVars, + availableNodes, + generatorType, + isBasicMode, onFinished, }) => { const { t } = useTranslation() @@ -124,6 +134,11 @@ const GetAutomaticRes: FC = ({ ] const [instruction, setInstruction] = useState('') + const [ideaOutput, setIdeaOutput] = useState('') + const [isFoldIdeaOutput, { + toggle: toggleFoldIdeaOutput, + }] = useBoolean(true) + const handleChooseTemplate = useCallback((key: string) => { return () => { const template = t(`appDebug.generate.template.${key}.instruction`) @@ -210,7 +225,6 @@ const GetAutomaticRes: FC = ({ const { error, ...res } = await generateRule({ instruction, model_config: model, - no_variable: !!isInLLMNode, }) setRes(res) if (error) { @@ -240,11 +254,11 @@ const GetAutomaticRes: FC = ({ >
-
+
{t('appDebug.generate.title')}
{t('appDebug.generate.description')}
-
+
= ({ hideDebugWithMultipleModel />
-
-
-
{t('appDebug.generate.tryIt')}
-
-
-
- {tryList.map(item => ( - - ))} + {isBasicMode && ( +
+
+
{t('appDebug.generate.tryIt')}
+
+
+
+ {tryList.map(item => ( + + ))} +
-
+ )} + {/* inputs */} -
-
-
{t('appDebug.generate.instruction')}
-