Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: LLM with ___ return cannot be deleted #5585 (#5587)

balibabua283fefd18e6
diff --git a/web/src/hooks/llm-hooks.tsx b/web/src/hooks/llm-hooks.tsx
index e4deb055ff..d907a49074 100644
--- a/web/src/hooks/llm-hooks.tsx
+++ b/web/src/hooks/llm-hooks.tsx
@@ -198,7 +198,7 @@ export const useSelectLlmList = () => {
name: key,
logo: factoryList.find((x) => x.name === key)?.logo ?? '',
...value,
- llm: value.llm.map((x) => ({ ...x, name: getRealModelName(x.name) })),
+ llm: value.llm.map((x) => ({ ...x, name: x.name })),
}));
}, [myLlmList, factoryList]);
diff --git a/web/src/pages/user-setting/setting-model/index.tsx b/web/src/pages/user-setting/setting-model/index.tsx
index c9fcd64afd..6464041978 100644
--- a/web/src/pages/user-setting/setting-model/index.tsx
+++ b/web/src/pages/user-setting/setting-model/index.tsx
@@ -4,6 +4,7 @@ import { useTheme } from '@/components/theme-provider';
import { LLMFactory } from '@/constants/llm';
import { useSetModalState, useTranslate } from '@/hooks/common-hooks';
import { LlmItem, useSelectLlmList } from '@/hooks/llm-hooks';
+import { getRealModelName } from '@/utils/llm-util';
import { CloseCircleOutlined, SettingOutlined } from '@ant-design/icons';
import {
Button,
@@ -130,7 +131,8 @@ const ModelCard = ({ item, clickApiKey }: IModelCardProps) => {
renderItem={(item) => (
<List.Item>
<Space>
- {item.name} <Tag color="#b8b8b8">{item.type}</Tag>
+ {getRealModelName(item.name)}
+ <Tag color="#b8b8b8">{item.type}</Tag>
<Tooltip title={t('delete', { keyPrefix: 'common' })}>
<Button type={'text'} onClick={handleDeleteLlm(item.name)}>
<CloseCircleOutlined style={{ color: '#D92D20' }} />