Fix: Merge different types of models from the same manufacturer #10146 (#10157)

### What problem does this PR solve?

Fix: Merge different types of models from the same manufacturer #10146

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2025-09-18 17:15:54 +08:00
committed by GitHub
parent 62d35b1b73
commit ff3b4d0dcd
2 changed files with 11 additions and 9 deletions

View File

@ -136,6 +136,7 @@ export const useSelectLlmOptionsByModelType = () => {
};
};
// Merge different types of models from the same manufacturer under one manufacturer
export const useComposeLlmOptionsByModelTypes = (
modelTypes: LlmModelType[],
) => {

View File

@ -1,7 +1,10 @@
import { IModalManagerChildrenProps } from '@/components/modal-manager';
import { LlmModelType } from '@/constants/knowledge';
import { useTranslate } from '@/hooks/common-hooks';
import { ISystemModelSettingSavingParams } from '@/hooks/llm-hooks';
import {
ISystemModelSettingSavingParams,
useComposeLlmOptionsByModelTypes,
} from '@/hooks/llm-hooks';
import { Form, Modal, Select } from 'antd';
import { useEffect } from 'react';
import { useFetchSystemModelSettingOnMount } from '../hooks';
@ -43,6 +46,11 @@ const SystemModelSettingModal = ({
const onFormLayoutChange = () => {};
const modelOptions = useComposeLlmOptionsByModelTypes([
LlmModelType.Chat,
LlmModelType.Image2text,
]);
return (
<Modal
title={t('systemModelSettings')}
@ -58,14 +66,7 @@ const SystemModelSettingModal = ({
name="llm_id"
tooltip={t('chatModelTip')}
>
<Select
options={[
...allOptions[LlmModelType.Chat],
...allOptions[LlmModelType.Image2text],
]}
allowClear
showSearch
/>
<Select options={modelOptions} allowClear showSearch />
</Form.Item>
<Form.Item
label={t('embeddingModel')}