Skip to content

Commit

Permalink
v4.6.1 (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu authored Nov 20, 2023
1 parent 9c4eabf commit 0558379
Show file tree
Hide file tree
Showing 26 changed files with 568 additions and 494 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p align="center">
<a href="./README_en.md">English</a> |
<a href="./README.md">简体中文</a> |
<a href="./README_ja.md">日本語</a>
<a href="./README_ja.md">日语</a>
</p>

FastGPT 是一个基于 LLM 大语言模型的知识库问答系统,提供开箱即用的数据处理、模型调用等能力。同时可以通过 Flow 可视化进行工作流编排,从而实现复杂的问答场景!
Expand Down
2 changes: 1 addition & 1 deletion README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p align="center">
<a href="./README_en.md">English</a> |
<a href="./README.md">简体中文</a> |
<a href="./README_ja.md">日本語</a>
<a href="./README_ja.md">日语</a>
</p>

FastGPT is a knowledge-based Q&A system built on the LLM, offers out-of-the-box data processing and model invocation capabilities, allows for workflow orchestration through Flow visualization!
Expand Down
2 changes: 1 addition & 1 deletion README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p align="center">
<a href="./README_en.md">English</a> |
<a href="./README.md">简体中文</a> |
<a href="./README_ja.md">日本語</a>
<a href="./README_ja.md">日语</a>
</p>

FastGPT は、LLM 上 に 構築 された 知識 ベースの Q&A システムで、すぐに 使 えるデータ 処理 とモデル 呼 び 出 し 機能 を 提供 し、Flow の 可視化 を 通 じてワークフローのオーケストレーションを 可能 にします!
Expand Down
2 changes: 1 addition & 1 deletion docSite/content/docs/installation/upgrading/43.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: '升级到 V4.3'
title: '升级到 V4.3(需要初始化)'
description: 'FastGPT 从旧版本升级到 V4.3 操作指南'
icon: 'upgrade'
draft: false
Expand Down
2 changes: 1 addition & 1 deletion docSite/content/docs/installation/upgrading/44.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: '升级到 V4.4'
title: '升级到 V4.4(需要初始化)'
description: 'FastGPT 从旧版本升级到 V4.4 操作指南'
icon: 'upgrade'
draft: false
Expand Down
2 changes: 1 addition & 1 deletion docSite/content/docs/installation/upgrading/441.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: '升级到 V4.4.1'
title: '升级到 V4.4.1(需要初始化)'
description: 'FastGPT 从旧版本升级到 V4.4.1 操作指南'
icon: 'upgrade'
draft: false
Expand Down
2 changes: 1 addition & 1 deletion docSite/content/docs/installation/upgrading/442.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: '升级到 V4.4.2'
title: '升级到 V4.4.2(需要初始化)'
description: 'FastGPT 从旧版本升级到 V4.4.2 操作指南'
icon: 'upgrade'
draft: false
Expand Down
4 changes: 2 additions & 2 deletions docSite/content/docs/installation/upgrading/445.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 'V4.4.5'
description: 'FastGPT V4.4.5 更新(需执行升级脚本)'
title: 'V4.4.5(需要初始化)'
description: 'FastGPT V4.4.5 更新'
icon: 'upgrade'
draft: false
toc: true
Expand Down
5 changes: 4 additions & 1 deletion projects/app/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@
"Drag Tip": "Click and move",
"Move Success": "Move Success",
"No Folder": "There's no subdirectory. Just put it here",
"Root Path": "Root Folder"
"Root Path": "Root Folder",
"empty": "There is nothing to choose from in this directory"
},
"input": {
"Repeat Value": "Repeat Value"
Expand Down Expand Up @@ -237,6 +238,7 @@
"Record": "Speech",
"Restart": "Restart",
"Select File": "Select file",
"Select Image": "Select Image",
"Send Message": "Send Message",
"Speaking": "I'm listening...",
"Stop Speak": "Stop Speak",
Expand Down Expand Up @@ -286,6 +288,7 @@
"My Dataset": "My Dataset",
"Queue Desc": "This data refers to the current amount of training for the entire system. FastGPT uses queued training, and if you have too much data to train, you may need to wait for a while",
"Select Dataset": "Select Dataset",
"Select Dataset Tips": "Select only knowledge bases with the same index model",
"Select Folder": "Enter folder",
"System Data Queue": "Data Queue",
"Training Name": "Dataset Training",
Expand Down
5 changes: 4 additions & 1 deletion projects/app/public/locales/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@
"Drag Tip": "点我可拖动",
"Move Success": "移动成功",
"No Folder": "没有子目录了,就放这里吧",
"Root Path": "根目录"
"Root Path": "根目录",
"empty": "这个目录已经没东西可选了~"
},
"input": {
"Repeat Value": "有重复的值"
Expand Down Expand Up @@ -237,6 +238,7 @@
"Record": "语音输入",
"Restart": "重开对话",
"Select File": "选择文件",
"Select Image": "选择图片",
"Send Message": "发送",
"Speaking": "我在听,请说...",
"Stop Speak": "停止录音",
Expand Down Expand Up @@ -286,6 +288,7 @@
"My Dataset": "我的知识库",
"Queue Desc": "该数据是指整个系统当前待训练的数量。{{title}} 采用排队训练的方式,如果待训练的数据过多,可能需要等待一段时间",
"Select Dataset": "选择该知识库",
"Select Dataset Tips": "仅能选择同一个索引模型的知识库",
"Select Folder": "进入文件夹",
"System Data Queue": "排队长度",
"Training Name": "数据训练",
Expand Down
5 changes: 3 additions & 2 deletions projects/app/src/components/ChatBox/MessageInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ ${images.map((img) => JSON.stringify({ src: img.src })).join('\n')}
boxShadow={isSpeaking ? `0 0 10px rgba(54,111,255,0.4)` : `0 0 10px rgba(0,0,0,0.2)`}
borderRadius={['none', 'md']}
bg={'white'}
overflow={'hidden'}
{...(isPc
? {
border: '1px solid',
Expand Down Expand Up @@ -289,8 +290,8 @@ ${images.map((img) => JSON.stringify({ src: img.src })).join('\n')}
onOpenSelectFile();
}}
>
<MyTooltip label={t('core.chat.Select File')}>
<MyIcon name={'core/chat/fileSelect'} />
<MyTooltip label={t('core.chat.Select Image')}>
<MyIcon name={'core/chat/fileSelect'} w={'18px'} color={'myGray.600'} />
</MyTooltip>
<File onSelect={onSelectFile} />
</Flex>
Expand Down
4 changes: 2 additions & 2 deletions projects/app/src/components/ChatBox/QuoteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ const QuoteModal = ({
isCentered
minW={['90vw', '600px']}
title={
<>
<Box>
知识库引用({rawSearch.length}条)
<Box fontSize={'10px'} color={'myGray.500'} fontWeight={'normal'}>
注意: 修改知识库内容成功后,此处不会显示变更情况。点击编辑后,会显示知识库最新的内容。
</Box>
</>
</Box>
}
>
<ModalBody pt={0} whiteSpace={'pre-wrap'} textAlign={'justify'} wordBreak={'break-all'}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const SelectMarkCollection = ({
isOpen
paths={paths}
onClose={onClose}
parentId={parentId}
setParentId={setParentId}
tips={t('chat.Select Mark Kb Desc')}
>
Expand Down
1 change: 0 additions & 1 deletion projects/app/src/components/Icon/icons/common/pause.svg

This file was deleted.

1 change: 0 additions & 1 deletion projects/app/src/components/Icon/icons/light/app.svg

This file was deleted.

4 changes: 0 additions & 4 deletions projects/app/src/components/Icon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import type { IconProps } from '@chakra-ui/react';
import { Icon } from '@chakra-ui/react';

const iconPaths = {
appFill: () => import('./icons/fill/app.svg'),
appLight: () => import('./icons/light/app.svg'),
copy: () => import('./icons/copy.svg'),
chatSend: () => import('./icons/chatSend.svg'),
delete: () => import('./icons/delete.svg'),
stop: () => import('./icons/stop.svg'),
collectionLight: () => import('./icons/collectionLight.svg'),
Expand Down Expand Up @@ -89,7 +86,6 @@ const iconPaths = {
moveLight: () => import('./icons/light/move.svg'),
questionGuide: () => import('./icons/app/questionGuide.svg'),
loading: () => import('./icons/light/loading.svg'),
pause: () => import('./icons/common/pause.svg'),
'core/app/aiLight': () => import('./icons/core/app/aiLight.svg'),
'core/app/aiFill': () => import('./icons/core/app/aiFill.svg'),
'common/text/t': () => import('./icons/common/text/t.svg'),
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/MyModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const MyModal = ({
minW={['90vw', '400px']}
maxW={maxW}
position={'relative'}
maxH={'90vh'}
maxH={['80vh', '85vh']}
{...props}
>
{!title && onClose && <ModalCloseButton zIndex={1} />}
Expand Down
6 changes: 3 additions & 3 deletions projects/app/src/components/common/ParentPaths/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const ParentPaths = (props: {
return paths.length === 0 && !!FirstPathDom ? (
<>{FirstPathDom}</>
) : (
<Flex flex={1}>
<Flex flex={1} ml={-2}>
{concatPaths.map((item, i) => (
<Flex key={item.parentId} alignItems={'center'}>
<Flex key={item.parentId || i} alignItems={'center'}>
<Box
fontSize={['sm', 'lg']}
py={1}
Expand All @@ -51,7 +51,7 @@ const ParentPaths = (props: {
{item.parentName}
</Box>
{i !== concatPaths.length - 1 && (
<MyIcon name={'rightArrowLight'} color={'myGray.500'} w={['14px', '24px']} />
<MyIcon name={'rightArrowLight'} color={'myGray.500'} w={'14px'} />
)}
</Flex>
))}
Expand Down
64 changes: 13 additions & 51 deletions projects/app/src/components/core/dataset/SelectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useTranslation } from 'next-i18next';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import { Box, Flex, ModalHeader } from '@chakra-ui/react';
import MyIcon from '@/components/Icon';
import ParentPaths from '@/components/common/ParentPaths';

type PathItemType = {
parentId: string;
Expand All @@ -14,15 +15,13 @@ type PathItemType = {

const DatasetSelectContainer = ({
isOpen,
parentId,
setParentId,
paths,
onClose,
tips,
children
}: {
isOpen: boolean;
parentId?: string;
setParentId: Dispatch<string>;
paths: PathItemType[];
onClose: () => void;
Expand All @@ -35,45 +34,17 @@ const DatasetSelectContainer = ({
return (
<MyModal isOpen={isOpen} onClose={onClose} w={'100%'} maxW={['90vw', '900px']} isCentered>
<Flex flexDirection={'column'} h={'90vh'}>
<ModalHeader>
{!!parentId ? (
<Flex
flex={1}
userSelect={'none'}
fontSize={['sm', 'lg']}
fontWeight={'normal'}
color={'myGray.900'}
>
{paths.map((item, i) => (
<Flex key={item.parentId} mr={2} alignItems={'center'}>
<Box
fontSize={'lg'}
borderRadius={'md'}
{...(i === paths.length - 1
? {
cursor: 'default'
}
: {
cursor: 'pointer',
_hover: {
color: 'myBlue.600'
},
onClick: () => {
setParentId(item.parentId);
}
})}
>
{item.parentName}
</Box>
{i !== paths.length - 1 && (
<MyIcon name={'rightArrowLight'} color={'myGray.500'} w={['18px', '24px']} />
)}
</Flex>
))}
</Flex>
) : (
<Box>{t('chat.Select Mark Kb')}</Box>
)}
<ModalHeader fontWeight={'normal'}>
<ParentPaths
paths={paths.map((path, i) => ({
parentId: path.parentId,
parentName: path.parentName
}))}
FirstPathDom={t('chat.Select Mark Kb')}
onClick={(e) => {
setParentId(e);
}}
/>
{!!tips && (
<Box fontSize={'sm'} color={'myGray.500'} fontWeight={'normal'}>
{tips}
Expand All @@ -94,16 +65,7 @@ export function useDatasetSelect() {
Promise.all([getDatasets({ parentId }), getDatasetPaths(parentId)])
);

const paths = useMemo(
() => [
{
parentId: '',
parentName: t('dataset.My Dataset')
},
...(data?.[1] || [])
],
[data, t]
);
const paths = useMemo(() => [...(data?.[1] || [])], [data]);

return {
parentId,
Expand Down
23 changes: 10 additions & 13 deletions projects/app/src/components/core/module/DatasetSelectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import { useTranslation } from 'next-i18next';
import { useDatasetStore } from '@/web/core/dataset/store/dataset';
import { feConfigs } from '@/web/common/system/staticData';
import DatasetSelectContainer, { useDatasetSelect } from '@/components/core/dataset/SelectModal';
import { useLoading } from '@/web/common/hooks/useLoading';
import EmptyTip from '@/components/EmptyTip';

export type KbParamsType = {
searchSimilarity: number;
Expand Down Expand Up @@ -54,7 +56,8 @@ export const DatasetSelectModal = ({
})
);
const { toast } = useToast();
const { paths, parentId, setParentId, datasets } = useDatasetSelect();
const { paths, setParentId, datasets, isLoading } = useDatasetSelect();
const { Loading } = useLoading();

const filterKbList = useMemo(() => {
return {
Expand All @@ -71,9 +74,8 @@ export const DatasetSelectModal = ({
<DatasetSelectContainer
isOpen={isOpen}
paths={paths}
parentId={parentId}
setParentId={setParentId}
tips={'仅能选择同一个索引模型的知识库'}
tips={t('dataset.Select Dataset Tips')}
onClose={onClose}
>
<Flex h={'100%'} flexDirection={'column'} flex={'1 0 0'}>
Expand Down Expand Up @@ -158,7 +160,7 @@ export const DatasetSelectModal = ({
if (vectorModel && vectorModel !== item.vectorModel.model) {
return toast({
status: 'warning',
title: '仅能选择同一个索引模型的知识库'
title: t('dataset.Select Dataset Tips')
});
}
setSelectedKbList((state) => [
Expand Down Expand Up @@ -197,14 +199,7 @@ export const DatasetSelectModal = ({
})()
)}
</Grid>
{filterKbList.unSelected.length === 0 && (
<Flex mt={5} flexDirection={'column'} alignItems={'center'}>
<MyIcon name="empty" w={'48px'} h={'48px'} mt={'20vh'} color={'transparent'} />
<Box mt={2} color={'myGray.500'}>
这个目录已经没东西可选了~
</Box>
</Flex>
)}
{filterKbList.unSelected.length === 0 && <EmptyTip text={t('common.folder.empty')} />}
</ModalBody>

<ModalFooter>
Expand All @@ -219,9 +214,11 @@ export const DatasetSelectModal = ({
onChange(filterKbList);
}}
>
完成
{t('common.Done')}
</Button>
</ModalFooter>

<Loading fixed={false} loading={isLoading} />
</Flex>
</DatasetSelectContainer>
);
Expand Down
Loading

0 comments on commit 0558379

Please sign in to comment.