Commit 3d5da270 by Patrickill Committed by Archer

add ComplianceTip for dataset&chat

parent c454fe07
...@@ -34,6 +34,7 @@ export type FastGPTFeConfigsType = { ...@@ -34,6 +34,7 @@ export type FastGPTFeConfigsType = {
show_openai_account?: boolean; show_openai_account?: boolean;
show_promotion?: boolean; show_promotion?: boolean;
show_team_chat?: boolean; show_team_chat?: boolean;
show_compliance_documentation?: boolean;
concatMd?: string; concatMd?: string;
docUrl?: string; docUrl?: string;
......
...@@ -292,6 +292,10 @@ ...@@ -292,6 +292,10 @@
"comon": { "comon": {
"Continue_Adding": "Continue Adding" "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", "confirm_choice": "Confirm Choice",
"contribute_app_template": "Contribute Template", "contribute_app_template": "Contribute Template",
"core": { "core": {
...@@ -1482,4 +1486,4 @@ ...@@ -1482,4 +1486,4 @@
"verification": "Verification", "verification": "Verification",
"xx_search_result": "{{key}} Search Results", "xx_search_result": "{{key}} Search Results",
"yes": "Yes" "yes": "Yes"
} }
\ No newline at end of file
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
"switch_package_a": "套餐使用规则为优先使用更高级的套餐,因此,购买的新套餐若比当前套餐更高级,则新套餐立即生效:否则将继续使用当前套餐。", "switch_package_a": "套餐使用规则为优先使用更高级的套餐,因此,购买的新套餐若比当前套餐更高级,则新套餐立即生效:否则将继续使用当前套餐。",
"switch_package_q": "是否切换订阅套餐?" "switch_package_q": "是否切换订阅套餐?"
}, },
"compliance": {
"chat": "内容由第三方 AI 生成,无法确保真实准确,仅供参考",
"dataset": "请确保您的内容严格遵守相关法律法规,避免包含任何违法或侵权的内容。请谨慎上传可能涉及敏感信息的资料。"
},
"Folder": "文件夹", "Folder": "文件夹",
"Login": "登录", "Login": "登录",
"Move": "移动", "Move": "移动",
...@@ -1482,4 +1486,4 @@ ...@@ -1482,4 +1486,4 @@
"verification": "验证", "verification": "验证",
"xx_search_result": "{{key}} 的搜索结果", "xx_search_result": "{{key}} 的搜索结果",
"yes": "是" "yes": "是"
} }
\ No newline at end of file
...@@ -38,6 +38,7 @@ import { clone } from 'lodash'; ...@@ -38,6 +38,7 @@ import { clone } from 'lodash';
import { formatFileSize } from '@fastgpt/global/common/file/tools'; import { formatFileSize } from '@fastgpt/global/common/file/tools';
import MyBox from '@fastgpt/web/components/common/MyBox'; import MyBox from '@fastgpt/web/components/common/MyBox';
import { getErrText } from '@fastgpt/global/common/error/utils'; import { getErrText } from '@fastgpt/global/common/error/utils';
import ComplianceTip, { TipTypeEnum } from '@/components/support/compliance/ComplianceTip';
const InputGuideBox = dynamic(() => import('./InputGuideBox')); const InputGuideBox = dynamic(() => import('./InputGuideBox'));
...@@ -709,6 +710,7 @@ const ChatInput = ({ ...@@ -709,6 +710,7 @@ const ChatInput = ({
{RenderTextarea} {RenderTextarea}
</Box> </Box>
<ComplianceTip type={TipTypeEnum.chat} />
</Box> </Box>
); );
}; };
......
...@@ -6,6 +6,7 @@ import Markdown from '@/components/Markdown'; ...@@ -6,6 +6,7 @@ import Markdown from '@/components/Markdown';
import { FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant'; import { FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
import AIResponseBox from '../../../components/AIResponseBox'; import AIResponseBox from '../../../components/AIResponseBox';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import ComplianceTip, { TipTypeEnum } from '@/components/support/compliance/ComplianceTip';
const RenderOutput = () => { const RenderOutput = () => {
const { histories, isChatting } = useContextSelector(PluginRunContext, (v) => v); const { histories, isChatting } = useContextSelector(PluginRunContext, (v) => v);
const { t } = useTranslation(); const { t } = useTranslation();
...@@ -49,6 +50,7 @@ const RenderOutput = () => { ...@@ -49,6 +50,7 @@ const RenderOutput = () => {
) : null} ) : null}
</Box> </Box>
</Box> </Box>
<ComplianceTip type={TipTypeEnum.chat} />
</> </>
); );
}; };
......
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 = ({ ...@@ -72,7 +72,7 @@ export const useChatTest = ({
const CustomChatContainer = useMemoizedFn(() => const CustomChatContainer = useMemoizedFn(() =>
appDetail.type === AppTypeEnum.plugin ? ( appDetail.type === AppTypeEnum.plugin ? (
<Box h={'100%'} p={3}> <Box p={3}>
<PluginRunBox <PluginRunBox
pluginInputs={pluginInputs} pluginInputs={pluginInputs}
variablesForm={variablesForm} variablesForm={variablesForm}
......
...@@ -20,6 +20,7 @@ import AIModelSelector from '@/components/Select/AIModelSelector'; ...@@ -20,6 +20,7 @@ import AIModelSelector from '@/components/Select/AIModelSelector';
import MyIcon from '@fastgpt/web/components/common/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useSystem } from '@fastgpt/web/hooks/useSystem'; import { useSystem } from '@fastgpt/web/hooks/useSystem';
import QuestionTip from '@fastgpt/web/components/common/MyTooltip/QuestionTip'; import QuestionTip from '@fastgpt/web/components/common/MyTooltip/QuestionTip';
import ComplianceTip, { TipTypeEnum } from '@/components/support/compliance/ComplianceTip';
export type CreateDatasetType = export type CreateDatasetType =
| DatasetTypeEnum.dataset | DatasetTypeEnum.dataset
...@@ -224,15 +225,18 @@ const CreateModal = ({ ...@@ -224,15 +225,18 @@ const CreateModal = ({
</Box> </Box>
</Flex> </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> </ModalBody>
<ModalFooter px={9}> <ModalFooter px={9} pt={0}>
<Button variant={'whiteBase'} mr={3} onClick={onClose}> <ComplianceTip pt={0} type={TipTypeEnum.dataset} />
{t('common:common.Close')}
</Button>
<Button isLoading={creating} onClick={handleSubmit((data) => onclickCreate(data))}>
{t('common:common.Confirm Create')}
</Button>
</ModalFooter> </ModalFooter>
<File onSelect={onSelectFile} /> <File onSelect={onSelectFile} />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment