mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 12:20:34 +00:00
add ComplianceTip for dataset&chat
This commit is contained in:
@@ -34,6 +34,7 @@ export type FastGPTFeConfigsType = {
|
||||
show_openai_account?: boolean;
|
||||
show_promotion?: boolean;
|
||||
show_team_chat?: boolean;
|
||||
show_compliance_documentation?: boolean;
|
||||
concatMd?: string;
|
||||
|
||||
docUrl?: string;
|
||||
|
@@ -292,6 +292,10 @@
|
||||
"comon": {
|
||||
"Continue_Adding": "Continue Adding"
|
||||
},
|
||||
"compliance": {
|
||||
"chat": "The content is generated by third-party AI and cannot be guaranteed to be true and accurate. It is for reference only.",
|
||||
"compliance.dataset": "Please ensure that your content strictly complies with relevant laws and regulations and avoid containing any illegal or infringing content. \nPlease be careful when uploading materials that may contain sensitive information."
|
||||
},
|
||||
"confirm_choice": "Confirm Choice",
|
||||
"contribute_app_template": "Contribute Template",
|
||||
"core": {
|
||||
@@ -1482,4 +1486,4 @@
|
||||
"verification": "Verification",
|
||||
"xx_search_result": "{{key}} Search Results",
|
||||
"yes": "Yes"
|
||||
}
|
||||
}
|
||||
|
@@ -19,6 +19,10 @@
|
||||
"switch_package_a": "套餐使用规则为优先使用更高级的套餐,因此,购买的新套餐若比当前套餐更高级,则新套餐立即生效:否则将继续使用当前套餐。",
|
||||
"switch_package_q": "是否切换订阅套餐?"
|
||||
},
|
||||
"compliance": {
|
||||
"chat": "内容由第三方 AI 生成,无法确保真实准确,仅供参考",
|
||||
"dataset": "请确保您的内容严格遵守相关法律法规,避免包含任何违法或侵权的内容。请谨慎上传可能涉及敏感信息的资料。"
|
||||
},
|
||||
"Folder": "文件夹",
|
||||
"Login": "登录",
|
||||
"Move": "移动",
|
||||
@@ -1482,4 +1486,4 @@
|
||||
"verification": "验证",
|
||||
"xx_search_result": "{{key}} 的搜索结果",
|
||||
"yes": "是"
|
||||
}
|
||||
}
|
||||
|
@@ -38,6 +38,7 @@ import { clone } from 'lodash';
|
||||
import { formatFileSize } from '@fastgpt/global/common/file/tools';
|
||||
import MyBox from '@fastgpt/web/components/common/MyBox';
|
||||
import { getErrText } from '@fastgpt/global/common/error/utils';
|
||||
import ComplianceTip, { TipTypeEnum } from '@/components/support/compliance/ComplianceTip';
|
||||
|
||||
const InputGuideBox = dynamic(() => import('./InputGuideBox'));
|
||||
|
||||
@@ -709,6 +710,7 @@ const ChatInput = ({
|
||||
|
||||
{RenderTextarea}
|
||||
</Box>
|
||||
<ComplianceTip type={TipTypeEnum.chat} />
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
@@ -6,6 +6,7 @@ import Markdown from '@/components/Markdown';
|
||||
import { FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
|
||||
import AIResponseBox from '../../../components/AIResponseBox';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import ComplianceTip, { TipTypeEnum } from '@/components/support/compliance/ComplianceTip';
|
||||
const RenderOutput = () => {
|
||||
const { histories, isChatting } = useContextSelector(PluginRunContext, (v) => v);
|
||||
const { t } = useTranslation();
|
||||
@@ -49,6 +50,7 @@ const RenderOutput = () => {
|
||||
) : null}
|
||||
</Box>
|
||||
</Box>
|
||||
<ComplianceTip type={TipTypeEnum.chat} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@@ -0,0 +1,36 @@
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
import { Box, BoxProps } from '@chakra-ui/react';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { useMemo } from 'react';
|
||||
export enum TipTypeEnum {
|
||||
chat = 'chat',
|
||||
dataset = 'dataset'
|
||||
}
|
||||
const ChatTip = ({ type, ...props }: { type: `${TipTypeEnum}` } & BoxProps) => {
|
||||
const { t } = useTranslation();
|
||||
const { feConfigs } = useSystemStore();
|
||||
const textMap = useMemo(() => {
|
||||
return {
|
||||
[TipTypeEnum.chat]: t('common:compliance.chat'),
|
||||
[TipTypeEnum.dataset]: t('common:compliance.dataset')
|
||||
};
|
||||
}, [t]);
|
||||
return (
|
||||
feConfigs.show_compliance_documentation && (
|
||||
<Box
|
||||
w={'100%'}
|
||||
textAlign={'center'}
|
||||
fontSize={'0.6875rem'}
|
||||
fontWeight={'400'}
|
||||
pt={3}
|
||||
pb={[3, 0]}
|
||||
color={'myGray.400'}
|
||||
{...props}
|
||||
>
|
||||
{textMap[type]}
|
||||
</Box>
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
export default ChatTip;
|
@@ -72,7 +72,7 @@ export const useChatTest = ({
|
||||
|
||||
const CustomChatContainer = useMemoizedFn(() =>
|
||||
appDetail.type === AppTypeEnum.plugin ? (
|
||||
<Box h={'100%'} p={3}>
|
||||
<Box p={3}>
|
||||
<PluginRunBox
|
||||
pluginInputs={pluginInputs}
|
||||
variablesForm={variablesForm}
|
||||
|
@@ -20,6 +20,7 @@ import AIModelSelector from '@/components/Select/AIModelSelector';
|
||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
||||
import { useSystem } from '@fastgpt/web/hooks/useSystem';
|
||||
import QuestionTip from '@fastgpt/web/components/common/MyTooltip/QuestionTip';
|
||||
import ComplianceTip, { TipTypeEnum } from '@/components/support/compliance/ComplianceTip';
|
||||
|
||||
export type CreateDatasetType =
|
||||
| DatasetTypeEnum.dataset
|
||||
@@ -224,15 +225,18 @@ const CreateModal = ({
|
||||
</Box>
|
||||
</Flex>
|
||||
)}
|
||||
<Flex w={'100%'} pt={6} justifyContent={'flex-end'}>
|
||||
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button isLoading={creating} onClick={handleSubmit((data) => onclickCreate(data))}>
|
||||
{t('common:common.Confirm Create')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</ModalBody>
|
||||
|
||||
<ModalFooter px={9}>
|
||||
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button isLoading={creating} onClick={handleSubmit((data) => onclickCreate(data))}>
|
||||
{t('common:common.Confirm Create')}
|
||||
</Button>
|
||||
<ModalFooter px={9} pt={0}>
|
||||
<ComplianceTip pt={0} type={TipTypeEnum.dataset} />
|
||||
</ModalFooter>
|
||||
|
||||
<File onSelect={onSelectFile} />
|
||||
|
Reference in New Issue
Block a user