mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-13 13:10:29 +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 searchParams = useSearchParams();
|
||||||
const scene = searchParams?.get('scene') ?? '';
|
const scene = searchParams?.get('scene') ?? '';
|
||||||
|
const select_param = searchParams?.get('select_param') ?? '';
|
||||||
|
|
||||||
const [userInput, setUserInput] = useState<string>('');
|
const [userInput, setUserInput] = useState<string>('');
|
||||||
const [isFocus, setIsFocus] = useState<boolean>(false);
|
const [isFocus, setIsFocus] = useState<boolean>(false);
|
||||||
@@ -36,8 +37,9 @@ const ChatInputPanel: React.FC<{ ctrl: AbortController }> = ({ ctrl }) => {
|
|||||||
setUserInput('');
|
setUserInput('');
|
||||||
}, 0);
|
}, 0);
|
||||||
await handleChat(userInput, {
|
await handleChat(userInput, {
|
||||||
app_code: appInfo.app_code,
|
app_code: appInfo.app_code || '',
|
||||||
...(paramKey.includes('temperature') && { temperature: temperatureValue }),
|
...(paramKey.includes('temperature') && { temperature: temperatureValue }),
|
||||||
|
select_param,
|
||||||
...(paramKey.includes('resource') && {
|
...(paramKey.includes('resource') && {
|
||||||
select_param: typeof resourceValue === 'string' ? resourceValue : JSON.stringify(resourceValue) || currentDialogue.select_param,
|
select_param: typeof resourceValue === 'string' ? resourceValue : JSON.stringify(resourceValue) || currentDialogue.select_param,
|
||||||
}),
|
}),
|
||||||
|
@@ -17,7 +17,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
|
|
||||||
function Flow() {
|
function Flow() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { model } = useContext(ChatContext);
|
const { model, currentDialogInfo, setCurrentDialogInfo } = useContext(ChatContext);
|
||||||
const [messageApi, contextHolder] = message.useMessage();
|
const [messageApi, contextHolder] = message.useMessage();
|
||||||
|
|
||||||
const [flowList, setFlowList] = useState<Array<IFlow>>([]);
|
const [flowList, setFlowList] = useState<Array<IFlow>>([]);
|
||||||
@@ -114,6 +114,10 @@ function Flow() {
|
|||||||
const handleChat = async (flow: IFlow) => {
|
const handleChat = async (flow: IFlow) => {
|
||||||
const [, res] = await apiInterceptors(newDialogue({ chat_mode: 'chat_agent' }));
|
const [, res] = await apiInterceptors(newDialogue({ chat_mode: 'chat_agent' }));
|
||||||
if (res) {
|
if (res) {
|
||||||
|
setCurrentDialogInfo?.({
|
||||||
|
...currentDialogInfo,
|
||||||
|
app_code: '',
|
||||||
|
});
|
||||||
const queryStr = qs.stringify({
|
const queryStr = qs.stringify({
|
||||||
scene: 'chat_flow',
|
scene: 'chat_flow',
|
||||||
id: res.conv_uid,
|
id: res.conv_uid,
|
||||||
|
Reference in New Issue
Block a user