mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? fix: Add model by ollama in model provider page, user can't choose the model in chat window. #2479 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import { LlmModelType } from '@/constants/knowledge';
|
|
import { useSelectLlmOptionsByModelType } from '@/hooks/llm-hooks';
|
|
import { Popover, Select } from 'antd';
|
|
import LlmSettingItems from '../llm-setting-items';
|
|
|
|
interface IProps {
|
|
id?: string;
|
|
value?: string;
|
|
onChange?: (value: string) => void;
|
|
}
|
|
|
|
const LLMSelect = ({ id, value, onChange }: IProps) => {
|
|
const modelOptions = useSelectLlmOptionsByModelType();
|
|
|
|
const content = (
|
|
<div style={{ width: 400 }}>
|
|
<LlmSettingItems
|
|
formItemLayout={{ labelCol: { span: 10 }, wrapperCol: { span: 14 } }}
|
|
></LlmSettingItems>
|
|
</div>
|
|
);
|
|
|
|
return (
|
|
<Popover
|
|
content={content}
|
|
trigger="click"
|
|
placement="left"
|
|
arrow={false}
|
|
destroyTooltipOnHide
|
|
>
|
|
<Select
|
|
options={[
|
|
...modelOptions[LlmModelType.Chat],
|
|
...modelOptions[LlmModelType.Image2text],
|
|
]}
|
|
style={{ width: '100%' }}
|
|
dropdownStyle={{ display: 'none' }}
|
|
id={id}
|
|
value={value}
|
|
onChange={onChange}
|
|
/>
|
|
</Popover>
|
|
);
|
|
};
|
|
|
|
export default LLMSelect;
|