fix: eco knowledge retrieval method (#6798)

This commit is contained in:
zxhlyh
2024-07-30 16:59:03 +08:00
committed by GitHub
parent 0675c5f716
commit 0a744a73b3
4 changed files with 33 additions and 5 deletions

View File

@@ -32,6 +32,7 @@ import { RerankingModeEnum } from '@/models/datasets'
import cn from '@/utils/classnames'
import { useSelectedDatasetsMode } from '@/app/components/workflow/nodes/knowledge-retrieval/hooks'
import Switch from '@/app/components/base/switch'
import { useGetLanguage } from '@/context/i18n'
type Props = {
datasetConfigs: DatasetConfigs
@@ -43,6 +44,11 @@ type Props = {
selectedDatasets?: DataSet[]
}
const LEGACY_LINK_MAP = {
en_US: 'https://docs.dify.ai/guides/knowledge-base/integrate-knowledge-within-application',
zh_Hans: 'https://docs.dify.ai/v/zh-hans/guides/knowledge-base/integrate_knowledge_within_application',
} as Record<string, string>
const ConfigContent: FC<Props> = ({
datasetConfigs,
onChange,
@@ -53,6 +59,7 @@ const ConfigContent: FC<Props> = ({
selectedDatasets = [],
}) => {
const { t } = useTranslation()
const language = useGetLanguage()
const selectedDatasetsMode = useSelectedDatasetsMode(selectedDatasets)
const type = datasetConfigs.retrieval_model
const setType = (value: RETRIEVE_TYPE) => {
@@ -167,7 +174,21 @@ const ConfigContent: FC<Props> = ({
title={(
<div className='flex items-center'>
{t('appDebug.datasetConfig.retrieveOneWay.title')}
<TooltipPlus popupContent={<div className='w-[320px]'>{t('dataset.nTo1RetrievalLegacy')}</div>}>
<TooltipPlus
popupContent={(
<div className='w-[320px]'>
{t('dataset.nTo1RetrievalLegacy')}
<a
className='underline'
href={LEGACY_LINK_MAP[language]}
target='_blank'
rel='noopener noreferrer'
>
({t('dataset.nTo1RetrievalLegacyLink')})
</a>
</div>
)}
>
<div className='ml-1 flex items-center px-[5px] h-[18px] rounded-[5px] border border-text-accent-secondary system-2xs-medium-uppercase text-text-accent-secondary'>legacy</div>
</TooltipPlus>
</div>