diff --git a/web/app/components/app/chat/thought/index.tsx b/web/app/components/app/chat/thought/index.tsx index 789c7bc262..df0d284813 100644 --- a/web/app/components/app/chat/thought/index.tsx +++ b/web/app/components/app/chat/thought/index.tsx @@ -37,12 +37,13 @@ const Thought: FC = ({ const getThoughtText = (item: ThoughtItem) => { try { const input = JSON.parse(item.tool_input) - + // dataset + if (item.tool.startsWith('dataset-')) { + const dataSetId = item.tool.replace('dataset-', '') + const datasetName = dataSets?.find(item => item.id === dataSetId)?.name || 'unknown dataset' + return t('explore.universalChat.thought.res.dataset').replace('{datasetName}', `${datasetName}`) + } switch (item.tool) { - case 'dataset': - // eslint-disable-next-line no-case-declarations - const datasetName = dataSets?.find(item => item.id === input.dataset_id)?.name || 'unknown dataset' - return t('explore.universalChat.thought.res.dataset').replace('{datasetName}', `${datasetName}`) case 'web_reader': return t(`explore.universalChat.thought.res.webReader.${!input.cursor ? 'normal' : 'hasPageInfo'}`).replace('{url}', `${input.url}`) case 'google_search':