mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-13 21:21:08 +00:00
Merge branch 'feat/dev-0.6-web' into dbgpts_hub_dev
This commit is contained in:
@@ -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<string>('');
|
||||
const [isFocus, setIsFocus] = useState<boolean>(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,
|
||||
}),
|
||||
|
@@ -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<Array<IFlow>>([]);
|
||||
@@ -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,
|
||||
|
Reference in New Issue
Block a user