diff --git a/packages/global/core/app/utils.ts b/packages/global/core/app/utils.ts index e841941c4..7dbfc146d 100644 --- a/packages/global/core/app/utils.ts +++ b/packages/global/core/app/utils.ts @@ -46,7 +46,7 @@ export const appWorkflow2Form = ({ chatConfig }: { nodes: StoreNodeItemType[]; - chatConfig: AppChatConfigType; + chatConfig?: AppChatConfigType; }) => { const defaultAppForm = getDefaultAppForm(); const findInputValueByKey = (inputs: FlowNodeInputItemType[], key: string) => { @@ -172,6 +172,10 @@ export const appWorkflow2Form = ({ } }); + if (chatConfig) { + defaultAppForm.chatConfig = chatConfig; + } + return defaultAppForm; }; diff --git a/projects/app/src/components/core/chat/ChatContainer/ChatBox/Input/ChatInput.tsx b/projects/app/src/components/core/chat/ChatContainer/ChatBox/Input/ChatInput.tsx index 5bdd38225..ec606930d 100644 --- a/projects/app/src/components/core/chat/ChatContainer/ChatBox/Input/ChatInput.tsx +++ b/projects/app/src/components/core/chat/ChatContainer/ChatBox/Input/ChatInput.tsx @@ -281,7 +281,7 @@ const ChatInput = ({ [ File, TextareaDom, - fileList, + fileList.length, handleSend, hasFileUploading, havInput, @@ -296,7 +296,8 @@ const ChatInput = ({ setValue, showSelectFile, showSelectImg, - t + t, + whisperConfig?.open ] ); diff --git a/projects/app/src/components/core/chat/ChatContainer/ChatBox/Input/GateChatInput.tsx b/projects/app/src/components/core/chat/ChatContainer/ChatBox/Input/GateChatInput.tsx index a81e2c6a3..c17af2895 100644 --- a/projects/app/src/components/core/chat/ChatContainer/ChatBox/Input/GateChatInput.tsx +++ b/projects/app/src/components/core/chat/ChatContainer/ChatBox/Input/GateChatInput.tsx @@ -83,7 +83,6 @@ const GateChatInput = ({ const selectedTools = externalSelectedToolIds ?? []; const setSelectedToolIds = onSelectTools!; - const { appDetail } = useContextSelector(AppContext, (v) => v); const { llmModelList } = useSystemStore(); const modelList = useMemo( () => llmModelList.map((item) => ({ label: item.name, value: item.model })), @@ -101,36 +100,6 @@ const GateChatInput = ({ return router.pathname === '/chat/gate'; }, [router.pathname]); - // 初始化加载appForm - 从Gate应用获取配置 - useEffect(() => { - if (!appId || !showTools) return; - - const fetchAppForm = async () => { - try { - // 加载Gate应用列表 - // 获取当前应用或第一个可用的Gate应用 - const currentApp = appDetail; - - if (currentApp && currentApp.modules) { - // 将模块转换为appForm格式 - const form = appWorkflow2Form({ - nodes: currentApp.modules, - chatConfig: currentApp.chatConfig || {} - }); - setAppForm(form); - // 如果选择了模型,设置为默认模型 - if (form.aiSettings.model) { - setSelectedModel(form.aiSettings.model); - } - } - } catch (error) { - console.error('加载Gate应用信息失败:', error); - } - }; - - fetchAppForm(); - }, [appId, showTools, appDetail, setAppForm]); - // 当模型选择变化时更新appForm useEffect(() => { if (!showTools) return; @@ -230,15 +199,6 @@ const GateChatInput = ({ - {/* voice input and loading container */} - {!inputValue && ( - - )} -