diff --git a/web/src/components/llm-select/llm-label.tsx b/web/src/components/llm-select/llm-label.tsx
index dcdffab5e..29c75c91f 100644
--- a/web/src/components/llm-select/llm-label.tsx
+++ b/web/src/components/llm-select/llm-label.tsx
@@ -1,6 +1,5 @@
-import { LlmModelType } from '@/constants/knowledge';
-import { useComposeLlmOptionsByModelTypes } from '@/hooks/llm-hooks';
-import { useMemo } from 'react';
+import { getLLMIconName, getLlmNameAndFIdByLlmId } from '@/utils/llm-util';
+import { LlmIcon } from '../svg-icon';
interface IProps {
id?: string;
@@ -10,22 +9,19 @@ interface IProps {
}
const LLMLabel = ({ value }: IProps) => {
- const modelOptions = useComposeLlmOptionsByModelTypes([
- LlmModelType.Chat,
- LlmModelType.Image2text,
- ]);
+ const { llmName, fId } = getLlmNameAndFIdByLlmId(value);
- const label = useMemo(() => {
- for (const item of modelOptions) {
- for (const option of item.options) {
- if (option.value === value) {
- return option.label;
- }
- }
- }
- }, [modelOptions, value]);
-
- return
{label}
;
+ return (
+
+
+ {llmName}
+
+ );
};
export default LLMLabel;
diff --git a/web/src/components/llm-setting-items/index.tsx b/web/src/components/llm-setting-items/index.tsx
index 158761c3e..23d026892 100644
--- a/web/src/components/llm-setting-items/index.tsx
+++ b/web/src/components/llm-setting-items/index.tsx
@@ -54,7 +54,11 @@ const LlmSettingItems = ({ prefix, formItemLayout = {} }: IProps) => {
{...formItemLayout}
rules={[{ required: true, message: t('modelMessage') }]}
>
-
+
diff --git a/web/src/hooks/chat-hooks.ts b/web/src/hooks/chat-hooks.ts
index 44ceda768..93a55421c 100644
--- a/web/src/hooks/chat-hooks.ts
+++ b/web/src/hooks/chat-hooks.ts
@@ -253,8 +253,12 @@ export const useFetchNextConversationList = () => {
enabled: !!dialogId,
queryFn: async () => {
const { data } = await chatService.listConversation({ dialogId });
- if (data.code === 0 && data.data.length > 0) {
- handleClickConversation(data.data[0].id, '');
+ if (data.code === 0) {
+ if (data.data.length > 0) {
+ handleClickConversation(data.data[0].id, '');
+ } else {
+ handleClickConversation('', '');
+ }
}
return data?.data;
},
diff --git a/web/src/hooks/llm-hooks.tsx b/web/src/hooks/llm-hooks.tsx
index 2a3451dbc..4bb3c2fb3 100644
--- a/web/src/hooks/llm-hooks.tsx
+++ b/web/src/hooks/llm-hooks.tsx
@@ -13,6 +13,7 @@ import {
} from '@/interfaces/request/llm';
import userService from '@/services/user-service';
import { sortLLmFactoryListBySpecifiedOrder } from '@/utils/common-util';
+import { getLLMIconName } from '@/utils/llm-util';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { Flex, message } from 'antd';
import { DefaultOptionType } from 'antd/es/select';
@@ -54,14 +55,6 @@ export const useSelectLlmOptions = () => {
return embeddingModelOptions;
};
-const getLLMIconName = (fid: string, llm_name: string) => {
- if (fid === 'FastEmbed') {
- return llm_name.split('/').at(0) ?? '';
- }
-
- return fid;
-};
-
export const useSelectLlmOptionsByModelType = () => {
const llmInfo: IThirdOAIModelCollection = useFetchLlmList();
diff --git a/web/src/utils/llm-util.ts b/web/src/utils/llm-util.ts
new file mode 100644
index 000000000..0d2a2cfde
--- /dev/null
+++ b/web/src/utils/llm-util.ts
@@ -0,0 +1,13 @@
+export const getLLMIconName = (fid: string, llm_name: string) => {
+ if (fid === 'FastEmbed') {
+ return llm_name.split('/').at(0) ?? '';
+ }
+
+ return fid;
+};
+
+export const getLlmNameAndFIdByLlmId = (llmId?: string) => {
+ const [llmName, fId] = llmId?.split('@') || [];
+
+ return { fId, llmName };
+};
diff --git a/web/tailwind.css b/web/tailwind.css
index 54af4ba53..1e5bae923 100644
--- a/web/tailwind.css
+++ b/web/tailwind.css
@@ -169,4 +169,9 @@
h4 {
@apply text-base font-normal;
}
+
+ img,
+ video {
+ max-width: none;
+ }
}