diff --git a/web/new-components/chat/input/ChatInputPanel.tsx b/web/new-components/chat/input/ChatInputPanel.tsx index 9687e1656..e658c94eb 100644 --- a/web/new-components/chat/input/ChatInputPanel.tsx +++ b/web/new-components/chat/input/ChatInputPanel.tsx @@ -15,6 +15,7 @@ const ChatInputPanel: React.FC<{ ctrl: AbortController }> = ({ ctrl }) => { const searchParams = useSearchParams(); const scene = searchParams?.get('scene') ?? ''; + const select_param = searchParams?.get('select_param') ?? ''; const [userInput, setUserInput] = useState(''); const [isFocus, setIsFocus] = useState(false); @@ -36,8 +37,9 @@ const ChatInputPanel: React.FC<{ ctrl: AbortController }> = ({ ctrl }) => { setUserInput(''); }, 0); await handleChat(userInput, { - app_code: appInfo.app_code, + app_code: appInfo.app_code || '', ...(paramKey.includes('temperature') && { temperature: temperatureValue }), + select_param, ...(paramKey.includes('resource') && { select_param: typeof resourceValue === 'string' ? resourceValue : JSON.stringify(resourceValue) || currentDialogue.select_param, }), diff --git a/web/pages/construct/flow/index.tsx b/web/pages/construct/flow/index.tsx index 46ccd168f..94afed14b 100644 --- a/web/pages/construct/flow/index.tsx +++ b/web/pages/construct/flow/index.tsx @@ -17,7 +17,7 @@ import { useTranslation } from 'react-i18next'; function Flow() { const router = useRouter(); - const { model } = useContext(ChatContext); + const { model, currentDialogInfo, setCurrentDialogInfo } = useContext(ChatContext); const [messageApi, contextHolder] = message.useMessage(); const [flowList, setFlowList] = useState>([]); @@ -114,6 +114,10 @@ function Flow() { const handleChat = async (flow: IFlow) => { const [, res] = await apiInterceptors(newDialogue({ chat_mode: 'chat_agent' })); if (res) { + setCurrentDialogInfo?.({ + ...currentDialogInfo, + app_code: '', + }); const queryStr = qs.stringify({ scene: 'chat_flow', id: res.conv_uid,