mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-27 08:25:07 +00:00
fix: ui
This commit is contained in:
@@ -9,7 +9,7 @@ const Avatar = ({ w = '30px', ...props }: ImageProps) => {
|
|||||||
fallbackSrc={LOGO_ICON}
|
fallbackSrc={LOGO_ICON}
|
||||||
fallbackStrategy={'onError'}
|
fallbackStrategy={'onError'}
|
||||||
borderRadius={'50%'}
|
borderRadius={'50%'}
|
||||||
objectFit={'contain'}
|
objectFit={'cover'}
|
||||||
alt=""
|
alt=""
|
||||||
w={w}
|
w={w}
|
||||||
h={w}
|
h={w}
|
||||||
|
@@ -20,7 +20,7 @@ export type Props = {
|
|||||||
};
|
};
|
||||||
export type Response = { history: ChatItemType[] };
|
export type Response = { history: ChatItemType[] };
|
||||||
|
|
||||||
const agentModel = 'gpt-3.5-turbo-16k';
|
const agentModel = 'gpt-3.5-turbo';
|
||||||
const agentFunName = 'agent_user_question';
|
const agentFunName = 'agent_user_question';
|
||||||
|
|
||||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||||
@@ -78,13 +78,13 @@ export async function classifyQuestion({
|
|||||||
// function body
|
// function body
|
||||||
const agentFunction = {
|
const agentFunction = {
|
||||||
name: agentFunName,
|
name: agentFunName,
|
||||||
description: '判断用户问题的类型,并返回不同的值',
|
description: '判断用户问题的类型,并返回指定值',
|
||||||
parameters: {
|
parameters: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
properties: {
|
properties: {
|
||||||
type: {
|
type: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: agents.map((item) => `${item.value},返回: '${item.key}'`).join('\n'),
|
description: agents.map((item) => `${item.value},返回:'${item.key}'`).join(';'),
|
||||||
enum: agents.map((item) => item.key)
|
enum: agents.map((item) => item.key)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -122,12 +122,17 @@ export async function classifyQuestion({
|
|||||||
tokenLen: totalTokens
|
tokenLen: totalTokens
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(
|
console.log(agents.map((item) => `${item.value},返回: '${item.key}'`).join(';'), arg);
|
||||||
'CQ',
|
|
||||||
agents.findIndex((item) => item.key === arg.type)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
const result = agents.find((item) => item.key === arg.type);
|
||||||
|
|
||||||
|
if (result) {
|
||||||
return {
|
return {
|
||||||
[arg.type]: 1
|
[arg.type]: 1
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
[agents[0].key]: 1
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@@ -43,7 +43,7 @@ const NodeChat = ({
|
|||||||
return (
|
return (
|
||||||
<MySelect
|
<MySelect
|
||||||
width={'100%'}
|
width={'100%'}
|
||||||
value={inputItem.value}
|
value={inputItem.value || chatModelList[0]?.model}
|
||||||
list={list}
|
list={list}
|
||||||
onchange={(e) => {
|
onchange={(e) => {
|
||||||
onChangeNode({
|
onChangeNode({
|
||||||
|
@@ -113,6 +113,7 @@ const CreateModal = ({ onClose, onSuccess }: { onClose: () => void; onSuccess: (
|
|||||||
<Flex mt={3} alignItems={'center'}>
|
<Flex mt={3} alignItems={'center'}>
|
||||||
<MyTooltip label={'点击设置头像'}>
|
<MyTooltip label={'点击设置头像'}>
|
||||||
<Avatar
|
<Avatar
|
||||||
|
flexShrink={0}
|
||||||
src={getValues('avatar')}
|
src={getValues('avatar')}
|
||||||
w={['32px', '36px']}
|
w={['32px', '36px']}
|
||||||
h={['32px', '36px']}
|
h={['32px', '36px']}
|
||||||
@@ -122,6 +123,7 @@ const CreateModal = ({ onClose, onSuccess }: { onClose: () => void; onSuccess: (
|
|||||||
/>
|
/>
|
||||||
</MyTooltip>
|
</MyTooltip>
|
||||||
<Input
|
<Input
|
||||||
|
flex={1}
|
||||||
ml={4}
|
ml={4}
|
||||||
autoFocus
|
autoFocus
|
||||||
bg={'myWhite.600'}
|
bg={'myWhite.600'}
|
||||||
|
@@ -169,13 +169,13 @@ const Home = () => {
|
|||||||
fontSize={['40px', '70px']}
|
fontSize={['40px', '70px']}
|
||||||
letterSpacing={'5px'}
|
letterSpacing={'5px'}
|
||||||
>
|
>
|
||||||
FastGpt
|
FastAI
|
||||||
</Box>
|
</Box>
|
||||||
<Box className={styles.textlg} fontWeight={'bold'} fontSize={['30px', '50px']}>
|
<Box className={styles.textlg} fontWeight={'bold'} fontSize={['30px', '50px']}>
|
||||||
三分钟
|
可视化 AI 编排
|
||||||
</Box>
|
</Box>
|
||||||
<Box className={styles.textlg} fontWeight={'bold'} fontSize={['30px', '50px']}>
|
<Box className={styles.textlg} fontWeight={'bold'} fontSize={['30px', '50px']}>
|
||||||
搭建 AI 知识库
|
快速搭建 AI 问答库
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Flex flexDirection={['column', 'row']} my={5}>
|
<Flex flexDirection={['column', 'row']} my={5}>
|
||||||
|
@@ -60,7 +60,7 @@ const Info = (
|
|||||||
title: '删除成功',
|
title: '删除成功',
|
||||||
status: 'success'
|
status: 'success'
|
||||||
});
|
});
|
||||||
router.replace(`/kb?kbId=${myKbList.find((item) => item._id !== kbId)?._id || ''}`);
|
router.replace(`/kb/list`);
|
||||||
await loadKbList();
|
await loadKbList();
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
toast({
|
toast({
|
||||||
@@ -69,7 +69,7 @@ const Info = (
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
setBtnLoading(false);
|
setBtnLoading(false);
|
||||||
}, [setBtnLoading, kbId, toast, router, myKbList, loadKbList]);
|
}, [setBtnLoading, kbId, toast, router, loadKbList]);
|
||||||
|
|
||||||
const saveSubmitSuccess = useCallback(
|
const saveSubmitSuccess = useCallback(
|
||||||
async (data: KbItemType) => {
|
async (data: KbItemType) => {
|
||||||
|
Reference in New Issue
Block a user