mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-05-23 21:19:44 +08:00
fix: Add model by ollama in model provider page, user can't choose the model in chat window. #2479 (#2529)
### 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)
This commit is contained in:
parent
d8a43416f5
commit
f6ceb43e36
@ -1,3 +1,5 @@
|
|||||||
|
import { LlmModelType } from '@/constants/knowledge';
|
||||||
|
import { useSelectLlmOptionsByModelType } from '@/hooks/llm-hooks';
|
||||||
import { Popover, Select } from 'antd';
|
import { Popover, Select } from 'antd';
|
||||||
import LlmSettingItems from '../llm-setting-items';
|
import LlmSettingItems from '../llm-setting-items';
|
||||||
|
|
||||||
@ -8,6 +10,8 @@ interface IProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const LLMSelect = ({ id, value, onChange }: IProps) => {
|
const LLMSelect = ({ id, value, onChange }: IProps) => {
|
||||||
|
const modelOptions = useSelectLlmOptionsByModelType();
|
||||||
|
|
||||||
const content = (
|
const content = (
|
||||||
<div style={{ width: 400 }}>
|
<div style={{ width: 400 }}>
|
||||||
<LlmSettingItems
|
<LlmSettingItems
|
||||||
@ -25,6 +29,10 @@ const LLMSelect = ({ id, value, onChange }: IProps) => {
|
|||||||
destroyTooltipOnHide
|
destroyTooltipOnHide
|
||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
|
options={[
|
||||||
|
...modelOptions[LlmModelType.Chat],
|
||||||
|
...modelOptions[LlmModelType.Image2text],
|
||||||
|
]}
|
||||||
style={{ width: '100%' }}
|
style={{ width: '100%' }}
|
||||||
dropdownStyle={{ display: 'none' }}
|
dropdownStyle={{ display: 'none' }}
|
||||||
id={id}
|
id={id}
|
||||||
|
@ -71,7 +71,7 @@ export const useSelectLlmOptionsByModelType = () => {
|
|||||||
)
|
)
|
||||||
.map((x) => ({
|
.map((x) => ({
|
||||||
label: x.llm_name,
|
label: x.llm_name,
|
||||||
value: x.llm_name,
|
value: `${x.llm_name}@${x.fid}`,
|
||||||
disabled: !x.available,
|
disabled: !x.available,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user