mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### 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:
@ -136,6 +136,7 @@ export const useSelectLlmOptionsByModelType = () => {
|
||||
};
|
||||
};
|
||||
|
||||
// Merge different types of models from the same manufacturer under one manufacturer
|
||||
export const useComposeLlmOptionsByModelTypes = (
|
||||
modelTypes: LlmModelType[],
|
||||
) => {
|
||||
|
||||
@ -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')}
|
||||
|
||||
Reference in New Issue
Block a user