fix: eco knowledge retrieval method (#6798)

This commit is contained in:
zxhlyh 2024-07-30 16:59:03 +08:00 • committed by GitHub
commit 0a744a73b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 33 additions and 5 deletions

View file

@ -8,7 +8,10 @@ export const useKnowledge = () => {
return t(`dataset.indexingTechnique.${indexingTechnique}`)
}, [t])
const formatIndexingMethod = useCallback((indexingMethod: string) => {
const formatIndexingMethod = useCallback((indexingMethod: string, isEco?: boolean) => {
if (isEco)
return t('dataset.indexingMethod.invertedIndex')
return t(`dataset.indexingMethod.${indexingMethod}`)
}, [t])
@ -16,7 +19,7 @@ export const useKnowledge = () => {
let result = formatIndexingTechnique(indexingTechnique)
if (indexingMethod)
result += ` · ${formatIndexingMethod(indexingMethod)}`
result += ` · ${formatIndexingMethod(indexingMethod, indexingTechnique === 'economy')}`
return result
}, [formatIndexingTechnique, formatIndexingMethod])