diff --git a/client/src/components/Avatar/index.tsx b/client/src/components/Avatar/index.tsx index 27f7e271e..ab45d8c0c 100644 --- a/client/src/components/Avatar/index.tsx +++ b/client/src/components/Avatar/index.tsx @@ -9,7 +9,7 @@ const Avatar = ({ w = '30px', ...props }: ImageProps) => { fallbackSrc={LOGO_ICON} fallbackStrategy={'onError'} borderRadius={'50%'} - objectFit={'contain'} + objectFit={'cover'} alt="" w={w} h={w} diff --git a/client/src/pages/api/app/modules/agent/classifyQuestion.ts b/client/src/pages/api/app/modules/agent/classifyQuestion.ts index 015865a26..eae1fb4c8 100644 --- a/client/src/pages/api/app/modules/agent/classifyQuestion.ts +++ b/client/src/pages/api/app/modules/agent/classifyQuestion.ts @@ -20,7 +20,7 @@ export type Props = { }; export type Response = { history: ChatItemType[] }; -const agentModel = 'gpt-3.5-turbo-16k'; +const agentModel = 'gpt-3.5-turbo'; const agentFunName = 'agent_user_question'; export default async function handler(req: NextApiRequest, res: NextApiResponse) { @@ -78,13 +78,13 @@ export async function classifyQuestion({ // function body const agentFunction = { name: agentFunName, - description: '判断用户问题的类型,并返回不同的值', + description: '判断用户问题的类型,并返回指定值', parameters: { type: 'object', properties: { type: { 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) } }, @@ -122,12 +122,17 @@ export async function classifyQuestion({ tokenLen: totalTokens }); - console.log( - 'CQ', - agents.findIndex((item) => item.key === arg.type) - ); + console.log(agents.map((item) => `${item.value},返回: '${item.key}'`).join(';'), arg); + + const result = agents.find((item) => item.key === arg.type); + + if (result) { + return { + [arg.type]: 1 + }; + } return { - [arg.type]: 1 + [agents[0].key]: 1 }; } diff --git a/client/src/pages/app/detail/components/edit/components/Nodes/NodeChat.tsx b/client/src/pages/app/detail/components/edit/components/Nodes/NodeChat.tsx index 5c7c1c32f..214415e55 100644 --- a/client/src/pages/app/detail/components/edit/components/Nodes/NodeChat.tsx +++ b/client/src/pages/app/detail/components/edit/components/Nodes/NodeChat.tsx @@ -43,7 +43,7 @@ const NodeChat = ({ return ( { onChangeNode({ diff --git a/client/src/pages/app/list/component/CreateModal.tsx b/client/src/pages/app/list/component/CreateModal.tsx index 6893a986a..36a834e17 100644 --- a/client/src/pages/app/list/component/CreateModal.tsx +++ b/client/src/pages/app/list/component/CreateModal.tsx @@ -113,6 +113,7 @@ const CreateModal = ({ onClose, onSuccess }: { onClose: () => void; onSuccess: ( void; onSuccess: ( /> { fontSize={['40px', '70px']} letterSpacing={'5px'} > - FastGpt + FastAI - 三分钟 + 可视化 AI 编排 - 搭建 AI 知识库 + 快速搭建 AI 问答库 diff --git a/client/src/pages/kb/detail/components/Info.tsx b/client/src/pages/kb/detail/components/Info.tsx index 2fd00c5d4..fe7208335 100644 --- a/client/src/pages/kb/detail/components/Info.tsx +++ b/client/src/pages/kb/detail/components/Info.tsx @@ -60,7 +60,7 @@ const Info = ( title: '删除成功', status: 'success' }); - router.replace(`/kb?kbId=${myKbList.find((item) => item._id !== kbId)?._id || ''}`); + router.replace(`/kb/list`); await loadKbList(); } catch (err: any) { toast({ @@ -69,7 +69,7 @@ const Info = ( }); } setBtnLoading(false); - }, [setBtnLoading, kbId, toast, router, myKbList, loadKbList]); + }, [setBtnLoading, kbId, toast, router, loadKbList]); const saveSubmitSuccess = useCallback( async (data: KbItemType) => {