diff --git a/web/app/components/app/configuration/debug/debug-with-multiple-model/chat-item.tsx b/web/app/components/app/configuration/debug/debug-with-multiple-model/chat-item.tsx index c1afd89fbb..36d7f89d9f 100644 --- a/web/app/components/app/configuration/debug/debug-with-multiple-model/chat-item.tsx +++ b/web/app/components/app/configuration/debug/debug-with-multiple-model/chat-item.tsx @@ -28,6 +28,7 @@ import Avatar from '@/app/components/base/avatar' import { useAppContext } from '@/context/app-context' import { ModelFeatureEnum } from '@/app/components/header/account-setting/model-provider-page/declarations' import { useFeatures } from '@/app/components/base/features/hooks' +import type { InputForm } from '@/app/components/base/chat/chat/type' type ChatItemProps = { modelAndParameter: ModelAndParameter @@ -60,6 +61,7 @@ const ChatItem: FC = ({ annotation_reply: features.annotationReply, } as ChatConfig }, [configTemplate, features]) + const inputsForm = modelConfig.configs.prompt_variables.filter(item => item.type !== 'api').map(item => ({ ...item, label: item.name, variable: item.key })) as InputForm[] const { chatList, chatListRef, @@ -71,7 +73,7 @@ const ChatItem: FC = ({ config, { inputs, - promptVariables: modelConfig.configs.prompt_variables, + inputsForm, }, [], taskId => stopChatMessageResponding(appId, taskId), diff --git a/web/app/components/app/configuration/debug/debug-with-multiple-model/index.tsx b/web/app/components/app/configuration/debug/debug-with-multiple-model/index.tsx index 2b6d2fffcf..d5662cb49c 100644 --- a/web/app/components/app/configuration/debug/debug-with-multiple-model/index.tsx +++ b/web/app/components/app/configuration/debug/debug-with-multiple-model/index.tsx @@ -13,23 +13,29 @@ import { import type { DebugWithMultipleModelContextType } from './context' import { useEventEmitterContextContext } from '@/context/event-emitter' import ChatInputArea from '@/app/components/base/chat/chat/chat-input-area' -import type { VisionFile } from '@/app/components/base/chat/types' import { useDebugConfigurationContext } from '@/context/debug-configuration' import { useFeatures } from '@/app/components/base/features/hooks' import { useStore as useAppStore } from '@/app/components/app/store' +import type { FileEntity } from '@/app/components/base/file-uploader/types' +import type { InputForm } from '@/app/components/base/chat/chat/type' const DebugWithMultipleModel = () => { - const { mode } = useDebugConfigurationContext() + const { + mode, + inputs, + modelConfig, + } = useDebugConfigurationContext() const speech2text = useFeatures(s => s.features.speech2text) const file = useFeatures(s => s.features.file) const { multipleModelConfigs, checkCanSend, } = useDebugWithMultipleModelContext() + const { eventEmitter } = useEventEmitterContextContext() const isChatMode = mode === 'chat' || mode === 'agent-chat' - const handleSend = useCallback((message: string, files?: VisionFile[]) => { + const handleSend = useCallback((message: string, files?: FileEntity[]) => { if (checkCanSend && !checkCanSend()) return @@ -93,6 +99,7 @@ const DebugWithMultipleModel = () => { }, [twoLine, threeLine, fourLine]) const setShowAppConfigureFeaturesModal = useAppStore(s => s.setShowAppConfigureFeaturesModal) + const inputsForm = modelConfig.configs.prompt_variables.filter(item => item.type !== 'api').map(item => ({ ...item, label: item.name, variable: item.key })) as InputForm[] return (
@@ -132,6 +139,8 @@ const DebugWithMultipleModel = () => { onSend={handleSend} speechToTextConfig={speech2text as any} visionConfig={file} + inputs={inputs} + inputsForm={inputsForm} />
)} diff --git a/web/app/components/app/configuration/debug/debug-with-single-model/index.tsx b/web/app/components/app/configuration/debug/debug-with-single-model/index.tsx index d4ad92518d..906a2032e5 100644 --- a/web/app/components/app/configuration/debug/debug-with-single-model/index.tsx +++ b/web/app/components/app/configuration/debug/debug-with-single-model/index.tsx @@ -25,6 +25,7 @@ import { ModelFeatureEnum } from '@/app/components/header/account-setting/model- import { useStore as useAppStore } from '@/app/components/app/store' import { useFeatures } from '@/app/components/base/features/hooks' import { getLastAnswer } from '@/app/components/base/chat/utils' +import type { InputForm } from '@/app/components/base/chat/chat/type' type DebugWithSingleModelProps = { checkCanSend?: () => boolean @@ -62,6 +63,7 @@ const DebugWithSingleModel = forwardRef item.type !== 'api').map(item => ({ ...item, label: item.name, variable: item.key })) as InputForm[] const { chatList, chatListRef, @@ -78,7 +80,7 @@ const DebugWithSingleModel = forwardRef stopChatMessageResponding(appId, taskId), @@ -166,6 +168,8 @@ const DebugWithSingleModel = forwardRef